From a8384b5db2274d50a350910d7cfd3fc36b4f4103 Mon Sep 17 00:00:00 2001 From: Far Date: Sat, 26 Jun 2021 10:13:23 +0800 Subject: [PATCH 01/43] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BA=86?= =?UTF-8?q?=E5=86=85=E6=A0=B8=E7=9A=84VFAT=E6=B5=8B=E8=AF=95=E7=94=A8?= =?UTF-8?q?=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复内容包括如下: 1. 将memset_s中buffer的大小设置正确; 2. 将用例文件夹名由vfat2修改为vfat; 3. 修复了vfat用例在SetUpTestcase和TearDownTestCase; 4. 全局变量g_fatFilesystem在初始化时设置为2(即FAT32); Close #I3XF3R Signed-off-by: Far --- testsuites/unittest/BUILD.gn | 6 +- .../unittest/fs/{vfat2 => vfat}/BUILD.gn | 2 +- .../unittest/fs/{vfat2 => vfat}/It_vfs_fat.h | 5 +- .../fs/{vfat2 => vfat}/VfsFatTest.cpp | 44 ++++----- .../{vfat2 => vfat}/full/It_vfs_fat_066.cpp | 2 +- .../{vfat2 => vfat}/full/It_vfs_fat_068.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_072.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_073.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_074.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_496.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_497.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_498.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_499.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_500.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_501.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_502.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_503.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_504.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_506.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_507.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_508.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_509.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_510.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_511.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_512.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_513.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_514.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_515.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_516.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_517.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_518.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_519.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_662.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_663.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_664.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_665.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_666.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_667.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_668.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_669.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_670.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_671.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_672.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_673.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_674.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_675.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_676.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_677.cpp | 4 - .../{vfat2 => vfat}/full/It_vfs_fat_678.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_679.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_680.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_681.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_682.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_683.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_684.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_685.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_686.cpp | 2 +- .../{vfat2 => vfat}/full/It_vfs_fat_687.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_692.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_693.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_694.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_870.cpp | 2 +- .../{vfat2 => vfat}/full/It_vfs_fat_872.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_873.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_874.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_875.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_902.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_903.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_904.cpp | 0 .../{vfat2 => vfat}/full/It_vfs_fat_909.cpp | 4 +- .../pressure/It_fs_fat_performance_001.cpp | 0 .../pressure/It_fs_fat_performance_002.cpp | 0 .../pressure/It_fs_fat_performance_003.cpp | 0 .../pressure/It_fs_fat_performance_004.cpp | 0 .../pressure/It_fs_fat_performance_005.cpp | 0 .../pressure/It_fs_fat_performance_006.cpp | 0 .../pressure/It_fs_fat_performance_007.cpp | 0 .../pressure/It_fs_fat_performance_008.cpp | 0 .../pressure/It_fs_fat_performance_013.cpp | 2 +- .../pressure/It_fs_fat_performance_014.cpp | 2 +- .../pressure/It_fs_fat_performance_015.cpp | 6 +- .../pressure/It_fs_fat_performance_016.cpp | 6 +- .../pressure/It_fs_fat_pressure_029.cpp | 0 .../pressure/It_fs_fat_pressure_030.cpp | 24 ++--- .../pressure/It_fs_fat_pressure_031.cpp | 0 .../pressure/It_fs_fat_pressure_038.cpp | 8 +- .../pressure/It_fs_fat_pressure_040.cpp | 0 .../pressure/It_fs_fat_pressure_041.cpp | 4 +- .../pressure/It_fs_fat_pressure_042.cpp | 0 .../pressure/It_fs_fat_pressure_301.cpp | 0 .../pressure/It_fs_fat_pressure_302.cpp | 0 .../pressure/It_fs_fat_pressure_303.cpp | 0 .../pressure/It_fs_fat_pressure_305.cpp | 0 .../pressure/It_fs_fat_pressure_306.cpp | 4 +- .../pressure/It_fs_fat_pressure_309.cpp | 0 .../pressure/It_vfs_fat_mutipthread_003.cpp | 6 +- .../pressure/It_vfs_fat_mutipthread_004.cpp | 6 +- .../pressure/It_vfs_fat_mutipthread_005.cpp | 18 ++-- .../pressure/It_vfs_fat_mutipthread_006.cpp | 18 ++-- .../pressure/It_vfs_fat_mutipthread_008.cpp | 6 +- .../pressure/It_vfs_fat_mutipthread_009.cpp | 6 +- .../pressure/It_vfs_fat_mutipthread_010.cpp | 6 +- .../pressure/It_vfs_fat_mutipthread_012.cpp | 6 +- .../pressure/It_vfs_fat_mutipthread_014.cpp | 6 +- .../pressure/It_vfs_fat_mutipthread_016.cpp | 6 +- .../pressure/It_vfs_fat_mutipthread_017.cpp | 6 +- .../pressure/It_vfs_fat_mutipthread_018.cpp | 6 +- .../pressure/It_vfs_fat_mutipthread_019.cpp | 6 +- .../pressure/It_vfs_fat_mutipthread_020.cpp | 6 +- .../pressure/It_vfs_fat_mutipthread_021.cpp | 6 +- .../pressure/It_vfs_fat_mutipthread_022.cpp | 6 +- .../pressure/It_vfs_fat_mutipthread_023.cpp | 6 +- .../pressure/It_vfs_fat_mutipthread_024.cpp | 6 +- .../pressure/It_vfs_fat_mutipthread_027.cpp | 6 +- .../pressure/It_vfs_fat_mutipthread_029.cpp | 8 +- .../pressure/It_vfs_fat_mutipthread_030.cpp | 8 +- .../pressure/It_vfs_fat_mutipthread_032.cpp | 8 +- .../pressure/It_vfs_fat_mutipthread_033.cpp | 6 +- .../pressure/It_vfs_fat_mutipthread_035.cpp | 6 +- .../pressure/It_vfs_fat_mutipthread_036.cpp | 6 +- .../pressure/It_vfs_fat_mutipthread_038.cpp | 6 +- .../pressure/It_vfs_fat_mutipthread_039.cpp | 8 +- .../pressure/It_vfs_fat_mutipthread_040.cpp | 6 +- .../pressure/It_vfs_fat_mutipthread_041.cpp | 6 +- .../pressure/It_vfs_fat_mutipthread_042.cpp | 6 +- .../pressure/It_vfs_fat_mutipthread_043.cpp | 6 +- .../pressure/It_vfs_fat_mutipthread_044.cpp | 6 +- .../pressure/It_vfs_fat_mutipthread_045.cpp | 6 +- .../pressure/It_vfs_fat_mutipthread_046.cpp | 96 +++++-------------- .../pressure/It_vfs_fat_mutipthread_047.cpp | 6 +- .../pressure/It_vfs_fat_mutipthread_048.cpp | 6 +- .../pressure/It_vfs_fat_mutipthread_049.cpp | 6 +- .../pressure/It_vfs_fat_mutipthread_050.cpp | 6 +- .../{vfat2 => vfat}/smoke/It_vfs_fat_026.cpp | 2 +- 134 files changed, 213 insertions(+), 266 deletions(-) rename testsuites/unittest/fs/{vfat2 => vfat}/BUILD.gn (99%) rename testsuites/unittest/fs/{vfat2 => vfat}/It_vfs_fat.h (99%) rename testsuites/unittest/fs/{vfat2 => vfat}/VfsFatTest.cpp (98%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_066.cpp (99%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_068.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_072.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_073.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_074.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_496.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_497.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_498.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_499.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_500.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_501.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_502.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_503.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_504.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_506.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_507.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_508.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_509.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_510.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_511.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_512.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_513.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_514.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_515.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_516.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_517.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_518.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_519.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_662.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_663.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_664.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_665.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_666.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_667.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_668.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_669.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_670.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_671.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_672.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_673.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_674.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_675.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_676.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_677.cpp (98%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_678.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_679.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_680.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_681.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_682.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_683.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_684.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_685.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_686.cpp (99%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_687.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_692.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_693.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_694.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_870.cpp (99%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_872.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_873.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_874.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_875.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_902.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_903.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_904.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/full/It_vfs_fat_909.cpp (97%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_fs_fat_performance_001.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_fs_fat_performance_002.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_fs_fat_performance_003.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_fs_fat_performance_004.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_fs_fat_performance_005.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_fs_fat_performance_006.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_fs_fat_performance_007.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_fs_fat_performance_008.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_fs_fat_performance_013.cpp (98%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_fs_fat_performance_014.cpp (98%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_fs_fat_performance_015.cpp (98%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_fs_fat_performance_016.cpp (98%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_fs_fat_pressure_029.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_fs_fat_pressure_030.cpp (86%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_fs_fat_pressure_031.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_fs_fat_pressure_038.cpp (98%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_fs_fat_pressure_040.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_fs_fat_pressure_041.cpp (99%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_fs_fat_pressure_042.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_fs_fat_pressure_301.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_fs_fat_pressure_302.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_fs_fat_pressure_303.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_fs_fat_pressure_305.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_fs_fat_pressure_306.cpp (97%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_fs_fat_pressure_309.cpp (100%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_vfs_fat_mutipthread_003.cpp (98%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_vfs_fat_mutipthread_004.cpp (98%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_vfs_fat_mutipthread_005.cpp (95%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_vfs_fat_mutipthread_006.cpp (97%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_vfs_fat_mutipthread_008.cpp (98%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_vfs_fat_mutipthread_009.cpp (98%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_vfs_fat_mutipthread_010.cpp (98%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_vfs_fat_mutipthread_012.cpp (99%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_vfs_fat_mutipthread_014.cpp (99%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_vfs_fat_mutipthread_016.cpp (99%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_vfs_fat_mutipthread_017.cpp (98%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_vfs_fat_mutipthread_018.cpp (99%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_vfs_fat_mutipthread_019.cpp (98%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_vfs_fat_mutipthread_020.cpp (98%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_vfs_fat_mutipthread_021.cpp (98%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_vfs_fat_mutipthread_022.cpp (98%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_vfs_fat_mutipthread_023.cpp (98%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_vfs_fat_mutipthread_024.cpp (98%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_vfs_fat_mutipthread_027.cpp (98%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_vfs_fat_mutipthread_029.cpp (97%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_vfs_fat_mutipthread_030.cpp (97%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_vfs_fat_mutipthread_032.cpp (97%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_vfs_fat_mutipthread_033.cpp (98%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_vfs_fat_mutipthread_035.cpp (98%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_vfs_fat_mutipthread_036.cpp (98%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_vfs_fat_mutipthread_038.cpp (98%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_vfs_fat_mutipthread_039.cpp (98%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_vfs_fat_mutipthread_040.cpp (98%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_vfs_fat_mutipthread_041.cpp (98%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_vfs_fat_mutipthread_042.cpp (98%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_vfs_fat_mutipthread_043.cpp (98%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_vfs_fat_mutipthread_044.cpp (98%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_vfs_fat_mutipthread_045.cpp (98%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_vfs_fat_mutipthread_046.cpp (87%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_vfs_fat_mutipthread_047.cpp (98%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_vfs_fat_mutipthread_048.cpp (98%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_vfs_fat_mutipthread_049.cpp (98%) rename testsuites/unittest/fs/{vfat2 => vfat}/pressure/It_vfs_fat_mutipthread_050.cpp (98%) rename testsuites/unittest/fs/{vfat2 => vfat}/smoke/It_vfs_fat_026.cpp (99%) diff --git a/testsuites/unittest/BUILD.gn b/testsuites/unittest/BUILD.gn index da118cdf..f287a343 100644 --- a/testsuites/unittest/BUILD.gn +++ b/testsuites/unittest/BUILD.gn @@ -81,13 +81,13 @@ group("unittest") { } if (LOSCFG_USER_TEST_FS_VFAT == true) { if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) { - deps += [ "fs/vfat2:liteos_a_fs_vfat_unittest_door" ] + deps += [ "fs/vfat:liteos_a_fs_vfat_unittest_door" ] } if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) { - deps += [ "fs/vfat2:liteos_a_fs_vfat_unittest" ] + deps += [ "fs/vfat:liteos_a_fs_vfat_unittest" ] } if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_HIGH) { - deps += [ "fs/vfat2:liteos_a_fs_vfat_unittest_pressure" ] + deps += [ "fs/vfat:liteos_a_fs_vfat_unittest_pressure" ] } } if (LOSCFG_USER_TEST_FS_PROC == true) { diff --git a/testsuites/unittest/fs/vfat2/BUILD.gn b/testsuites/unittest/fs/vfat/BUILD.gn similarity index 99% rename from testsuites/unittest/fs/vfat2/BUILD.gn rename to testsuites/unittest/fs/vfat/BUILD.gn index 47d650d1..cae4233e 100644 --- a/testsuites/unittest/fs/vfat2/BUILD.gn +++ b/testsuites/unittest/fs/vfat/BUILD.gn @@ -34,7 +34,7 @@ common_include_dirs = [ "//third_party/googletest/googletest/include", "../../common/include", "//kernel/liteos_a/testsuites/unittest/fs/vfs", - "//kernel/liteos_a/testsuites/unittest/fs/vfat2", + "//kernel/liteos_a/testsuites/unittest/fs/vfat", ] sources_entry = [ diff --git a/testsuites/unittest/fs/vfat2/It_vfs_fat.h b/testsuites/unittest/fs/vfat/It_vfs_fat.h similarity index 99% rename from testsuites/unittest/fs/vfat2/It_vfs_fat.h rename to testsuites/unittest/fs/vfat/It_vfs_fat.h index a2e0c125..e863e1fc 100644 --- a/testsuites/unittest/fs/vfat2/It_vfs_fat.h +++ b/testsuites/unittest/fs/vfat/It_vfs_fat.h @@ -33,7 +33,6 @@ #define IT_VFS_FAT_H #include "osTest.h" -#include "syslog.h" #include "sys/uio.h" #include "utime.h" #include @@ -265,6 +264,8 @@ VOID ItFsFat903(VOID); VOID ItFsFat904(VOID); VOID ItFsFat909(VOID); +#endif + #if defined(LOSCFG_USER_TEST_PRESSURE) VOID ItFsFatMutipthread003(VOID); VOID ItFsFatMutipthread004(VOID); @@ -334,5 +335,3 @@ VOID ItFsFatPerformance007(VOID); VOID ItFsFatPerformance008(VOID); #endif - -#endif \ No newline at end of file diff --git a/testsuites/unittest/fs/vfat2/VfsFatTest.cpp b/testsuites/unittest/fs/vfat/VfsFatTest.cpp similarity index 98% rename from testsuites/unittest/fs/vfat2/VfsFatTest.cpp rename to testsuites/unittest/fs/vfat/VfsFatTest.cpp index ba226ec4..b87e7f31 100644 --- a/testsuites/unittest/fs/vfat2/VfsFatTest.cpp +++ b/testsuites/unittest/fs/vfat/VfsFatTest.cpp @@ -788,26 +788,20 @@ public: { INT32 ret = 0; sleep(3); // 3s - if (ret != 0) - perror("format sd card"); - return; + ret = mkdir("/vs/", S_IRWXU | S_IRWXG | S_IRWXO); if (ret != 0) { perror("mkdir mount dir"); - return; - - ret = mkdir(FAT_MOUNT_DIR, S_IRWXU | S_IRWXG | S_IRWXO); - if (ret != 0) { - perror("mkdir mount dir"); - return; - - ret = mount(FAT_DEV_PATH, FAT_MOUNT_DIR, FAT_FILESYS_TYPE, 0, nullptr); - if (ret != 0) { - perror("mount sd card"); - return; - } - } } + + ret = mkdir(FAT_MOUNT_DIR, S_IRWXU | S_IRWXG | S_IRWXO); + if (ret != 0) { + perror("mkdir mount dir"); + } + + g_fatFilesystem = 2; + ret = mount(FAT_DEV_PATH, FAT_MOUNT_DIR, FAT_FILESYS_TYPE, 0, nullptr); + ASSERT_EQ(0, ret); } static void TearDownTestCase(void) { @@ -815,6 +809,13 @@ public: } }; +#if defined(LOSCFG_USER_TEST_SMOKE) +HWTEST_F(VfsFatTest, ItFsFat026, TestSize.Level0) +{ + ItFsFat026(); +} +#endif + #if defined(LOSCFG_USER_TEST_FULL) HWTEST_F(VfsFatTest, ItFsFat066, TestSize.Level0) { @@ -1146,7 +1147,8 @@ HWTEST_F(VfsFatTest, ItFsFat909, TestSize.Level0) ItFsFat909(); // plug and unplug during writing or reading } -#endif +#endif // LOSCFG_USER_TEST_FULL + #if defined(LOSCFG_USER_TEST_PRESSURE) HWTEST_F(VfsFatTest, ItFsFatPressure040, TestSize.Level0) { @@ -1460,11 +1462,5 @@ HWTEST_F(VfsFatTest, ItFsFatPerformance008, TestSize.Level0) ItFsFatPerformance008(); // fix write and read for three pthread } -#endif -#if defined(LOSCFG_USER_TEST_SMOKE) -HWTEST_F(VfsFatTest, ItFsFat026, TestSize.Level0) -{ - ItFsFat026(); // statfs Unsupport -} -#endif +#endif // LOSCFG_USER_TEST_PRESSURE } // namespace OHOS diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_066.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_066.cpp similarity index 99% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_066.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_066.cpp index 13c60710..8bd2ddec 100644 --- a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_066.cpp +++ b/testsuites/unittest/fs/vfat/full/It_vfs_fat_066.cpp @@ -53,7 +53,7 @@ static const int CLUSTER_SIZE64 = 64; static const int CLUSTER_SIZE128 = 128; static const int CLUSTER_SIZE255 = 255; static const int CLUSTER_SIZE256 = 256; -static const int SECTOR_SIZE = 128; +static const int SECTOR_SIZE = 512; static UINT32 TestCase(VOID) { diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_068.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_068.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_068.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_068.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_072.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_072.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_072.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_072.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_073.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_073.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_073.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_073.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_074.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_074.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_074.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_074.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_496.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_496.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_496.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_496.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_497.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_497.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_497.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_497.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_498.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_498.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_498.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_498.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_499.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_499.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_499.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_499.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_500.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_500.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_500.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_500.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_501.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_501.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_501.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_501.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_502.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_502.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_502.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_502.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_503.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_503.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_503.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_503.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_504.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_504.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_504.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_504.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_506.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_506.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_506.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_506.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_507.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_507.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_507.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_507.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_508.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_508.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_508.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_508.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_509.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_509.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_509.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_509.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_510.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_510.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_510.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_510.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_511.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_511.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_511.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_511.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_512.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_512.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_512.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_512.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_513.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_513.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_513.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_513.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_514.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_514.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_514.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_514.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_515.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_515.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_515.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_515.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_516.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_516.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_516.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_516.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_517.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_517.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_517.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_517.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_518.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_518.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_518.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_518.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_519.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_519.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_519.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_519.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_662.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_662.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_662.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_662.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_663.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_663.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_663.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_663.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_664.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_664.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_664.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_664.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_665.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_665.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_665.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_665.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_666.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_666.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_666.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_666.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_667.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_667.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_667.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_667.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_668.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_668.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_668.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_668.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_669.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_669.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_669.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_669.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_670.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_670.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_670.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_670.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_671.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_671.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_671.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_671.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_672.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_672.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_672.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_672.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_673.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_673.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_673.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_673.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_674.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_674.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_674.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_674.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_675.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_675.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_675.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_675.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_676.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_676.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_676.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_676.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_677.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_677.cpp similarity index 98% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_677.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_677.cpp index 51b2483c..4c8dca7a 100644 --- a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_677.cpp +++ b/testsuites/unittest/fs/vfat/full/It_vfs_fat_677.cpp @@ -130,10 +130,6 @@ static UINT32 TestCase(VOID) ICUNIT_GOTO_EQUAL(ret, FAT_NO_ERROR, ret, EXIT1); FatStatfsPrintf(buf1); - ICUNIT_GOTO_EQUAL(ret, FAT_IS_ERROR, ret, EXIT1); - - ICUNIT_GOTO_EQUAL(ret, FAT_IS_ERROR, ret, EXIT1); - ret = statfs(pathname1, &buf2); ICUNIT_GOTO_EQUAL(ret, FAT_NO_ERROR, ret, EXIT1); FatStatfsPrintf(buf2); diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_678.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_678.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_678.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_678.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_679.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_679.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_679.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_679.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_680.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_680.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_680.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_680.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_681.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_681.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_681.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_681.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_682.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_682.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_682.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_682.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_683.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_683.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_683.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_683.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_684.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_684.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_684.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_684.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_685.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_685.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_685.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_685.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_686.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_686.cpp similarity index 99% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_686.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_686.cpp index cc5e1cf1..33573f51 100644 --- a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_686.cpp +++ b/testsuites/unittest/fs/vfat/full/It_vfs_fat_686.cpp @@ -62,7 +62,7 @@ static UINT32 TestCase(VOID) ICUNIT_GOTO_NOT_EQUAL(writebuf, NULL, writebuf, EXIT); (void)memset_s(writebuf, size + 1, 0, size + 1); ret = memset_s(writebuf, size + 1, 0x61, size); - ICUNIT_GOTO_NOT_EQUAL(ret, 0, ret, EXIT); + ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); fd = open(pathname1, O_NONBLOCK | O_CREAT | O_RDWR | O_EXCL, S_IRWXU | S_IRWXG | S_IRWXO); ICUNIT_GOTO_NOT_EQUAL(fd, FAT_IS_ERROR, fd, EXIT1); diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_687.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_687.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_687.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_687.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_692.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_692.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_692.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_692.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_693.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_693.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_693.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_693.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_694.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_694.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_694.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_694.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_870.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_870.cpp similarity index 99% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_870.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_870.cpp index cf88c74f..aaec7768 100644 --- a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_870.cpp +++ b/testsuites/unittest/fs/vfat/full/It_vfs_fat_870.cpp @@ -113,7 +113,7 @@ static UINT32 TestCase(VOID) ret = write(g_fatFd, bufWrite, strlen(bufWrite)); if (ret <= 0) { if (g_testCount < (4 * BYTES_PER_KBYTES / 8)) { // 4 * BYTES_PER_KBYTES MB/GB, 8MB per write - printf("The biggest file size is smaller than the 4GB"); + printf("The biggest file size is smaller than the 4GB\n"); goto EXIT2; } printf("The cycle count = :%d,the file size = :%dMB,= :%0.3lfGB\n", g_testCount, diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_872.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_872.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_872.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_872.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_873.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_873.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_873.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_873.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_874.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_874.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_874.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_874.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_875.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_875.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_875.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_875.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_902.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_902.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_902.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_902.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_903.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_903.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_903.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_903.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_904.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_904.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_904.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_904.cpp diff --git a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_909.cpp b/testsuites/unittest/fs/vfat/full/It_vfs_fat_909.cpp similarity index 97% rename from testsuites/unittest/fs/vfat2/full/It_vfs_fat_909.cpp rename to testsuites/unittest/fs/vfat/full/It_vfs_fat_909.cpp index bba7944b..28ce4c79 100644 --- a/testsuites/unittest/fs/vfat2/full/It_vfs_fat_909.cpp +++ b/testsuites/unittest/fs/vfat/full/It_vfs_fat_909.cpp @@ -62,8 +62,8 @@ static UINT32 TestCase(VOID) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB - for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // 1M * BYTES_PER_KBYTES * 4 = 4GB - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // 256 * BYTES_PER_KBYTES * 4 = 1MB + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } ret = mkdir(pathname, S_IRWXU | S_IRWXG | S_IRWXO); diff --git a/testsuites/unittest/fs/vfat2/pressure/It_fs_fat_performance_001.cpp b/testsuites/unittest/fs/vfat/pressure/It_fs_fat_performance_001.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/pressure/It_fs_fat_performance_001.cpp rename to testsuites/unittest/fs/vfat/pressure/It_fs_fat_performance_001.cpp diff --git a/testsuites/unittest/fs/vfat2/pressure/It_fs_fat_performance_002.cpp b/testsuites/unittest/fs/vfat/pressure/It_fs_fat_performance_002.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/pressure/It_fs_fat_performance_002.cpp rename to testsuites/unittest/fs/vfat/pressure/It_fs_fat_performance_002.cpp diff --git a/testsuites/unittest/fs/vfat2/pressure/It_fs_fat_performance_003.cpp b/testsuites/unittest/fs/vfat/pressure/It_fs_fat_performance_003.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/pressure/It_fs_fat_performance_003.cpp rename to testsuites/unittest/fs/vfat/pressure/It_fs_fat_performance_003.cpp diff --git a/testsuites/unittest/fs/vfat2/pressure/It_fs_fat_performance_004.cpp b/testsuites/unittest/fs/vfat/pressure/It_fs_fat_performance_004.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/pressure/It_fs_fat_performance_004.cpp rename to testsuites/unittest/fs/vfat/pressure/It_fs_fat_performance_004.cpp diff --git a/testsuites/unittest/fs/vfat2/pressure/It_fs_fat_performance_005.cpp b/testsuites/unittest/fs/vfat/pressure/It_fs_fat_performance_005.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/pressure/It_fs_fat_performance_005.cpp rename to testsuites/unittest/fs/vfat/pressure/It_fs_fat_performance_005.cpp diff --git a/testsuites/unittest/fs/vfat2/pressure/It_fs_fat_performance_006.cpp b/testsuites/unittest/fs/vfat/pressure/It_fs_fat_performance_006.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/pressure/It_fs_fat_performance_006.cpp rename to testsuites/unittest/fs/vfat/pressure/It_fs_fat_performance_006.cpp diff --git a/testsuites/unittest/fs/vfat2/pressure/It_fs_fat_performance_007.cpp b/testsuites/unittest/fs/vfat/pressure/It_fs_fat_performance_007.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/pressure/It_fs_fat_performance_007.cpp rename to testsuites/unittest/fs/vfat/pressure/It_fs_fat_performance_007.cpp diff --git a/testsuites/unittest/fs/vfat2/pressure/It_fs_fat_performance_008.cpp b/testsuites/unittest/fs/vfat/pressure/It_fs_fat_performance_008.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/pressure/It_fs_fat_performance_008.cpp rename to testsuites/unittest/fs/vfat/pressure/It_fs_fat_performance_008.cpp diff --git a/testsuites/unittest/fs/vfat2/pressure/It_fs_fat_performance_013.cpp b/testsuites/unittest/fs/vfat/pressure/It_fs_fat_performance_013.cpp similarity index 98% rename from testsuites/unittest/fs/vfat2/pressure/It_fs_fat_performance_013.cpp rename to testsuites/unittest/fs/vfat/pressure/It_fs_fat_performance_013.cpp index ed82e423..b71a9256 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_fs_fat_performance_013.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_fs_fat_performance_013.cpp @@ -65,7 +65,7 @@ static UINT32 TestCase(VOID) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB // 1M for (i = 0; i < 200 * 4; i++) { // append 200 * 4 times to 1M - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } ret = mkdir(pathname0, S_IRWXU | S_IRWXG | S_IRWXO); diff --git a/testsuites/unittest/fs/vfat2/pressure/It_fs_fat_performance_014.cpp b/testsuites/unittest/fs/vfat/pressure/It_fs_fat_performance_014.cpp similarity index 98% rename from testsuites/unittest/fs/vfat2/pressure/It_fs_fat_performance_014.cpp rename to testsuites/unittest/fs/vfat/pressure/It_fs_fat_performance_014.cpp index 2b0276f1..1fe244bd 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_fs_fat_performance_014.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_fs_fat_performance_014.cpp @@ -75,7 +75,7 @@ static UINT32 TestCase(VOID) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < 200 * 4; i++) { // append 200 * 4 times to 1M - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } ret = mkdir(pathname1, S_IRWXU | S_IRWXG | S_IRWXO); diff --git a/testsuites/unittest/fs/vfat2/pressure/It_fs_fat_performance_015.cpp b/testsuites/unittest/fs/vfat/pressure/It_fs_fat_performance_015.cpp similarity index 98% rename from testsuites/unittest/fs/vfat2/pressure/It_fs_fat_performance_015.cpp rename to testsuites/unittest/fs/vfat/pressure/It_fs_fat_performance_015.cpp index dcdda2d4..39dced3d 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_fs_fat_performance_015.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_fs_fat_performance_015.cpp @@ -64,7 +64,7 @@ static VOID *PthreadF01(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < 4; i++) { // append 4 times to 1M - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } ret = mkdir(bufname, S_IRWXU | S_IRWXG | S_IRWXO); @@ -156,7 +156,7 @@ static VOID *PthreadF02(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < 4; i++) { // append 4 times to 1M - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } ret = mkdir(bufname, S_IRWXU | S_IRWXG | S_IRWXO); @@ -247,7 +247,7 @@ static VOID *PthreadF03(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < 4; i++) { // append 4 times to 1M - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } ret = mkdir(bufname, S_IRWXU | S_IRWXG | S_IRWXO); diff --git a/testsuites/unittest/fs/vfat2/pressure/It_fs_fat_performance_016.cpp b/testsuites/unittest/fs/vfat/pressure/It_fs_fat_performance_016.cpp similarity index 98% rename from testsuites/unittest/fs/vfat2/pressure/It_fs_fat_performance_016.cpp rename to testsuites/unittest/fs/vfat/pressure/It_fs_fat_performance_016.cpp index d47d8d66..c6f64ce2 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_fs_fat_performance_016.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_fs_fat_performance_016.cpp @@ -50,7 +50,7 @@ static VOID *PthreadF01(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < 4; i++) { // append 4 times to 1M - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } ret = mkdir(bufname, S_IRWXU | S_IRWXG | S_IRWXO); @@ -139,7 +139,7 @@ static VOID *PthreadF02(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < 4; i++) { // append 4 times to 1M - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } ret = mkdir(bufname, S_IRWXU | S_IRWXG | S_IRWXO); @@ -228,7 +228,7 @@ static VOID *PthreadF03(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < 4; i++) { // append 4 times to 1M - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } ret = mkdir(bufname, S_IRWXU | S_IRWXG | S_IRWXO); diff --git a/testsuites/unittest/fs/vfat2/pressure/It_fs_fat_pressure_029.cpp b/testsuites/unittest/fs/vfat/pressure/It_fs_fat_pressure_029.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/pressure/It_fs_fat_pressure_029.cpp rename to testsuites/unittest/fs/vfat/pressure/It_fs_fat_pressure_029.cpp diff --git a/testsuites/unittest/fs/vfat2/pressure/It_fs_fat_pressure_030.cpp b/testsuites/unittest/fs/vfat/pressure/It_fs_fat_pressure_030.cpp similarity index 86% rename from testsuites/unittest/fs/vfat2/pressure/It_fs_fat_pressure_030.cpp rename to testsuites/unittest/fs/vfat/pressure/It_fs_fat_pressure_030.cpp index a366f118..23f42249 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_fs_fat_pressure_030.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_fs_fat_pressure_030.cpp @@ -77,23 +77,23 @@ static UINT32 TestCase(VOID) (void)memset_s(bufWrite2, 16 * BYTES_PER_KBYTES + 1, 0, 16 * BYTES_PER_KBYTES + 1); // 16 kb for (j = 0; j < 16; j++) { // loop 16 times - (void)strcat_s(bufWrite2, 16 * BYTES_PER_KBYTES, filebuf); // 16kb - (void)strcat_s(bufWrite2, 16 * BYTES_PER_KBYTES, filebuf); // 16kb - (void)strcat_s(bufWrite2, 16 * BYTES_PER_KBYTES, filebuf); // 16kb - (void)strcat_s(bufWrite2, 16 * BYTES_PER_KBYTES, filebuf); // 16kb + (void)strcat_s(bufWrite2, 16 * BYTES_PER_KBYTES + 1, filebuf); // 16kb + (void)strcat_s(bufWrite2, 16 * BYTES_PER_KBYTES + 1, filebuf); // 16kb + (void)strcat_s(bufWrite2, 16 * BYTES_PER_KBYTES + 1, filebuf); // 16kb + (void)strcat_s(bufWrite2, 16 * BYTES_PER_KBYTES + 1, filebuf); // 16kb } for (i = 0; i < 4; i++) { // loop 4 times - (void)strcat_s(bufWrite1, 256 * BYTES_PER_KBYTES, bufWrite2); // 256kb - (void)strcat_s(bufWrite1, 256 * BYTES_PER_KBYTES, bufWrite2); // 256kb - (void)strcat_s(bufWrite1, 256 * BYTES_PER_KBYTES, bufWrite2); // 256kb - (void)strcat_s(bufWrite1, 256 * BYTES_PER_KBYTES, bufWrite2); // 256kb + (void)strcat_s(bufWrite1, 256 * BYTES_PER_KBYTES + 1, bufWrite2); // 256kb + (void)strcat_s(bufWrite1, 256 * BYTES_PER_KBYTES + 1, bufWrite2); // 256kb + (void)strcat_s(bufWrite1, 256 * BYTES_PER_KBYTES + 1, bufWrite2); // 256kb + (void)strcat_s(bufWrite1, 256 * BYTES_PER_KBYTES + 1, bufWrite2); // 256kb } for (i = 0; i < 5; i++) { // loop 5 times - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, bufWrite1); - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, bufWrite1); - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, bufWrite1); - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, bufWrite1); + (void)strcat_s(bufWrite, 5 * BYTES_PER_MBYTES + 1, bufWrite1); + (void)strcat_s(bufWrite, 5 * BYTES_PER_MBYTES + 1, bufWrite1); + (void)strcat_s(bufWrite, 5 * BYTES_PER_MBYTES + 1, bufWrite1); + (void)strcat_s(bufWrite, 5 * BYTES_PER_MBYTES + 1, bufWrite1); } free(bufWrite1); free(bufWrite2); diff --git a/testsuites/unittest/fs/vfat2/pressure/It_fs_fat_pressure_031.cpp b/testsuites/unittest/fs/vfat/pressure/It_fs_fat_pressure_031.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/pressure/It_fs_fat_pressure_031.cpp rename to testsuites/unittest/fs/vfat/pressure/It_fs_fat_pressure_031.cpp diff --git a/testsuites/unittest/fs/vfat2/pressure/It_fs_fat_pressure_038.cpp b/testsuites/unittest/fs/vfat/pressure/It_fs_fat_pressure_038.cpp similarity index 98% rename from testsuites/unittest/fs/vfat2/pressure/It_fs_fat_pressure_038.cpp rename to testsuites/unittest/fs/vfat/pressure/It_fs_fat_pressure_038.cpp index 72a6dfa3..a0d9531f 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_fs_fat_pressure_038.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_fs_fat_pressure_038.cpp @@ -214,8 +214,8 @@ static VOID *PthreadF02(void *arg) } for (i = 0; i < 10; i++) { // loop 10 times - (void)strcat_s(bufWrite, 10 * BYTES_PER_MBYTES, bufWrite1); // 10 * BYTES_PER_MBYTES = 10MB - (void)strcat_s(bufWrite, 10 * BYTES_PER_MBYTES, bufWrite1); // 10 * BYTES_PER_MBYTES = 10MB + (void)strcat_s(bufWrite, 10 * BYTES_PER_MBYTES + 1, bufWrite1); // 10 * BYTES_PER_MBYTES = 10MB + (void)strcat_s(bufWrite, 10 * BYTES_PER_MBYTES + 1, bufWrite1); // 10 * BYTES_PER_MBYTES = 10MB } free(bufWrite1); free(bufWrite2); @@ -331,11 +331,11 @@ static UINT32 TestCase(VOID) ICUNIT_GOTO_EQUAL(ret, FAT_NO_ERROR, ret, EXIT2); ret = PosixPthreadDestroy(&attr1, newThread1); - ICUNIT_GOTO_EQUAL(ret, FAT_NO_ERROR, ret, EXIT2); + ICUNIT_GOTO_EQUAL(ret, FAT_NO_ERROR, ret, EXIT1); printf("\tg_fatFlag=:%d\t", g_fatFlag); } printf("\n"); - ICUNIT_GOTO_EQUAL(g_fatFlag, FAT_PRESSURE_CYCLES, g_fatFlag, EXIT2); + ICUNIT_GOTO_EQUAL(g_fatFlag, FAT_PRESSURE_CYCLES, g_fatFlag, EXIT); dir = opendir(FAT_PATH_NAME); ICUNIT_GOTO_NOT_EQUAL(dir, NULL, dir, EXIT3); diff --git a/testsuites/unittest/fs/vfat2/pressure/It_fs_fat_pressure_040.cpp b/testsuites/unittest/fs/vfat/pressure/It_fs_fat_pressure_040.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/pressure/It_fs_fat_pressure_040.cpp rename to testsuites/unittest/fs/vfat/pressure/It_fs_fat_pressure_040.cpp diff --git a/testsuites/unittest/fs/vfat2/pressure/It_fs_fat_pressure_041.cpp b/testsuites/unittest/fs/vfat/pressure/It_fs_fat_pressure_041.cpp similarity index 99% rename from testsuites/unittest/fs/vfat2/pressure/It_fs_fat_pressure_041.cpp rename to testsuites/unittest/fs/vfat/pressure/It_fs_fat_pressure_041.cpp index 21ff9f4c..b85a244d 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_fs_fat_pressure_041.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_fs_fat_pressure_041.cpp @@ -212,6 +212,7 @@ static VOID *PthreadF02(void *arg) (void)strcat_s(bufWrite1, 10 * BYTES_PER_MBYTES + 1, bufWrite2); // 10 mb (void)strcat_s(bufWrite1, 10 * BYTES_PER_MBYTES + 1, bufWrite2); // 10 mb (void)strcat_s(bufWrite1, 10 * BYTES_PER_MBYTES + 1, bufWrite2); // 10 mb + (void)strcat_s(bufWrite1, 10 * BYTES_PER_MBYTES + 1, bufWrite2); // 10 mb } free(bufWrite4); @@ -357,7 +358,6 @@ static UINT32 TestCase(VOID) printf("\tg_fatFlag=:%d\t", g_fatFlag); } printf("\n"); - ICUNIT_GOTO_EQUAL(g_fatFlag, FAT_PRESSURE_CYCLES, g_fatFlag, EXIT2); dir = opendir(FAT_PATH_NAME); ICUNIT_GOTO_NOT_EQUAL(dir, NULL, dir, EXIT3); @@ -368,6 +368,8 @@ static UINT32 TestCase(VOID) ret = closedir(dir); ICUNIT_GOTO_EQUAL(ret, FAT_NO_ERROR, ret, EXIT3); + ICUNIT_GOTO_EQUAL(g_fatFlag, FAT_PRESSURE_CYCLES, g_fatFlag, EXIT); + ret = rmdir(FAT_PATH_NAME); ICUNIT_GOTO_EQUAL(ret, FAT_NO_ERROR, ret, EXIT); diff --git a/testsuites/unittest/fs/vfat2/pressure/It_fs_fat_pressure_042.cpp b/testsuites/unittest/fs/vfat/pressure/It_fs_fat_pressure_042.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/pressure/It_fs_fat_pressure_042.cpp rename to testsuites/unittest/fs/vfat/pressure/It_fs_fat_pressure_042.cpp diff --git a/testsuites/unittest/fs/vfat2/pressure/It_fs_fat_pressure_301.cpp b/testsuites/unittest/fs/vfat/pressure/It_fs_fat_pressure_301.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/pressure/It_fs_fat_pressure_301.cpp rename to testsuites/unittest/fs/vfat/pressure/It_fs_fat_pressure_301.cpp diff --git a/testsuites/unittest/fs/vfat2/pressure/It_fs_fat_pressure_302.cpp b/testsuites/unittest/fs/vfat/pressure/It_fs_fat_pressure_302.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/pressure/It_fs_fat_pressure_302.cpp rename to testsuites/unittest/fs/vfat/pressure/It_fs_fat_pressure_302.cpp diff --git a/testsuites/unittest/fs/vfat2/pressure/It_fs_fat_pressure_303.cpp b/testsuites/unittest/fs/vfat/pressure/It_fs_fat_pressure_303.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/pressure/It_fs_fat_pressure_303.cpp rename to testsuites/unittest/fs/vfat/pressure/It_fs_fat_pressure_303.cpp diff --git a/testsuites/unittest/fs/vfat2/pressure/It_fs_fat_pressure_305.cpp b/testsuites/unittest/fs/vfat/pressure/It_fs_fat_pressure_305.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/pressure/It_fs_fat_pressure_305.cpp rename to testsuites/unittest/fs/vfat/pressure/It_fs_fat_pressure_305.cpp diff --git a/testsuites/unittest/fs/vfat2/pressure/It_fs_fat_pressure_306.cpp b/testsuites/unittest/fs/vfat/pressure/It_fs_fat_pressure_306.cpp similarity index 97% rename from testsuites/unittest/fs/vfat2/pressure/It_fs_fat_pressure_306.cpp rename to testsuites/unittest/fs/vfat/pressure/It_fs_fat_pressure_306.cpp index 469e0618..dd508314 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_fs_fat_pressure_306.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_fs_fat_pressure_306.cpp @@ -75,9 +75,9 @@ static UINT32 TestCase(VOID) for (i = 0; i < 50; i++) { // loop 50 times (void)memset_s(bufname, FAT_SHORT_ARRAY_LENGTH, 0, FAT_SHORT_ARRAY_LENGTH); - (void)memset_s(pathname2[i], FAT_STANDARD_NAME_LENGTH, 0, FAT_SHORT_ARRAY_LENGTH); + (void)memset_s(pathname2[i], FAT_STANDARD_NAME_LENGTH, 0, FAT_STANDARD_NAME_LENGTH); (void)snprintf_s(bufname, FAT_SHORT_ARRAY_LENGTH, FAT_SHORT_ARRAY_LENGTH, "/test%d", i); - FatStrcat2(pathname2[i], bufname, strlen(bufname)); + FatStrcat2(pathname2[i], bufname, FAT_STANDARD_NAME_LENGTH); ret = mkdir(pathname2[i], S_IRWXU | S_IRWXG | S_IRWXO); ICUNIT_GOTO_EQUAL(ret, FAT_NO_ERROR, ret, EXIT2); diff --git a/testsuites/unittest/fs/vfat2/pressure/It_fs_fat_pressure_309.cpp b/testsuites/unittest/fs/vfat/pressure/It_fs_fat_pressure_309.cpp similarity index 100% rename from testsuites/unittest/fs/vfat2/pressure/It_fs_fat_pressure_309.cpp rename to testsuites/unittest/fs/vfat/pressure/It_fs_fat_pressure_309.cpp diff --git a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_003.cpp b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_003.cpp similarity index 98% rename from testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_003.cpp rename to testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_003.cpp index ca93e976..05798938 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_003.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_003.cpp @@ -51,7 +51,7 @@ static VOID *PthreadF01(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -186,7 +186,7 @@ static VOID *PthreadF02(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -320,7 +320,7 @@ static VOID *PthreadF03(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; diff --git a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_004.cpp b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_004.cpp similarity index 98% rename from testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_004.cpp rename to testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_004.cpp index cf9b091e..ca68b6b7 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_004.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_004.cpp @@ -52,7 +52,7 @@ static VOID *PthreadF01(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } printf("In %s,line %d\n", __FUNCTION__, __LINE__); index = 0; @@ -179,7 +179,7 @@ static VOID *PthreadF02(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } printf("In %s,line %d\n", __FUNCTION__, __LINE__); @@ -307,7 +307,7 @@ static VOID *PthreadF03(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } printf("In %s,line %d\n", __FUNCTION__, __LINE__); diff --git a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_005.cpp b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_005.cpp similarity index 95% rename from testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_005.cpp rename to testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_005.cpp index 0a063f65..adcbf5df 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_005.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_005.cpp @@ -51,7 +51,7 @@ static VOID *PthreadF01(void *arg) printf("pthread_f01 is excecuting\n"); bufWrite = (CHAR *)malloc(4 * BYTES_PER_MBYTES + 1); // 4MB ICUNIT_GOTO_NOT_EQUAL(bufWrite, NULL, 0, EXIT1); - (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, 4 * BYTES_PER_MBYTES + 1); // 4mb + (void)memset_s(bufWrite, 4 * BYTES_PER_MBYTES + 1, 0, 4 * BYTES_PER_MBYTES + 1); // 4mb bufWrite1 = (CHAR *)malloc(BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB ICUNIT_GOTO_NOT_EQUAL(bufWrite1, NULL, 0, EXIT2); @@ -76,8 +76,8 @@ static VOID *PthreadF01(void *arg) } for (i = 0; i < 2; i++) { // loop 2 times - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, bufWrite1); - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, bufWrite1); + (void)strcat_s(bufWrite, 4 * BYTES_PER_MBYTES + 1, bufWrite1); + (void)strcat_s(bufWrite, 4 * BYTES_PER_MBYTES + 1, bufWrite1); } free(bufWrite1); @@ -157,7 +157,7 @@ static VOID *PthreadF02(void *arg) printf("pthread_f02 is excecuting\n"); bufWrite = (CHAR *)malloc(4 * BYTES_PER_MBYTES + 1); // 4MB ICUNIT_GOTO_NOT_EQUAL(bufWrite, NULL, 0, EXIT1); - (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, 4 * BYTES_PER_MBYTES + 1); // 4mb + (void)memset_s(bufWrite, 4 * BYTES_PER_MBYTES + 1, 0, 4 * BYTES_PER_MBYTES + 1); // 4mb bufWrite1 = (CHAR *)malloc(BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB ICUNIT_GOTO_NOT_EQUAL(bufWrite1, NULL, 0, EXIT2); @@ -182,8 +182,8 @@ static VOID *PthreadF02(void *arg) } for (i = 0; i < 2; i++) { // loop 2 times - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, bufWrite1); - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, bufWrite1); + (void)strcat_s(bufWrite, 4 * BYTES_PER_MBYTES + 1, bufWrite1); + (void)strcat_s(bufWrite, 4 * BYTES_PER_MBYTES + 1, bufWrite1); } free(bufWrite1); @@ -263,7 +263,7 @@ static VOID *PthreadF03(void *arg) printf("pthread_f03 is excecuting\n"); bufWrite = (CHAR *)malloc(4 * BYTES_PER_MBYTES + 1); // 4MB ICUNIT_GOTO_NOT_EQUAL(bufWrite, NULL, 0, EXIT1); - (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, 4 * BYTES_PER_MBYTES + 1); // 4mb + (void)memset_s(bufWrite, 4 * BYTES_PER_MBYTES + 1, 0, 4 * BYTES_PER_MBYTES + 1); // 4mb bufWrite1 = (CHAR *)malloc(BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB ICUNIT_GOTO_NOT_EQUAL(bufWrite1, NULL, 0, EXIT2); @@ -288,8 +288,8 @@ static VOID *PthreadF03(void *arg) } for (i = 0; i < 2; i++) { // loop 2 times - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, bufWrite1); - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, bufWrite1); + (void)strcat_s(bufWrite, 4 * BYTES_PER_MBYTES + 1, bufWrite1); + (void)strcat_s(bufWrite, 4 * BYTES_PER_MBYTES + 1, bufWrite1); } free(bufWrite1); diff --git a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_006.cpp b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_006.cpp similarity index 97% rename from testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_006.cpp rename to testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_006.cpp index 29e22841..4a3212f6 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_006.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_006.cpp @@ -53,7 +53,7 @@ static VOID *PthreadF01(void *arg) bufWrite = (CHAR *)malloc(4 * BYTES_PER_MBYTES + 1); // 4MB ICUNIT_GOTO_NOT_EQUAL(bufWrite, NULL, 0, EXIT1); - (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, 4 * BYTES_PER_MBYTES + 1); // 4mb + (void)memset_s(bufWrite, 4 * BYTES_PER_MBYTES + 1, 0, 4 * BYTES_PER_MBYTES + 1); // 4mb bufWrite1 = (CHAR *)malloc(BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB ICUNIT_GOTO_NOT_EQUAL(bufWrite1, NULL, 0, EXIT2); @@ -78,8 +78,8 @@ static VOID *PthreadF01(void *arg) } for (i = 0; i < 2; i++) { // loop 2 times - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, bufWrite1); - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, bufWrite1); + (void)strcat_s(bufWrite, 4 * BYTES_PER_MBYTES + 1, bufWrite1); + (void)strcat_s(bufWrite, 4 * BYTES_PER_MBYTES + 1, bufWrite1); } free(bufWrite1); @@ -239,7 +239,7 @@ static VOID *PthreadF02(void *arg) bufWrite = (CHAR *)malloc(4 * BYTES_PER_MBYTES + 1); // 4MB ICUNIT_GOTO_NOT_EQUAL(bufWrite, NULL, 0, EXIT1); - (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, 4 * BYTES_PER_MBYTES + 1); // 4mb + (void)memset_s(bufWrite, 4 * BYTES_PER_MBYTES + 1, 0, 4 * BYTES_PER_MBYTES + 1); // 4mb bufWrite1 = (CHAR *)malloc(BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB ICUNIT_GOTO_NOT_EQUAL(bufWrite1, NULL, 0, EXIT2); @@ -264,8 +264,8 @@ static VOID *PthreadF02(void *arg) } for (i = 0; i < 2; i++) { // loop 2 times - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, bufWrite1); - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, bufWrite1); + (void)strcat_s(bufWrite, 4 * BYTES_PER_MBYTES + 1, bufWrite1); + (void)strcat_s(bufWrite, 4 * BYTES_PER_MBYTES + 1, bufWrite1); } free(bufWrite1); @@ -425,7 +425,7 @@ static VOID *PthreadF03(void *arg) bufWrite = (CHAR *)malloc(4 * BYTES_PER_MBYTES + 1); // 4MB ICUNIT_GOTO_NOT_EQUAL(bufWrite, NULL, 0, EXIT1); - (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, 4 * BYTES_PER_MBYTES + 1); // 4mb + (void)memset_s(bufWrite, 4 * BYTES_PER_MBYTES + 1, 0, 4 * BYTES_PER_MBYTES + 1); // 4mb bufWrite1 = (CHAR *)malloc(BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB ICUNIT_GOTO_NOT_EQUAL(bufWrite1, NULL, 0, EXIT2); @@ -450,8 +450,8 @@ static VOID *PthreadF03(void *arg) } for (i = 0; i < 2; i++) { // loop 2 times - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, bufWrite1); - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, bufWrite1); + (void)strcat_s(bufWrite, 4 * BYTES_PER_MBYTES + 1, bufWrite1); + (void)strcat_s(bufWrite, 4 * BYTES_PER_MBYTES + 1, bufWrite1); } free(bufWrite1); diff --git a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_008.cpp b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_008.cpp similarity index 98% rename from testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_008.cpp rename to testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_008.cpp index 2e5b8a49..619eb952 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_008.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_008.cpp @@ -55,7 +55,7 @@ static VOID *PthreadF01(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -191,7 +191,7 @@ static VOID *PthreadF02(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -327,7 +327,7 @@ static VOID *PthreadF03(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; diff --git a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_009.cpp b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_009.cpp similarity index 98% rename from testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_009.cpp rename to testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_009.cpp index fa619d10..6959b2a1 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_009.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_009.cpp @@ -49,7 +49,7 @@ static VOID *PthreadF01(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; for (i = 0; i < FAT_MAX_CYCLES; i++) { // 100 ļ @@ -134,7 +134,7 @@ static VOID *PthreadF02(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; for (i = 0; i < FAT_MAX_CYCLES; i++) { // 100 ļ @@ -219,7 +219,7 @@ static VOID *PthreadF03(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; for (i = 0; i < FAT_MAX_CYCLES; i++) { // 100 ļ diff --git a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_010.cpp b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_010.cpp similarity index 98% rename from testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_010.cpp rename to testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_010.cpp index 798f922d..a7e1f733 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_010.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_010.cpp @@ -53,7 +53,7 @@ static VOID *PthreadF01(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -194,7 +194,7 @@ static VOID *PthreadF02(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -336,7 +336,7 @@ static VOID *PthreadF03(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; diff --git a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_012.cpp b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_012.cpp similarity index 99% rename from testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_012.cpp rename to testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_012.cpp index fbb3acdc..4dd8e105 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_012.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_012.cpp @@ -56,7 +56,7 @@ static VOID *PthreadF01(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -218,7 +218,7 @@ static VOID *PthreadF02(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -378,7 +378,7 @@ static VOID *PthreadF03(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; diff --git a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_014.cpp b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_014.cpp similarity index 99% rename from testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_014.cpp rename to testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_014.cpp index a0dd652f..23824d53 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_014.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_014.cpp @@ -55,7 +55,7 @@ static VOID *PthreadF01(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -215,7 +215,7 @@ static VOID *PthreadF02(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -376,7 +376,7 @@ static VOID *PthreadF03(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; diff --git a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_016.cpp b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_016.cpp similarity index 99% rename from testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_016.cpp rename to testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_016.cpp index 17c1f2ee..7880ef62 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_016.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_016.cpp @@ -54,7 +54,7 @@ static VOID *PthreadF01(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -226,7 +226,7 @@ static VOID *PthreadF02(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -398,7 +398,7 @@ static VOID *PthreadF03(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; diff --git a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_017.cpp b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_017.cpp similarity index 98% rename from testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_017.cpp rename to testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_017.cpp index 4a87a7d2..06d41d21 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_017.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_017.cpp @@ -49,7 +49,7 @@ static VOID *PthreadF01(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -147,7 +147,7 @@ static VOID *PthreadF02(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -247,7 +247,7 @@ static VOID *PthreadF03(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; diff --git a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_018.cpp b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_018.cpp similarity index 99% rename from testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_018.cpp rename to testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_018.cpp index 3c19cf76..c66e24f0 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_018.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_018.cpp @@ -54,7 +54,7 @@ static VOID *PthreadF01(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -219,7 +219,7 @@ static VOID *PthreadF02(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -385,7 +385,7 @@ static VOID *PthreadF03(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; diff --git a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_019.cpp b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_019.cpp similarity index 98% rename from testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_019.cpp rename to testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_019.cpp index 606a36fd..8e71f3bf 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_019.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_019.cpp @@ -49,7 +49,7 @@ static VOID *PthreadF01(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -156,7 +156,7 @@ static VOID *PthreadF02(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -262,7 +262,7 @@ static VOID *PthreadF03(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; diff --git a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_020.cpp b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_020.cpp similarity index 98% rename from testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_020.cpp rename to testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_020.cpp index 28fbcf23..0299cc5c 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_020.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_020.cpp @@ -49,7 +49,7 @@ static VOID *PthreadF01(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -156,7 +156,7 @@ static VOID *PthreadF02(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -262,7 +262,7 @@ static VOID *PthreadF03(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; diff --git a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_021.cpp b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_021.cpp similarity index 98% rename from testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_021.cpp rename to testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_021.cpp index e9cde0f0..29116342 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_021.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_021.cpp @@ -49,7 +49,7 @@ static VOID *PthreadF01(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -155,7 +155,7 @@ static VOID *PthreadF02(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -261,7 +261,7 @@ static VOID *PthreadF03(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; diff --git a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_022.cpp b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_022.cpp similarity index 98% rename from testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_022.cpp rename to testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_022.cpp index 3a5273b4..6369422a 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_022.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_022.cpp @@ -49,7 +49,7 @@ static VOID *PthreadF01(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -157,7 +157,7 @@ static VOID *PthreadF02(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -262,7 +262,7 @@ static VOID *PthreadF03(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; diff --git a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_023.cpp b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_023.cpp similarity index 98% rename from testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_023.cpp rename to testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_023.cpp index dc994c2a..06b7a1fb 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_023.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_023.cpp @@ -49,7 +49,7 @@ static VOID *PthreadF01(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -156,7 +156,7 @@ static VOID *PthreadF02(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -262,7 +262,7 @@ static VOID *PthreadF03(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; diff --git a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_024.cpp b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_024.cpp similarity index 98% rename from testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_024.cpp rename to testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_024.cpp index a4e429bf..ad6d4e27 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_024.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_024.cpp @@ -49,7 +49,7 @@ static VOID *PthreadF01(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -155,7 +155,7 @@ static VOID *PthreadF02(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -261,7 +261,7 @@ static VOID *PthreadF03(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; diff --git a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_027.cpp b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_027.cpp similarity index 98% rename from testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_027.cpp rename to testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_027.cpp index ea8858a8..0e36a7b0 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_027.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_027.cpp @@ -48,7 +48,7 @@ static VOID *PthreadF01(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -133,7 +133,7 @@ static VOID *PthreadF02(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -218,7 +218,7 @@ static VOID *PthreadF03(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; diff --git a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_029.cpp b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_029.cpp similarity index 97% rename from testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_029.cpp rename to testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_029.cpp index fd100322..bc67be1e 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_029.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_029.cpp @@ -48,7 +48,7 @@ static VOID *PthreadF01(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -133,7 +133,7 @@ static VOID *PthreadF02(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -218,7 +218,7 @@ static VOID *PthreadF03(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -333,7 +333,7 @@ static UINT32 TestCase(VOID) ICUNIT_GOTO_EQUAL(ret, FAT_NO_ERROR, ret, EXIT1); - ICUNIT_ASSERT_EQUAL(g_testCount, 3, g_testCount); // there 3 threads + ICUNIT_GOTO_EQUAL(g_testCount, 3, g_testCount, EXIT); // there 3 threads ret = rmdir(bufname3); ICUNIT_GOTO_EQUAL(ret, FAT_NO_ERROR, ret, EXIT); diff --git a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_030.cpp b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_030.cpp similarity index 97% rename from testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_030.cpp rename to testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_030.cpp index 66d04432..40a2180e 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_030.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_030.cpp @@ -48,7 +48,7 @@ static VOID *PthreadF01(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -132,7 +132,7 @@ static VOID *PthreadF02(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -216,7 +216,7 @@ static VOID *PthreadF03(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -332,7 +332,7 @@ static UINT32 TestCase(VOID) ICUNIT_GOTO_EQUAL(ret, FAT_NO_ERROR, ret, EXIT1); - ICUNIT_ASSERT_EQUAL(g_testCount, 3, g_testCount); // there 3 threads + ICUNIT_GOTO_EQUAL(g_testCount, 3, g_testCount, EXIT); // there 3 threads ret = rmdir(bufname3); ICUNIT_GOTO_EQUAL(ret, FAT_NO_ERROR, ret, EXIT); diff --git a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_032.cpp b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_032.cpp similarity index 97% rename from testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_032.cpp rename to testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_032.cpp index 93506b18..5d9a68a3 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_032.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_032.cpp @@ -48,7 +48,7 @@ static VOID *PthreadF01(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -132,7 +132,7 @@ static VOID *PthreadF02(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -217,7 +217,7 @@ static VOID *PthreadF03(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -333,7 +333,7 @@ static UINT32 TestCase(VOID) ICUNIT_GOTO_EQUAL(ret, FAT_NO_ERROR, ret, EXIT1); - ICUNIT_ASSERT_EQUAL(g_testCount, 3, g_testCount); // there 3 threads + ICUNIT_GOTO_EQUAL(g_testCount, 3, g_testCount, EXIT); // there 3 threads ret = rmdir(bufname3); ICUNIT_GOTO_EQUAL(ret, FAT_NO_ERROR, ret, EXIT); diff --git a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_033.cpp b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_033.cpp similarity index 98% rename from testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_033.cpp rename to testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_033.cpp index 38c55105..b5ac0acd 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_033.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_033.cpp @@ -49,7 +49,7 @@ static VOID *PthreadF01(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -148,7 +148,7 @@ static VOID *PthreadF02(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -247,7 +247,7 @@ static VOID *PthreadF03(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; diff --git a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_035.cpp b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_035.cpp similarity index 98% rename from testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_035.cpp rename to testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_035.cpp index 67439785..623acc00 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_035.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_035.cpp @@ -49,7 +49,7 @@ static VOID *PthreadF01(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -148,7 +148,7 @@ static VOID *PthreadF02(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -249,7 +249,7 @@ static VOID *PthreadF03(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; diff --git a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_036.cpp b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_036.cpp similarity index 98% rename from testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_036.cpp rename to testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_036.cpp index d9bbcba8..16e66e5a 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_036.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_036.cpp @@ -49,7 +49,7 @@ static VOID *PthreadF01(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -149,7 +149,7 @@ static VOID *PthreadF02(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -249,7 +249,7 @@ static VOID *PthreadF03(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; diff --git a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_038.cpp b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_038.cpp similarity index 98% rename from testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_038.cpp rename to testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_038.cpp index fd4d78b1..0a43ba6c 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_038.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_038.cpp @@ -49,7 +49,7 @@ static VOID *PthreadF01(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -150,7 +150,7 @@ static VOID *PthreadF02(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -253,7 +253,7 @@ static VOID *PthreadF03(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; diff --git a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_039.cpp b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_039.cpp similarity index 98% rename from testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_039.cpp rename to testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_039.cpp index 37cb5620..bd35dc08 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_039.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_039.cpp @@ -49,7 +49,7 @@ static VOID *PthreadF01(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -158,7 +158,7 @@ static VOID *PthreadF02(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -266,7 +266,7 @@ static VOID *PthreadF03(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -395,7 +395,7 @@ static UINT32 TestCase(VOID) ICUNIT_GOTO_EQUAL(ret, FAT_NO_ERROR, ret, EXIT1); } - ICUNIT_ASSERT_EQUAL(g_testCount, 3, g_testCount); // there 3 threads + ICUNIT_GOTO_EQUAL(g_testCount, 3, g_testCount, EXIT); // there 3 threads ret = rmdir(bufname); ICUNIT_GOTO_EQUAL(ret, FAT_NO_ERROR, ret, EXIT); diff --git a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_040.cpp b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_040.cpp similarity index 98% rename from testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_040.cpp rename to testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_040.cpp index 460d1c05..a2dc3b99 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_040.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_040.cpp @@ -49,7 +49,7 @@ static VOID *PthreadF01(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -158,7 +158,7 @@ static VOID *PthreadF02(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -266,7 +266,7 @@ static VOID *PthreadF03(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; diff --git a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_041.cpp b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_041.cpp similarity index 98% rename from testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_041.cpp rename to testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_041.cpp index 520c3ffa..19f31f2d 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_041.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_041.cpp @@ -49,7 +49,7 @@ static VOID *PthreadF01(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -158,7 +158,7 @@ static VOID *PthreadF02(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -266,7 +266,7 @@ static VOID *PthreadF03(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; diff --git a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_042.cpp b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_042.cpp similarity index 98% rename from testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_042.cpp rename to testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_042.cpp index 8db6215d..161ac289 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_042.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_042.cpp @@ -49,7 +49,7 @@ static VOID *PthreadF01(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -158,7 +158,7 @@ static VOID *PthreadF02(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -266,7 +266,7 @@ static VOID *PthreadF03(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; diff --git a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_043.cpp b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_043.cpp similarity index 98% rename from testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_043.cpp rename to testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_043.cpp index 7699a766..a003fa33 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_043.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_043.cpp @@ -49,7 +49,7 @@ static VOID *PthreadF01(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -158,7 +158,7 @@ static VOID *PthreadF02(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -266,7 +266,7 @@ static VOID *PthreadF03(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; diff --git a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_044.cpp b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_044.cpp similarity index 98% rename from testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_044.cpp rename to testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_044.cpp index 0af397d4..14b9f3a3 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_044.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_044.cpp @@ -49,7 +49,7 @@ static VOID *PthreadF01(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -158,7 +158,7 @@ static VOID *PthreadF02(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -266,7 +266,7 @@ static VOID *PthreadF03(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; diff --git a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_045.cpp b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_045.cpp similarity index 98% rename from testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_045.cpp rename to testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_045.cpp index 54d726ea..64d81794 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_045.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_045.cpp @@ -49,7 +49,7 @@ static VOID *PthreadF01(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -158,7 +158,7 @@ static VOID *PthreadF02(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -266,7 +266,7 @@ static VOID *PthreadF03(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; diff --git a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_046.cpp b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_046.cpp similarity index 87% rename from testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_046.cpp rename to testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_046.cpp index 8b4c640e..3bf81ed5 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_046.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_046.cpp @@ -33,7 +33,7 @@ static VOID *PthreadF01(void *arg) { - INT32 i, j, ret, len, flag, index; + INT32 i, j, ret, len, index; INT32 fd[100] = {}; CHAR pathname[FAT_STANDARD_NAME_LENGTH] = ""; CHAR readbuf[FAT_STANDARD_NAME_LENGTH] = ""; @@ -43,13 +43,12 @@ static VOID *PthreadF01(void *arg) CHAR writebuf[20] = "0123456789"; CHAR *bufWrite = nullptr; - flag = 0; bufWrite = (CHAR *)malloc(BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB ICUNIT_ASSERT_NOT_EQUAL_NULL(bufWrite, NULL, NULL); (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -58,35 +57,27 @@ static VOID *PthreadF01(void *arg) index); fd[index] = open(pathname, O_NONBLOCK | O_CREAT | O_RDWR | O_EXCL, S_IRWXU | S_IRWXG | S_IRWXO); if (fd[index] == -1) { - break; + index--; + ICUNIT_GOTO_NOT_EQUAL(fd[index], -1, fd[index], EXIT1); } switch (index % 3) { // mod 3 case 0: for (j = 0; j < FAT_MAX_CYCLES; j++) { // д100M len = write(fd[index], bufWrite, strlen(bufWrite)); - if (len <= 0) { - flag = 1; - break; - } + ICUNIT_GOTO_EQUAL(len, strlen(bufWrite), len, EXIT1); } LosTaskDelay(3); // delay 3 s break; case 1: for (j = 0; j < FAT_MIDDLE_CYCLES; j++) { // д10M len = write(fd[index], bufWrite, strlen(bufWrite)); - if (len <= 0) { - flag = 1; - break; - } + ICUNIT_GOTO_EQUAL(len, strlen(bufWrite), len, EXIT1); } LosTaskDelay(5); // delay 5 s break; case 2: // the 2 nd case len = write(fd[index], writebuf, strlen(writebuf)); - if (len <= 0) { - flag = 1; - break; - } + ICUNIT_GOTO_EQUAL(len, strlen(writebuf), len, EXIT1); LosTaskDelay(7); // delay 7 s break; default: @@ -100,16 +91,10 @@ static VOID *PthreadF01(void *arg) ICUNIT_ASSERT_STRING_EQUAL_RET(readbuf, "0123456789", readbuf, NULL); ret = close(fd[index]); ICUNIT_GOTO_EQUAL(ret, FAT_NO_ERROR, ret, EXIT1); - if (flag == 1) { - break; - } index++; } - if (flag == 0) { - index--; - } - for (i = index; i >= 0; i--) { + for (i = index - 1; i >= 0; i--) { (void)snprintf_s(pathname, FAT_STANDARD_NAME_LENGTH, FAT_STANDARD_NAME_LENGTH, "%s/file1%d.txt", FAT_PATH_NAME, i); ret = unlink(pathname); @@ -135,7 +120,7 @@ EXIT: static VOID *PthreadF02(void *arg) { - INT32 i, j, ret, len, flag, index; + INT32 i, j, ret, len, index; INT32 fd[100] = {}; CHAR pathname[FAT_STANDARD_NAME_LENGTH] = ""; CHAR filebuf[260] = "01234567890123456789abcedfghij9876543210abcdeabcde0123456789abcedfghij9876543210abcdeabcde0123" @@ -145,13 +130,12 @@ static VOID *PthreadF02(void *arg) CHAR *bufWrite = nullptr; struct stat statbuf; - flag = 0; bufWrite = (CHAR *)malloc(BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB ICUNIT_ASSERT_NOT_EQUAL_NULL(bufWrite, NULL, NULL); (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -160,35 +144,27 @@ static VOID *PthreadF02(void *arg) index); fd[index] = open(pathname, O_NONBLOCK | O_CREAT | O_RDWR | O_EXCL, S_IRWXU | S_IRWXG | S_IRWXO); if (fd[index] == -1) { - break; + index--; + ICUNIT_GOTO_NOT_EQUAL(fd[index], -1, fd[index], EXIT1); } switch (index % 3) { // mod 3 case 0: for (j = 0; j < FAT_MAX_CYCLES; j++) { // д100M len = write(fd[index], bufWrite, strlen(bufWrite)); - if (len <= 0) { - flag = 1; - break; - } + ICUNIT_GOTO_EQUAL(len, strlen(bufWrite), len, EXIT1); } LosTaskDelay(3); // delay 3 s break; case 1: for (j = 0; j < FAT_MIDDLE_CYCLES; j++) { // д10M len = write(fd[index], bufWrite, strlen(bufWrite)); - if (len <= 0) { - flag = 1; - break; - } + ICUNIT_GOTO_EQUAL(len, strlen(bufWrite), len, EXIT1); } LosTaskDelay(5); // delay 5 s break; case 2: // the 2 nd case len = write(fd[index], writebuf, strlen(writebuf)); - if (len <= 0) { - flag = 1; - break; - } + ICUNIT_GOTO_EQUAL(len, strlen(writebuf), len, EXIT1); LosTaskDelay(7); // delay 7 s break; default: @@ -202,17 +178,10 @@ static VOID *PthreadF02(void *arg) ICUNIT_GOTO_EQUAL(ret, FAT_NO_ERROR, ret, EXIT1); FatStatPrintf(statbuf); - if (flag == 1) { - break; - } index++; } - if (flag == 0) { - index--; - } - - for (i = index; i >= 0; i--) { + for (i = index - 1; i >= 0; i--) { (void)snprintf_s(pathname, FAT_STANDARD_NAME_LENGTH, FAT_STANDARD_NAME_LENGTH, "%s/file2%d.txt", FAT_PATH_NAME, i); ret = unlink(pathname); @@ -240,7 +209,7 @@ EXIT: static VOID *PthreadF03(void *arg) { - INT32 i, j, ret, len, flag, index; + INT32 i, j, ret, len, index; INT32 fd[100] = {}; CHAR pathname[FAT_STANDARD_NAME_LENGTH] = ""; CHAR pathname1[FAT_STANDARD_NAME_LENGTH] = ""; @@ -250,13 +219,12 @@ static VOID *PthreadF03(void *arg) CHAR writebuf[20] = "0123456789"; CHAR *bufWrite = nullptr; - flag = 0; bufWrite = (CHAR *)malloc(BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB ICUNIT_ASSERT_NOT_EQUAL_NULL(bufWrite, NULL, NULL); (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -265,35 +233,27 @@ static VOID *PthreadF03(void *arg) index); fd[index] = open(pathname, O_NONBLOCK | O_CREAT | O_RDWR | O_EXCL, S_IRWXU | S_IRWXG | S_IRWXO); if (fd[index] == -1) { - break; + index--; + ICUNIT_GOTO_NOT_EQUAL(fd[index], -1, fd[index], EXIT1); } switch (index % 3) { // mod 3 case 0: for (j = 0; j < FAT_MAX_CYCLES; j++) { // д100M len = write(fd[index], bufWrite, strlen(bufWrite)); - if (len <= 0) { - flag = 1; - break; - } + ICUNIT_GOTO_EQUAL(len, strlen(bufWrite), len, EXIT1); } LosTaskDelay(3); // delay 3 s break; case 1: for (j = 0; j < FAT_MIDDLE_CYCLES; j++) { // д10M len = write(fd[index], bufWrite, strlen(bufWrite)); - if (len <= 0) { - flag = 1; - break; - } + ICUNIT_GOTO_EQUAL(len, strlen(bufWrite), len, EXIT1); } LosTaskDelay(5); // delay 5 s break; case 2: // the 2 nd case len = write(fd[index], writebuf, strlen(writebuf)); - if (len <= 0) { - flag = 1; - break; - } + ICUNIT_GOTO_EQUAL(len, strlen(writebuf), len, EXIT1); LosTaskDelay(7); // delay 7 s break; default: @@ -308,16 +268,10 @@ static VOID *PthreadF03(void *arg) ret = rename(pathname, pathname1); ICUNIT_GOTO_EQUAL(ret, FAT_NO_ERROR, ret, EXIT1); - if (flag == 1) { - break; - } index++; } - if (flag == 0) { - index--; - } - for (i = index; i >= 0; i--) { + for (i = index - 1; i >= 0; i--) { (void)snprintf_s(pathname, FAT_STANDARD_NAME_LENGTH, FAT_STANDARD_NAME_LENGTH, "%s/file3_%d.txt", FAT_PATH_NAME, i); ret = unlink(pathname); @@ -380,7 +334,7 @@ static UINT32 TestCase(VOID) ICUNIT_GOTO_EQUAL(ret, FAT_NO_ERROR, ret, EXIT1); } - ICUNIT_ASSERT_EQUAL(g_testCount, 3, g_testCount); // there 3 threads + ICUNIT_GOTO_EQUAL(g_testCount, 3, g_testCount, EXIT); // there 3 threads ret = rmdir(bufname); ICUNIT_GOTO_EQUAL(ret, FAT_NO_ERROR, ret, EXIT); diff --git a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_047.cpp b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_047.cpp similarity index 98% rename from testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_047.cpp rename to testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_047.cpp index 58e9b5dc..4b68477a 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_047.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_047.cpp @@ -49,7 +49,7 @@ static VOID *PthreadF01(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -158,7 +158,7 @@ static VOID *PthreadF02(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -266,7 +266,7 @@ static VOID *PthreadF03(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; diff --git a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_048.cpp b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_048.cpp similarity index 98% rename from testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_048.cpp rename to testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_048.cpp index bf6fde50..deb6fa9b 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_048.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_048.cpp @@ -49,7 +49,7 @@ static VOID *PthreadF01(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -159,7 +159,7 @@ static VOID *PthreadF02(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -267,7 +267,7 @@ static VOID *PthreadF03(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; diff --git a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_049.cpp b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_049.cpp similarity index 98% rename from testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_049.cpp rename to testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_049.cpp index 8a18abf3..84a307c4 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_049.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_049.cpp @@ -49,7 +49,7 @@ static VOID *PthreadF01(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -158,7 +158,7 @@ static VOID *PthreadF02(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -266,7 +266,7 @@ static VOID *PthreadF03(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; diff --git a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_050.cpp b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_050.cpp similarity index 98% rename from testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_050.cpp rename to testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_050.cpp index d565ac09..38f4ab95 100644 --- a/testsuites/unittest/fs/vfat2/pressure/It_vfs_fat_mutipthread_050.cpp +++ b/testsuites/unittest/fs/vfat/pressure/It_vfs_fat_mutipthread_050.cpp @@ -49,7 +49,7 @@ static VOID *PthreadF01(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -158,7 +158,7 @@ static VOID *PthreadF02(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; @@ -266,7 +266,7 @@ static VOID *PthreadF03(void *arg) (void)memset_s(bufWrite, BYTES_PER_MBYTES + 1, 0, BYTES_PER_MBYTES + 1); // BYTES_PER_MBYTES = 1MB for (i = 0; i < BYTES_PER_KBYTES * 4; i++) { // loop in 4 Kb - (void)strcat_s(bufWrite, BYTES_PER_MBYTES, filebuf); + (void)strcat_s(bufWrite, BYTES_PER_MBYTES + 1, filebuf); } index = 0; diff --git a/testsuites/unittest/fs/vfat2/smoke/It_vfs_fat_026.cpp b/testsuites/unittest/fs/vfat/smoke/It_vfs_fat_026.cpp similarity index 99% rename from testsuites/unittest/fs/vfat2/smoke/It_vfs_fat_026.cpp rename to testsuites/unittest/fs/vfat/smoke/It_vfs_fat_026.cpp index 7a418526..b19fbe97 100644 --- a/testsuites/unittest/fs/vfat2/smoke/It_vfs_fat_026.cpp +++ b/testsuites/unittest/fs/vfat/smoke/It_vfs_fat_026.cpp @@ -39,7 +39,7 @@ static UINT32 TestCase(VOID) INT32 ret; INT32 fd = 0; INT32 len = 0; - INT32 i = 0; + INT32 i = FAT_SHORT_ARRAY_LENGTH; CHAR pathname1[FAT_STANDARD_NAME_LENGTH] = FAT_PATH_NAME; CHAR buffile[FAT_STANDARD_NAME_LENGTH] = FAT_PATH_NAME; CHAR filebuf[FAT_STANDARD_NAME_LENGTH] = "12345678901234567890"; From 49856dc1e0de1c5e92346c83eda641dfb1bb16be Mon Sep 17 00:00:00 2001 From: laokz Date: Wed, 9 Jun 2021 13:09:09 +0800 Subject: [PATCH 02/43] =?UTF-8?q?feat(QEMU=5FARM=5FVIRT=5FCA7):=20?= =?UTF-8?q?=E4=BD=BF=E8=83=BDFAT=E6=96=87=E4=BB=B6=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E7=BC=96=E8=AF=91=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: laokz Change-Id: I0eece39921292498243bd017f168f953a437731c --- tools/build/config/qemu_arm_virt_debug_shell.config | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/build/config/qemu_arm_virt_debug_shell.config b/tools/build/config/qemu_arm_virt_debug_shell.config index d22f8fd8..cef8fbb3 100644 --- a/tools/build/config/qemu_arm_virt_debug_shell.config +++ b/tools/build/config/qemu_arm_virt_debug_shell.config @@ -2,7 +2,10 @@ LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7=y LOSCFG_BOARD_CONFIG_PATH="device/qemu/arm_virt/liteos_a/config/board" # LOSCFG_HRTIMER_ENABLE is not set # LOSCFG_KERNEL_CPPSUPPORT is not set -# LOSCFG_FS_FAT is not set +LOSCFG_FS_FAT=y +LOSCFG_FS_FAT_DISK=y +LOSCFG_FS_FAT_VIRTUAL_PARTITION=y +LOSCFG_FS_VFS_BLOCK_DEVICE=y LOSCFG_ENABLE_MAGICKEY=y LOSCFG_DEBUG_VERSION=y # LOSCFG_SHELL_LK is not set From e0a27badde20868cf3a5b4a44305b90af00e4f3f Mon Sep 17 00:00:00 2001 From: Joker2770 <1214220480@qq.com> Date: Mon, 28 Jun 2021 09:33:29 +0800 Subject: [PATCH 03/43] perf: assign '-1' to uninitialized variable: ret Signed-off-by: Joker2770 <1214220480@qq.com> --- drivers/char/random/src/random_hw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/char/random/src/random_hw.c b/drivers/char/random/src/random_hw.c index ffaa495a..a290a586 100644 --- a/drivers/char/random/src/random_hw.c +++ b/drivers/char/random/src/random_hw.c @@ -65,7 +65,7 @@ static int RandomHwClose(struct file *filep) static int RandomHwIoctl(struct file *filep, int cmd, unsigned long arg) { - int ret; + int ret = -1; switch (cmd) { default: @@ -77,7 +77,7 @@ static int RandomHwIoctl(struct file *filep, int cmd, unsigned long arg) static ssize_t RandomHwRead(struct file *filep, char *buffer, size_t buflen) { - int ret; + int ret = -1; if (g_randomOp.read != NULL) { ret = g_randomOp.read(buffer, buflen); From 455e42e5b953d80164ede19431551d7bd9db899a Mon Sep 17 00:00:00 2001 From: vcbchang Date: Mon, 28 Jun 2021 19:27:38 +0800 Subject: [PATCH 04/43] =?UTF-8?q?test:=20=E4=BF=AE=E5=A4=8D=E4=BA=86?= =?UTF-8?q?=E6=9D=80=E6=AD=BB=E6=8E=89hilog=E8=BF=9B=E7=A8=8B=E5=90=8ESecu?= =?UTF-8?q?rityCapability=E9=97=A8=E7=A6=81=E7=94=A8=E4=BE=8B=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E9=80=9A=E8=BF=87=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【背景】如果操作系统先执行kill hilog进程,然后再执行SecurityCapability,那么门禁用例将无法通过,原因是该用例先获取了hilog进程的id,但hilog进程已经杀掉了,所以报错 【修改方案】 1. 增加kill 0与错误码判断,如果发现进程已经被干掉的话将不执行相关内容 【影响】 无其它影响。 Signed-off-by: vcbchang Change-Id: Icdf357800175eff19acf1f92426469642a697386 --- .../capability/smoke/cap_test_001.cpp | 40 +++++++++++++------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/testsuites/unittest/security/capability/smoke/cap_test_001.cpp b/testsuites/unittest/security/capability/smoke/cap_test_001.cpp index 95f6eb9f..f8887989 100644 --- a/testsuites/unittest/security/capability/smoke/cap_test_001.cpp +++ b/testsuites/unittest/security/capability/smoke/cap_test_001.cpp @@ -82,22 +82,38 @@ static int TestChild(VOID) capheader.pid = INVAILD_PID; ret = capget(&capheader, &capdatac[0]); ICUNIT_ASSERT_EQUAL(ret, -1, ret); + errno = 0; capheader.pid = 3; - ret = capget(&capheader, &capdatac[0]); - ICUNIT_ASSERT_EQUAL(ret, 0, ret); - printf("e %d,p %d\n", capdatac[0].effective, capdatac[0].permitted); + kill(capheader.pid, 0); + if (errno != ESRCH) { + ret = capget(&capheader, &capdatac[0]); + ICUNIT_ASSERT_EQUAL(ret, 0, ret); + printf("e %d,p %d\n", capdatac[0].effective, capdatac[0].permitted); + } + errno = 0; capheader.pid = 4; - ret = capget(&capheader, &capdatac[0]); - ICUNIT_ASSERT_EQUAL(ret, 0, ret); - printf("e %d,p %d\n", capdatac[0].effective, capdatac[0].permitted); + kill(capheader.pid, 0); + if (errno != ESRCH) { + ret = capget(&capheader, &capdatac[0]); + ICUNIT_ASSERT_EQUAL(ret, 0, ret); + printf("e %d,p %d\n", capdatac[0].effective, capdatac[0].permitted); + } + errno = 0; capheader.pid = 5; - ret = capget(&capheader, &capdatac[0]); - ICUNIT_ASSERT_EQUAL(ret, 0, ret); - printf("e %d,p %d\n", capdatac[0].effective, capdatac[0].permitted); + kill(capheader.pid, 0); + if (errno != ESRCH) { + ret = capget(&capheader, &capdatac[0]); + ICUNIT_ASSERT_EQUAL(ret, 0, ret); + printf("e %d,p %d\n", capdatac[0].effective, capdatac[0].permitted); + } + errno = 0; capheader.pid = 6; - ret = capget(&capheader, &capdatac[0]); - ICUNIT_ASSERT_EQUAL(ret, 0, ret); - printf("e %d,p %d\n", capdatac[0].effective, capdatac[0].permitted); + kill(capheader.pid, 0); + if (errno != ESRCH) { + ret = capget(&capheader, &capdatac[0]); + ICUNIT_ASSERT_EQUAL(ret, 0, ret); + printf("e %d,p %d\n", capdatac[0].effective, capdatac[0].permitted); + } capheader.pid = 0; int pid = fork(); From d7672d47f2188f177c57383289e088575315e763 Mon Sep 17 00:00:00 2001 From: Caoruihong Date: Wed, 30 Jun 2021 17:41:05 +0800 Subject: [PATCH 05/43] chore: make liteos_a can be built alone in the liteos_a directory, we used to use `make clean all` command to build liteos_a kernel for test. Signed-off-by: Caoruihong Change-Id: I5ca689c1c44052f7de937d7faa9e4d3534d97380 --- Makefile | 24 +++++++++++++++--------- apps/config.mk | 2 +- apps/mksh/Makefile | 4 ++-- apps/toybox/Makefile | 4 ++-- kernel/extended/vdso/usr/Makefile | 2 +- 5 files changed, 21 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 9323917e..5653d002 100644 --- a/Makefile +++ b/Makefile @@ -116,6 +116,15 @@ else $(HIDE)$(SCRIPTS_PATH)/mklibversion.sh endif +##### make sysroot ##### +sysroot: +ifeq ($(LOSCFG_COMPILER_CLANG_LLVM), y) +ifeq ($(wildcard $(SYSROOT_PATH)/usr/include/$(LLVM_TARGET)/),) + $(HIDE)$(MAKE) -C $(SYSROOT_PATH)/build TARGETS=liteos_a_user +endif + $(HIDE)echo "sysroot:" $(abspath $(SYSROOT_PATH)) +endif + ##### make dynload ##### -include $(LITEOS_MK_PATH)/dynload.mk @@ -132,7 +141,7 @@ $(OUT): $(LITEOS_MENUCONFIG_H) $(BUILD): $(HIDE)mkdir -p $(BUILD) -$(LITEOS_LIBS_TARGET): $(__LIBS) +$(LITEOS_LIBS_TARGET): $(__LIBS) sysroot $(HIDE)for dir in $(LIB_SUBDIRS); \ do $(MAKE) -C $$dir all || exit 1; \ done @@ -151,7 +160,7 @@ genconfig:$(MENUCONFIG_CONF) $(LITEOS_MENUCONFIG_H): .config $(HIDE)$(MAKE) genconfig -$(LITEOS_TARGET): $(__LIBS) +$(LITEOS_TARGET): $(__LIBS) sysroot $(HIDE)touch $(LOSCFG_ENTRY_SRC) $(HIDE)for dir in $(LITEOS_SUBDIRS); \ @@ -165,18 +174,14 @@ $(LITEOS_TARGET): $(__LIBS) $(OBJDUMP) -d $(OUT)/$@ >$(OUT)/$@.asm # $(NM) -S --size-sort $(OUT)/$@ >$(OUT)/$@.size -$(APPS): $(LITEOS_TARGET) +$(APPS): $(LITEOS_TARGET) sysroot $(HIDE)$(MAKE) -C apps all -ifeq ($(LOSCFG_COMPILER_CLANG_LLVM), y) -MULTILIB := $(patsubst $(shell $(CC) --target=$(LLVM_TARGET) $(ARCH_CFLAGS) -print-file-name=lib/$(LLVM_TARGET)/)%,%,$(dir $(shell $(CC) --target=$(LLVM_TARGET) $(ARCH_CFLAGS) -print-libgcc-file-name))) -endif - prepare: $(HIDE)mkdir -p $(OUT)/musl ifeq ($(LOSCFG_COMPILER_CLANG_LLVM), y) - $(HIDE)cp -f $(SYSROOT_PATH)/usr/lib/$(LLVM_TARGET)/$(MULTILIB)/libc.so $(OUT)/musl - $(HIDE)cp -f $(LITEOS_COMPILER_PATH)/lib/$(LLVM_TARGET)/c++/$(MULTILIB)/libc++.so $(OUT)/musl + $(HIDE)cp -f $$($(CC) --target=$(LLVM_TARGET) --sysroot=$(SYSROOT_PATH) $(LITEOS_CFLAGS) -print-file-name=libc.so) $(OUT)/musl + $(HIDE)cp -f $$($(GPP) --target=$(LLVM_TARGET) --sysroot=$(SYSROOT_PATH) $(LITEOS_CXXFLAGS) -print-file-name=libc++.so) $(OUT)/musl else $(HIDE)cp -f $(LITEOS_COMPILER_PATH)/target/usr/lib/libc.so $(OUT)/musl $(HIDE)cp -f $(LITEOS_COMPILER_PATH)/arm-linux-musleabi/lib/libstdc++.so.6 $(OUT)/musl @@ -225,3 +230,4 @@ update_all_config: $(HIDE)test -f tools/build/config/$@ && cp tools/build/config/$@ .config && $(MENUCONFIG_MCONF) $(KCONFIG_FILE_PATH) && $(MENUCONFIG_CONF) --savedefconfig tools/build/config/$@ $(KCONFIG_FILE_PATH) .PHONY: all lib clean cleanall $(LITEOS_TARGET) debug release help update_all_config +.PHONY: prepare sysroot cleanrootfs $(ROOTFS) $(ROOTFSDIR) $(APPS) menuconfig genconfig $(LITEOS_LIBS_TARGET) $(__LIBS) $(OUT) diff --git a/apps/config.mk b/apps/config.mk index 417446cb..21410057 100644 --- a/apps/config.mk +++ b/apps/config.mk @@ -44,7 +44,7 @@ CFLAGS := -std=c99 -fno-exceptions $(BASE_OPTS) $(LITEOS_COPTS_OPTMIZE) CXXFLAGS := -std=c++11 -fexceptions -fpermissive -frtti $(BASE_OPTS) $(LITEOS_COPTS_OPTMIZE) LDCFLAGS := -lc ifeq ($(LOSCFG_COMPILER_CLANG_LLVM), y) -LLVM_SYSROOT := --sysroot=$(SYSROOT_PATH) $(ARCH_CFLAGS) +LLVM_SYSROOT := --sysroot=$(SYSROOT_PATH) LDCXXFLGS := -lc++ -lc++abi -lc else BASE_OPTS += -Wl,-z,relro,-z,now diff --git a/apps/mksh/Makefile b/apps/mksh/Makefile index 8aa8bcdc..182c7c01 100755 --- a/apps/mksh/Makefile +++ b/apps/mksh/Makefile @@ -39,10 +39,10 @@ BUILD_LOG := $(MKSH_DIR)/build.log TARGET_OS := OpenHarmony LOCAL_CFLAGS := -flto -fdata-sections -ffunction-sections -Oz -fstack-protector-strong -D_FORTIFY_SOURCE=2 -LOCAL_CFLAGS += --target=arm-liteos $(LLVM_SYSROOT) +LOCAL_CFLAGS += --target=$(LLVM_TARGET) $(LLVM_SYSROOT) LOCAL_CFLAGS += -DMKSH_DISABLE_TTY_WARNING -DMKSH_SMALL=1 -DMKSH_ASSUME_UTF8=1 -DMKSH_SMALL_BUT_FAST=0 -DMKSH_S_NOVI=1 -DHAVE_CAN_FSTACKPROTECTORSTRONG=1 LOCAL_CFLAGS += -DMKSH_LESS_CMDLINE_EDITING -DMKSH_LESS_BUILDINS -DMKSH_NO_INITCOMS -DADAPT_FOR_LITEOS_A -LOCAL_LDFLAGS := -Wl,--gc-sections -flto -O2 --target=arm-liteos $(LLVM_SYSROOT) +LOCAL_LDFLAGS := -Wl,--gc-sections -flto -O2 --target=$(LLVM_TARGET) $(LLVM_SYSROOT) all:$(MKSH) diff --git a/apps/toybox/Makefile b/apps/toybox/Makefile index 0af3c951..d4345bae 100644 --- a/apps/toybox/Makefile +++ b/apps/toybox/Makefile @@ -46,8 +46,8 @@ else $(HIDE)$(CP) $(LITEOSTHIRDPARTY)/$(TOYBOX)/. $(BUILD_DIR) $(HIDE)$(CP) -p $(LITEOSTHIRDPARTY)/$(TOYBOX)/porting/liteos_a/. $(BUILD_DIR) endif - $(HIDE)CFLAGS="-D_FORTIFY_SOURCE=2 -fstack-protector-strong --target=arm-liteos $(LLVM_SYSROOT)" CC="$(CC)" OUTNAME=$(OUTNAME) \ - LDFLAGS="--target=arm-liteos $(LLVM_SYSROOT)" \ + $(HIDE)CFLAGS="-D_FORTIFY_SOURCE=2 -fstack-protector-strong --target=$(LLVM_TARGET) $(LLVM_SYSROOT)" CC="$(CC)" OUTNAME=$(OUTNAME) \ + LDFLAGS="--target=$(LLVM_TARGET) $(LLVM_SYSROOT)" \ make -C $(BUILD_DIR) toybox -j> $(BUILD_LOG) 2>&1 $(HIDE)$(CP) $(BUILD_DIR)/$(TOYBOX) . $(HIDE)$(STRIP) $(TOYBOX) diff --git a/kernel/extended/vdso/usr/Makefile b/kernel/extended/vdso/usr/Makefile index 33b04ebc..dde4d96d 100644 --- a/kernel/extended/vdso/usr/Makefile +++ b/kernel/extended/vdso/usr/Makefile @@ -40,7 +40,7 @@ VDSO_INCLUDE := -I $(LITEOSTOPDIR)/kernel/extended/vdso/include \ VDSO_CCFLAGS := -nostdlib -fPIC -fno-common -fno-strict-aliasing \ $(LITEOS_SSP) $(LITEOS_CORE_COPTS) $(WARNING_AS_ERROR) $(LITEOS_COPTS_OPTMIZE) ifeq ($(LOSCFG_COMPILER_CLANG_LLVM), y) -VDSO_CCFLAGS += $(LLVM_EXTRA_OPTS) --sysroot=$(SYSROOT_PATH) $(ARCH_CFLAGS) +VDSO_CCFLAGS += $(LLVM_EXTRA_OPTS) --sysroot=$(SYSROOT_PATH) endif VDSO_LDFLAGS := -shared -s -Bsymbolic -T los_vdso.ld From 4e4f2d6d7ee120c951006998e0d7b0f4fa250240 Mon Sep 17 00:00:00 2001 From: boxi Date: Tue, 29 Jun 2021 19:34:16 +0800 Subject: [PATCH 06/43] =?UTF-8?q?refactor:=20=E5=AF=B9LiteOS=5Fa=E5=86=85?= =?UTF-8?q?=E6=A0=B8=E4=B8=ADmenuconfig=E5=BC=80=E5=85=B3=E7=9A=84?= =?UTF-8?q?=E5=AE=8F=E4=BD=BF=E7=94=A8#ifdef/#ifndef=E5=81=9A=E9=A2=84?= =?UTF-8?q?=E7=BC=96=E8=AF=91=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit LiteOS_a中有部分配置宏进行了重复冗余定义,导致当头文件未被包含时,极易引入错误, 故对menuconfig配置宏进行统一处理,均使用#ifdef/#ifndef作为预编译判断方式 Close #I3YEGS Change-Id: Ife6db770cc66de1d6199a4f3ba3950e9bfd0e71a Signed-off-by: boxi --- arch/arm/arm/include/los_hw_cpu.h | 2 +- arch/arm/arm/src/los_arch_mmu.c | 6 +- arch/arm/arm/src/los_exc.c | 16 +++--- arch/arm/gic/gic_v2.c | 4 +- arch/arm/gic/gic_v3.c | 4 +- arch/arm/include/hal_hwi.h | 2 +- compat/posix/src/pthread.c | 2 +- compat/posix/src/pthread_attr.c | 6 +- compat/posix/src/sched.c | 4 +- fs/jffs2/src/vfs_jffs2.c | 2 +- kernel/base/core/los_process.c | 10 ++-- kernel/base/core/los_sortlink.c | 6 +- kernel/base/core/los_swtmr.c | 6 +- kernel/base/core/los_task.c | 42 +++++++------- kernel/base/core/los_tick.c | 2 +- kernel/base/include/los_percpu_pri.h | 4 +- kernel/base/include/los_process_pri.h | 6 +- kernel/base/include/los_sched_pri.h | 2 +- kernel/base/include/los_sortlink_pri.h | 2 +- kernel/base/include/los_task_pri.h | 8 +-- kernel/base/ipc/los_event.c | 2 +- kernel/base/ipc/los_mux.c | 4 +- kernel/base/ipc/los_queue.c | 4 +- kernel/base/ipc/los_sem.c | 4 +- kernel/base/mem/tlsf/los_memory.c | 18 +++--- kernel/base/misc/sysinfo_shellcmd.c | 18 +++++- kernel/base/misc/task_shellcmd.c | 4 +- kernel/base/mp/los_lockdep.c | 2 +- kernel/base/mp/los_mp.c | 2 +- kernel/base/mp/los_spinlock.c | 2 +- kernel/base/mp/los_stat.c | 6 +- kernel/base/sched/sched_sq/los_sched.c | 24 ++++---- kernel/base/vm/oom.c | 6 +- kernel/common/console.c | 2 +- kernel/common/console.h | 2 +- kernel/common/los_config.c | 18 +++--- kernel/common/los_config.h | 56 ++++++------------- kernel/extended/liteipc/hm_liteipc.c | 18 +++--- kernel/include/los_memory.h | 15 +---- kernel/include/los_mp.h | 2 +- kernel/include/los_spinlock.h | 6 +- kernel/include/los_task.h | 2 +- net/lwip-2.1/porting/src/sys_arch.c | 12 ++-- net/telnet/src/telnet_dev.c | 4 +- platform/main.c | 8 +-- syscall/process_syscall.c | 2 +- testsuites/kernel/include/iCunit.h | 2 +- testsuites/kernel/include/osTest.h | 2 +- .../sample/kernel_base/core/hwi/It_smp_hwi.c | 4 +- .../core/hwi/smp/It_smp_los_hwi_001.c | 2 +- .../core/hwi/smp/It_smp_los_hwi_002.c | 2 +- .../core/hwi/smp/It_smp_los_hwi_003.c | 2 +- .../core/hwi/smp/It_smp_los_hwi_004.c | 2 +- .../core/hwi/smp/It_smp_los_hwi_005.c | 2 +- .../core/hwi/smp/It_smp_los_hwi_006.c | 2 +- .../core/hwi/smp/It_smp_los_hwi_007.c | 2 +- .../core/hwi/smp/It_smp_los_hwi_008.c | 2 +- .../core/hwi/smp/It_smp_los_hwi_009.c | 2 +- .../core/hwi/smp/It_smp_los_hwi_010.c | 2 +- .../core/hwi/smp/It_smp_los_hwi_011.c | 2 +- .../core/hwi/smp/It_smp_los_hwi_012.c | 2 +- .../core/hwi/smp/It_smp_los_hwi_013.c | 2 +- .../core/hwi/smp/It_smp_los_hwi_ipi_001.c | 2 +- .../core/hwi/smp/It_smp_los_hwi_ipi_002.c | 2 +- .../core/hwi/smp/It_smp_los_hwi_ipi_003.c | 2 +- .../core/hwi/smp/It_smp_los_hwi_ipi_004.c | 2 +- .../core/hwi/smp/It_smp_los_hwi_ipi_005.c | 2 +- .../core/hwi/smp/It_smp_los_hwi_ipi_006.c | 2 +- .../core/hwi/smp/It_smp_los_hwi_ipi_007.c | 2 +- .../core/hwi/smp/It_smp_los_hwi_ipi_008.c | 2 +- .../core/hwi/smp/It_smp_los_hwi_nest_001.c | 2 +- .../core/hwi/smp/It_smp_los_hwi_nest_002.c | 2 +- .../core/hwi/smp/It_smp_los_hwi_nest_003.c | 2 +- .../core/hwi/smp/It_smp_los_hwi_nest_004.c | 2 +- .../core/hwi/smp/It_smp_los_hwi_nest_005.c | 2 +- .../core/hwi/smp/It_smp_los_hwi_nest_006.c | 2 +- .../core/hwi/smp/It_smp_los_hwi_nest_007.c | 2 +- .../core/hwi/smp/It_smp_los_hwi_nest_008.c | 2 +- .../kernel_base/core/swtmr/It_los_swtmr.c | 2 +- .../core/swtmr/full/It_los_swtmr_033.c | 2 +- .../core/swtmr/full/It_los_swtmr_039.c | 2 +- .../core/swtmr/full/It_los_swtmr_040.c | 2 +- .../core/swtmr/full/It_los_swtmr_041.c | 2 +- .../core/swtmr/full/It_los_swtmr_043.c | 2 +- .../core/swtmr/full/It_los_swtmr_064.c | 2 +- .../core/swtmr/full/It_los_swtmr_065.c | 2 +- .../kernel_base/core/task/It_los_task.c | 10 ++-- .../kernel_base/core/task/It_los_task.h | 4 +- .../task/float/It_smp_los_float_switch_007.c | 2 +- .../core/task/full/It_los_task_008.c | 2 +- .../core/task/full/It_los_task_011.c | 2 +- .../core/task/full/It_los_task_016.c | 2 +- .../core/task/full/It_los_task_017.c | 2 +- .../core/task/full/It_los_task_018.c | 2 +- .../core/task/full/It_los_task_025.c | 2 +- .../core/task/full/It_los_task_029.c | 2 +- .../core/task/full/It_los_task_031.c | 2 +- .../core/task/full/It_los_task_033.c | 2 +- .../core/task/full/It_los_task_038.c | 2 +- .../core/task/full/It_los_task_039.c | 2 +- .../core/task/full/It_los_task_040.c | 2 +- .../core/task/full/It_los_task_041.c | 2 +- .../core/task/full/It_los_task_042.c | 2 +- .../core/task/full/It_los_task_043.c | 2 +- .../core/task/full/It_los_task_047.c | 2 +- .../core/task/full/It_los_task_050.c | 4 +- .../core/task/full/It_los_task_052.c | 4 +- .../core/task/full/It_los_task_053.c | 4 +- .../core/task/full/It_los_task_054.c | 6 +- .../core/task/full/It_los_task_055.c | 4 +- .../core/task/full/It_los_task_056.c | 4 +- .../core/task/full/It_los_task_057.c | 2 +- .../core/task/full/It_los_task_058.c | 2 +- .../core/task/full/It_los_task_060.c | 2 +- .../core/task/full/It_los_task_061.c | 6 +- .../core/task/full/It_los_task_063.c | 4 +- .../core/task/full/It_los_task_064.c | 6 +- .../core/task/full/It_los_task_065.c | 4 +- .../core/task/full/It_los_task_066.c | 6 +- .../core/task/full/It_los_task_067.c | 4 +- .../core/task/full/It_los_task_068.c | 4 +- .../core/task/full/It_los_task_069.c | 4 +- .../core/task/full/It_los_task_071.c | 2 +- .../core/task/full/It_los_task_072.c | 2 +- .../core/task/full/It_los_task_073.c | 2 +- .../core/task/full/It_los_task_074.c | 2 +- .../core/task/full/It_los_task_075.c | 4 +- .../core/task/full/It_los_task_076.c | 2 +- .../core/task/full/It_los_task_077.c | 2 +- .../core/task/full/It_los_task_078.c | 2 +- .../core/task/full/It_los_task_079.c | 2 +- .../core/task/full/It_los_task_080.c | 2 +- .../core/task/full/It_los_task_082.c | 2 +- .../core/task/full/It_los_task_090.c | 2 +- .../core/task/full/It_los_task_093.c | 2 +- .../core/task/full/It_los_task_094.c | 6 +- .../core/task/full/It_los_task_095.c | 2 +- .../core/task/full/It_los_task_096.c | 4 +- .../core/task/full/It_los_task_098.c | 4 +- .../core/task/full/It_los_task_100.c | 2 +- .../core/task/full/It_los_task_102.c | 4 +- .../core/task/full/It_los_task_103.c | 4 +- .../core/task/full/It_los_task_104.c | 4 +- .../core/task/full/It_los_task_106.c | 4 +- .../core/task/full/It_los_task_107.c | 4 +- .../core/task/full/It_los_task_108.c | 4 +- .../core/task/full/It_los_task_109.c | 4 +- .../core/task/full/It_los_task_110.c | 4 +- .../core/task/full/It_los_task_111.c | 4 +- .../core/task/full/It_los_task_112.c | 4 +- .../core/task/full/It_los_task_113.c | 4 +- .../core/task/full/It_los_task_114.c | 4 +- .../core/task/full/It_los_task_115.c | 4 +- .../core/task/full/It_los_task_116.c | 2 +- .../core/task/full/It_los_task_118.c | 6 +- .../core/task/full/It_los_task_119.c | 2 +- .../core/task/full/It_los_task_120.c | 2 +- .../core/task/full/It_los_task_121.c | 2 +- .../core/task/full/It_los_task_122.c | 4 +- .../core/task/full/It_los_task_123.c | 4 +- .../core/task/full/It_los_task_124.c | 4 +- .../core/task/full/It_los_task_125.c | 4 +- .../core/task/full/It_los_task_126.c | 6 +- .../core/task/full/It_los_task_127.c | 4 +- .../core/task/full/It_los_task_128.c | 4 +- .../core/task/full/It_los_task_129.c | 4 +- .../core/task/full/It_los_task_130.c | 4 +- .../core/task/full/It_los_task_131.c | 6 +- .../core/task/full/It_los_task_133.c | 2 +- .../core/task/full/It_los_task_134.c | 2 +- .../core/task/full/It_los_task_135.c | 2 +- .../core/task/full/It_los_task_136.c | 4 +- .../core/task/full/It_los_task_138.c | 6 +- .../core/task/full/It_los_task_141.c | 2 +- .../core/task/full/It_los_task_142.c | 2 +- .../task/full/It_los_task_timeslice_002.c | 4 +- .../task/full/It_los_task_timeslice_003.c | 6 +- .../task/full/It_los_task_timeslice_004.c | 4 +- .../core/task/smoke/It_los_task_049.c | 2 +- .../core/task/smoke/It_los_task_081.c | 2 +- .../core/task/smoke/It_los_task_097.c | 4 +- .../core/task/smoke/It_los_task_099.c | 2 +- .../core/task/smoke/It_los_task_101.c | 2 +- .../core/task/smoke/It_los_task_105.c | 2 +- .../task/smoke/It_los_task_timeslice_001.c | 4 +- .../core/task/smp/It_smp_los_task_002.c | 2 +- .../core/task/smp/It_smp_los_task_024.c | 2 +- .../core/task/smp/It_smp_los_task_025.c | 2 +- .../kernel_base/ipc/event/It_los_event.c | 8 +-- .../kernel_base/ipc/event/It_los_event.h | 2 +- .../ipc/event/full/It_los_event_018.c | 2 +- .../ipc/event/full/It_los_event_023.c | 6 +- .../ipc/event/full/It_los_event_024.c | 2 +- .../ipc/event/full/It_los_event_026.c | 2 +- .../ipc/event/full/It_los_event_038.c | 6 +- .../ipc/event/full/It_los_event_039.c | 2 +- .../ipc/event/smoke/It_los_event_036.c | 2 +- .../ipc/event/smp/It_smp_los_event_032.c | 2 +- .../sample/kernel_base/ipc/mux/It_los_mux.c | 4 +- .../ipc/mux/full/It_los_mutex_013.c | 4 +- .../ipc/mux/full/It_los_mutex_016.c | 4 +- .../ipc/mux/full/It_los_mutex_017.c | 2 +- .../ipc/mux/full/It_los_mutex_020.c | 2 +- .../ipc/mux/full/It_los_mutex_021.c | 4 +- .../ipc/mux/full/It_los_mutex_026.c | 8 +-- .../ipc/mux/full/It_los_mutex_027.c | 8 +-- .../ipc/mux/full/It_los_mutex_028.c | 8 +-- .../ipc/mux/full/It_los_mutex_029.c | 8 +-- .../ipc/mux/full/It_los_mutex_031.c | 8 +-- .../ipc/mux/full/It_los_mutex_035.c | 6 +- .../ipc/mux/full/It_los_mutex_036.c | 6 +- .../ipc/mux/full/It_los_mutex_037.c | 4 +- .../ipc/mux/full/It_los_mutex_038.c | 4 +- .../ipc/mux/full/It_los_mutex_039.c | 4 +- .../ipc/mux/full/It_los_mutex_040.c | 8 +-- .../ipc/mux/full/It_los_mutex_041.c | 2 +- .../ipc/mux/full/It_los_mutex_042.c | 4 +- .../ipc/mux/full/It_los_mutex_043.c | 4 +- .../kernel_base/ipc/queue/It_los_queue.c | 6 +- .../kernel_base/ipc/queue/It_los_queue.h | 2 +- .../ipc/queue/full/It_los_queue_044.c | 2 +- .../ipc/queue/full/It_los_queue_045.c | 2 +- .../ipc/queue/full/It_los_queue_046.c | 2 +- .../ipc/queue/full/It_los_queue_047.c | 2 +- .../ipc/queue/full/It_los_queue_048.c | 2 +- .../ipc/queue/full/It_los_queue_050.c | 2 +- .../ipc/queue/full/It_los_queue_108.c | 2 +- .../ipc/queue/full/It_los_queue_111.c | 2 +- .../sample/kernel_base/ipc/sem/It_los_sem.c | 8 +-- .../sample/kernel_base/ipc/sem/It_los_sem.h | 2 +- .../kernel_base/ipc/sem/full/It_los_sem_020.c | 2 +- .../kernel_base/ipc/sem/full/It_los_sem_022.c | 4 +- .../kernel_base/ipc/sem/full/It_los_sem_023.c | 2 +- .../kernel_base/ipc/sem/full/It_los_sem_026.c | 4 +- .../ipc/sem/smp/It_smp_los_sem_030.c | 2 +- .../kernel_extend/cpup/It_extend_cpup.c | 2 +- .../kernel_extend/cpup/It_extend_cpup.h | 2 +- .../cpup/full/It_extend_cpup_004.c | 4 +- .../cpup/full/It_extend_cpup_005.c | 2 +- .../cpup/full/It_extend_cpup_006.c | 4 +- .../cpup/full/It_extend_cpup_008.c | 2 +- .../cpup/smp/It_smp_extend_cpup_001.c | 4 +- .../cpup/smp/It_smp_extend_cpup_002.c | 2 +- .../cpup/smp/It_smp_extend_cpup_003.c | 4 +- .../cpup/smp/It_smp_extend_cpup_004.c | 4 +- .../cpup/smp/It_smp_extend_cpup_005.c | 8 +-- .../cpup/smp/It_smp_extend_cpup_007.c | 4 +- .../cpup/smp/It_smp_extend_cpup_008.c | 4 +- .../cpup/smp/It_smp_extend_cpup_009.c | 6 +- .../cpup/smp/It_smp_extend_cpup_010.c | 4 +- .../cpup/smp/It_smp_extend_cpup_011.c | 4 +- .../cpup/smp/It_smp_extend_cpup_012.c | 4 +- .../sample/posix/mutex/It_posix_mutex.c | 2 +- .../sample/posix/pthread/It_posix_pthread.c | 2 +- .../posix/pthread/full/It_posix_pthread_066.c | 2 +- .../posix/pthread/full/It_posix_pthread_068.c | 2 +- testsuites/kernel/src/iCunit.c | 8 +-- testsuites/kernel/src/osTest.c | 6 +- testsuites/unittest/common/include/osTest.h | 2 +- testsuites/unittest/common/osTest.cpp | 2 +- testsuites/unittest/fs/proc/It_vfs_proc.cpp | 2 +- .../posix/mqueue/full/It_posix_queue_124.cpp | 4 +- .../posix/mqueue/posix_mqueue_test.cpp | 2 +- .../pthread/full/It_posix_pthread_066.cpp | 2 +- tools/build/mk/los_config.mk | 6 -- 265 files changed, 526 insertions(+), 557 deletions(-) diff --git a/arch/arm/arm/include/los_hw_cpu.h b/arch/arm/arm/include/los_hw_cpu.h index f6fc4460..425ca449 100644 --- a/arch/arm/arm/include/los_hw_cpu.h +++ b/arch/arm/arm/include/los_hw_cpu.h @@ -145,7 +145,7 @@ STATIC INLINE VOID ArchCurrUserTaskSet(UINTPTR val) STATIC INLINE UINT32 ArchCurrCpuid(VOID) { -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP return ARM_SYSREG_READ(MPIDR) & MPIDR_CPUID_MASK; #else return 0; diff --git a/arch/arm/arm/src/los_arch_mmu.c b/arch/arm/arm/src/los_arch_mmu.c index 435dcfaf..cce73fe2 100644 --- a/arch/arm/arm/src/los_arch_mmu.c +++ b/arch/arm/arm/src/los_arch_mmu.c @@ -51,7 +51,7 @@ __attribute__((aligned(MMU_DESCRIPTOR_L1_SMALL_ENTRY_NUMBERS))) \ __attribute__((section(".bss.prebss.translation_table"))) UINT8 \ g_firstPageTable[MMU_DESCRIPTOR_L1_SMALL_ENTRY_NUMBERS]; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP __attribute__((aligned(MMU_DESCRIPTOR_L1_SMALL_ENTRY_NUMBERS))) \ __attribute__((section(".bss.prebss.translation_table"))) UINT8 \ g_tempPageTable[MMU_DESCRIPTOR_L1_SMALL_ENTRY_NUMBERS]; @@ -218,7 +218,7 @@ STATIC UINT32 OsCvtSecCacheFlagsToMMUFlags(UINT32 flags) switch (flags & VM_MAP_REGION_FLAG_CACHE_MASK) { case VM_MAP_REGION_FLAG_CACHED: mmuFlags |= MMU_DESCRIPTOR_L1_TYPE_NORMAL_WRITE_BACK_ALLOCATE; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP mmuFlags |= MMU_DESCRIPTOR_L1_SECTION_SHAREABLE; #endif break; @@ -544,7 +544,7 @@ STATIC UINT32 OsCvtPte2CacheFlagsToMMUFlags(UINT32 flags) switch (flags & VM_MAP_REGION_FLAG_CACHE_MASK) { case VM_MAP_REGION_FLAG_CACHED: -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP mmuFlags |= MMU_DESCRIPTOR_L2_SHAREABLE; #endif mmuFlags |= MMU_DESCRIPTOR_L2_TYPE_NORMAL_WRITE_BACK_ALLOCATE; diff --git a/arch/arm/arm/src/los_exc.c b/arch/arm/arm/src/los_exc.c index 1c0c89cd..d944caaf 100644 --- a/arch/arm/arm/src/los_exc.c +++ b/arch/arm/arm/src/los_exc.c @@ -75,7 +75,7 @@ VOID OsExcHook(UINT32 excType, ExcContext *excBufAddr, UINT32 far, UINT32 fsr); UINT32 g_curNestCount[LOSCFG_KERNEL_CORE_NUM] = { 0 }; BOOL g_excFromUserMode[LOSCFG_KERNEL_CORE_NUM]; STATIC EXC_PROC_FUNC g_excHook = (EXC_PROC_FUNC)OsExcHook; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP STATIC SPIN_LOCK_INIT(g_excSerializerSpin); STATIC UINT32 g_currHandleExcPID = OS_INVALID_VALUE; STATIC UINT32 g_nextExcWaitCpu = INVALID_CPUID; @@ -531,7 +531,7 @@ STATIC VOID OsExcRestore(VOID) g_excFromUserMode[currCpuID] = FALSE; g_intCount[currCpuID] = 0; g_curNestCount[currCpuID] = 0; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP OsPercpuGet()->excFlag = CPU_RUNNING; #endif OsPercpuGet()->taskLockCnt = 0; @@ -548,7 +548,7 @@ STATIC VOID OsUserExcHandle(ExcContext *excBufAddr) return; } -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP LOS_SpinLock(&g_excSerializerSpin); if (g_nextExcWaitCpu != INVALID_CPUID) { g_currHandleExcCpuID = g_nextExcWaitCpu; @@ -563,7 +563,7 @@ STATIC VOID OsUserExcHandle(ExcContext *excBufAddr) #endif runProcess->processStatus &= ~OS_PROCESS_FLAG_EXIT; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP #ifdef LOSCFG_FS_VFS OsWakeConsoleSendTask(); #endif @@ -909,7 +909,7 @@ VOID OsDataAbortExcHandleEntry(ExcContext *excBufAddr) #endif /* __LINUX_ARM_ARCH__ */ #endif /* LOSCFG_GDB */ -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP #define EXC_WAIT_INTER 50U #define EXC_WAIT_TIME 2000U @@ -1027,7 +1027,7 @@ STATIC VOID OsCheckAllCpuStatus(VOID) STATIC VOID OsCheckCpuStatus(VOID) { -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP OsCheckAllCpuStatus(); #else g_currHandleExcCpuID = ArchCurrCpuid(); @@ -1048,7 +1048,7 @@ LITE_OS_SEC_TEXT VOID STATIC OsExcPriorDisposal(ExcContext *excBufAddr) OsCheckCpuStatus(); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP #ifdef LOSCFG_FS_VFS /* Wait for the end of the Console task to avoid multicore printing code */ OsWaitConsoleSendTaskPend(OsCurrTaskGet()->taskID); @@ -1113,7 +1113,7 @@ LITE_OS_SEC_TEXT_INIT VOID OsExcHandleEntry(UINT32 excType, ExcContext *excBufAd OsPrintExcHead(far); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP OsAllCpuStatusOutput(); #endif diff --git a/arch/arm/gic/gic_v2.c b/arch/arm/gic/gic_v2.c index 75c23219..9479c0d4 100644 --- a/arch/arm/gic/gic_v2.c +++ b/arch/arm/gic/gic_v2.c @@ -40,7 +40,7 @@ STATIC_ASSERT(OS_USER_HWI_MAX <= 1020, "hwi max is too large!"); STATIC UINT32 g_curIrqNum = 0; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP /* * filter description * 0b00: forward to the cpu interfaces specified in cpu_mask @@ -144,7 +144,7 @@ VOID HalIrqInit(VOID) /* enable gic distributor control */ GIC_REG_32(GICD_CTLR) = 1; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP /* register inter-processor interrupt */ (VOID)LOS_HwiCreate(LOS_MP_IPI_WAKEUP, 0xa0, 0, OsMpWakeHandler, 0); (VOID)LOS_HwiCreate(LOS_MP_IPI_SCHEDULE, 0xa0, 0, OsMpScheduleHandler, 0); diff --git a/arch/arm/gic/gic_v3.c b/arch/arm/gic/gic_v3.c index 03b8cfd8..f6e943f9 100644 --- a/arch/arm/gic/gic_v3.c +++ b/arch/arm/gic/gic_v3.c @@ -48,7 +48,7 @@ STATIC INLINE UINT64 MpidrToAffinity(UINT64 mpidr) (MPIDR_AFF_LEVEL(mpidr, 0))); } -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP STATIC UINT32 NextCpu(UINT32 cpu, UINT32 cpuMask) { @@ -399,7 +399,7 @@ VOID HalIrqInit(VOID) HalIrqInitPercpu(); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP /* register inter-processor interrupt */ LOS_HwiCreate(LOS_MP_IPI_WAKEUP, 0xa0, 0, OsMpWakeHandler, 0); LOS_HwiCreate(LOS_MP_IPI_SCHEDULE, 0xa0, 0, OsMpScheduleHandler, 0); diff --git a/arch/arm/include/hal_hwi.h b/arch/arm/include/hal_hwi.h index 9d08589a..4b068e41 100644 --- a/arch/arm/include/hal_hwi.h +++ b/arch/arm/include/hal_hwi.h @@ -49,7 +49,7 @@ extern VOID HalIrqClear(UINT32 vector); extern CHAR *HalIrqVersion(VOID); extern UINT32 HalCurIrqGet(VOID); extern UINT32 HalIrqSetPrio(UINT32 vector, UINT8 priority); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP extern VOID HalIrqSendIpi(UINT32 target, UINT32 ipi); extern VOID HalIrqSetAffinity(UINT32 vector, UINT32 cpuMask); #endif diff --git a/compat/posix/src/pthread.c b/compat/posix/src/pthread.c index b985da4f..f8ee1bf6 100644 --- a/compat/posix/src/pthread.c +++ b/compat/posix/src/pthread.c @@ -204,7 +204,7 @@ STATIC UINT32 InitPthreadData(pthread_t threadID, pthread_attr_t *userAttr, PRINT_ERR("%s: %d, err: %d\n", __FUNCTION__, __LINE__, err); return LOS_NOK; } -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP if (userAttr->cpuset.__bits[0] > 0) { taskCB->cpuAffiMask = (UINT16)userAttr->cpuset.__bits[0]; } diff --git a/compat/posix/src/pthread_attr.c b/compat/posix/src/pthread_attr.c index 29627cd3..0368b7bb 100644 --- a/compat/posix/src/pthread_attr.c +++ b/compat/posix/src/pthread_attr.c @@ -49,7 +49,7 @@ int pthread_attr_init(pthread_attr_t *attr) attr->stacksize_set = 1; attr->stacksize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP attr->cpuset.__bits[0] = 0; #endif @@ -239,7 +239,7 @@ int pthread_attr_getstacksize(const pthread_attr_t *attr, size_t *stackSize) */ int pthread_attr_setaffinity_np(pthread_attr_t* attr, size_t cpusetsize, const cpu_set_t* cpuset) { -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP if (attr == NULL) { return EINVAL; } @@ -264,7 +264,7 @@ int pthread_attr_setaffinity_np(pthread_attr_t* attr, size_t cpusetsize, const c */ int pthread_attr_getaffinity_np(const pthread_attr_t* attr, size_t cpusetsize, cpu_set_t* cpuset) { -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP if ((attr == NULL) || (cpuset == NULL) || (cpusetsize != sizeof(cpu_set_t))) { return EINVAL; } diff --git a/compat/posix/src/sched.c b/compat/posix/src/sched.c index 1c80780b..ece7752f 100644 --- a/compat/posix/src/sched.c +++ b/compat/posix/src/sched.c @@ -61,7 +61,7 @@ int sched_get_priority_max(int policy) */ int sched_setaffinity(pid_t pid, size_t set_size, const cpu_set_t* set) { -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP UINT32 taskID = (UINT32)pid; UINT32 ret; @@ -93,7 +93,7 @@ int sched_setaffinity(pid_t pid, size_t set_size, const cpu_set_t* set) */ int sched_getaffinity(pid_t pid, size_t set_size, cpu_set_t* set) { -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP UINT32 taskID = (UINT32)pid; UINT16 cpuAffiMask; diff --git a/fs/jffs2/src/vfs_jffs2.c b/fs/jffs2/src/vfs_jffs2.c index a0d3736c..5fa6a156 100644 --- a/fs/jffs2/src/vfs_jffs2.c +++ b/fs/jffs2/src/vfs_jffs2.c @@ -323,7 +323,7 @@ ssize_t VfsJffs2Write(struct file *filep, const char *buffer, size_t bufLen) c = JFFS2_SB_INFO(node->i_sb); pos = filep->f_pos; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP struct super_block *sb = node->i_sb; UINT16 gcCpuMask = LOS_TaskCpuAffiGet(sb->s_gc_thread); UINT32 curTaskId = LOS_CurTaskIDGet(); diff --git a/kernel/base/core/los_process.c b/kernel/base/core/los_process.c index 0f7c4b35..8d00696b 100644 --- a/kernel/base/core/los_process.c +++ b/kernel/base/core/los_process.c @@ -183,7 +183,7 @@ VOID OsWaitWakeTask(LosTaskCB *taskCB, UINT32 wakePID) { taskCB->waitID = wakePID; OsSchedTaskWake(taskCB); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP LOS_MpSchedule(OS_MP_CPU_ALL); #endif } @@ -312,7 +312,7 @@ LITE_OS_SEC_TEXT VOID OsProcessResourcesToFree(LosProcessCB *processCB) } #endif -#if (LOSCFG_KERNEL_LITEIPC == YES) +#ifdef LOSCFG_KERNEL_LITEIPC if (OsProcessIsUserMode(processCB)) { LiteIpcPoolDelete(&(processCB->ipcInfo)); (VOID)memset_s(&(processCB->ipcInfo), sizeof(ProcIpcInfo), 0, sizeof(ProcIpcInfo)); @@ -685,7 +685,7 @@ STATIC UINT32 OsProcessCreateInit(LosProcessCB *processCB, UINT32 flags, const C goto EXIT; } -#if (LOSCFG_KERNEL_LITEIPC == YES) +#ifdef LOSCFG_KERNEL_LITEIPC if (OsProcessIsUserMode(processCB)) { ret = LiteIpcPoolInit(&(processCB->ipcInfo)); if (ret != LOS_OK) { @@ -1294,7 +1294,7 @@ LITE_OS_SEC_TEXT UINT32 OsExecRecycleAndInit(LosProcessCB *processCB, const CHAR return ret; } -#if (LOSCFG_KERNEL_LITEIPC == YES) +#ifdef LOSCFG_KERNEL_LITEIPC ret = LiteIpcPoolInit(&(processCB->ipcInfo)); if (ret != LOS_OK) { return LOS_NOK; @@ -1690,7 +1690,7 @@ STATIC UINT32 OsCopyProcessResources(UINT32 flags, LosProcessCB *child, LosProce return ret; } -#if (LOSCFG_KERNEL_LITEIPC == YES) +#ifdef LOSCFG_KERNEL_LITEIPC if (OsProcessIsUserMode(child)) { ret = LiteIpcPoolReInit(&child->ipcInfo, (const ProcIpcInfo *)(&run->ipcInfo)); if (ret != LOS_OK) { diff --git a/kernel/base/core/los_sortlink.c b/kernel/base/core/los_sortlink.c index 8a997e50..6cb8b82b 100644 --- a/kernel/base/core/los_sortlink.c +++ b/kernel/base/core/los_sortlink.c @@ -127,7 +127,7 @@ STATIC Percpu *OsFindIdleCpu(UINT16 *ildeCpuID) Percpu *idleCpu = OsPercpuGetByID(0); *ildeCpuID = 0; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP UINT16 cpuID = 1; UINT32 nodeNum = idleCpu->taskSortLink.nodeNum + idleCpu->swtmrSortLink.nodeNum; @@ -174,7 +174,7 @@ VOID OsAdd2SortLink(SortLinkList *node, UINT64 startTime, UINT32 waitTicks, Sort LOS_SpinLockSave(spinLock, &intSave); SET_SORTLIST_VALUE(node, startTime + (UINT64)waitTicks * OS_CYCLE_PER_TICK); OsAddNode2SortLink(sortLinkHeader, node); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP node->cpuid = idleCpu; if (idleCpu != ArchCurrCpuid()) { LOS_MpSchedule(CPUID_TO_AFFI_MASK(idleCpu)); @@ -186,7 +186,7 @@ VOID OsAdd2SortLink(SortLinkList *node, UINT64 startTime, UINT32 waitTicks, Sort VOID OsDeleteSortLink(SortLinkList *node, SortLinkType type) { UINT32 intSave; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP Percpu *cpu = OsPercpuGetByID(node->cpuid); #else Percpu *cpu = OsPercpuGetByID(0); diff --git a/kernel/base/core/los_swtmr.c b/kernel/base/core/los_swtmr.c index c2b0ba44..2cad2825 100644 --- a/kernel/base/core/los_swtmr.c +++ b/kernel/base/core/los_swtmr.c @@ -38,7 +38,7 @@ #include "los_task_pri.h" -#if (LOSCFG_BASE_CORE_SWTMR == YES) +#ifdef LOSCFG_BASE_CORE_SWTMR_ENABLE #if (LOSCFG_BASE_CORE_SWTMR_LIMIT <= 0) #error "swtmr maxnum cannot be zero" #endif /* LOSCFG_BASE_CORE_SWTMR_LIMIT <= 0 */ @@ -84,7 +84,7 @@ LITE_OS_SEC_TEXT_INIT UINT32 OsSwtmrTaskCreate(VOID) swtmrTask.pcName = "Swt_Task"; swtmrTask.usTaskPrio = 0; swtmrTask.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP swtmrTask.usCpuAffiMask = CPUID_TO_AFFI_MASK(cpuid); #endif ret = LOS_TaskCreate(&swtmrTaskID, &swtmrTask); @@ -533,4 +533,4 @@ LITE_OS_SEC_TEXT UINT32 LOS_SwtmrDelete(UINT16 swtmrID) return ret; } -#endif /* LOSCFG_BASE_CORE_SWTMR */ +#endif /* LOSCFG_BASE_CORE_SWTMR_ENABLE */ diff --git a/kernel/base/core/los_task.c b/kernel/base/core/los_task.c index 2d00d589..0eadc9db 100644 --- a/kernel/base/core/los_task.c +++ b/kernel/base/core/los_task.c @@ -51,10 +51,10 @@ #ifdef LOSCFG_KERNEL_CPUP #include "los_cpup_pri.h" #endif -#if (LOSCFG_BASE_CORE_SWTMR == YES) +#ifdef LOSCFG_BASE_CORE_SWTMR_ENABLE #include "los_swtmr_pri.h" #endif -#if (LOSCFG_KERNEL_LITEIPC == YES) +#ifdef LOSCFG_KERNEL_LITEIPC #include "hm_liteipc.h" #endif #ifdef LOSCFG_ENABLE_OOM_LOOP_TASK @@ -98,7 +98,7 @@ VOID OsSetMainTask() g_mainTask[i].taskStatus = OS_TASK_STATUS_UNUSED; g_mainTask[i].taskID = LOSCFG_BASE_CORE_TSK_LIMIT; g_mainTask[i].priority = OS_TASK_PRIORITY_LOWEST; -#if (LOSCFG_KERNEL_SMP_LOCKDEP == YES) +#ifdef LOSCFG_KERNEL_SMP_LOCKDEP g_mainTask[i].lockDep.lockDepth = 0; g_mainTask[i].lockDep.waitLock = NULL; #endif @@ -208,7 +208,7 @@ LITE_OS_SEC_TEXT_INIT UINT32 OsTaskInit(VOID) LOS_ListTailInsert(&g_losFreeTask, &g_taskCBArray[index].pendList); } -#if (LOSCFG_KERNEL_TRACE == YES) +#ifdef LOSCFG_KERNEL_TRACE LOS_TraceReg(LOS_TRACE_TASK, OsTaskTrace, LOS_TRACE_TASK_NAME, LOS_TRACE_ENABLE); #endif @@ -240,7 +240,7 @@ LITE_OS_SEC_TEXT_INIT UINT32 OsIdleTaskCreate(VOID) taskInitParam.pcName = "Idle"; taskInitParam.usTaskPrio = OS_TASK_PRIORITY_LOWEST; taskInitParam.processID = OsGetIdleProcessID(); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP taskInitParam.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreateOnly(idleTaskID, &taskInitParam); @@ -381,7 +381,7 @@ LITE_OS_SEC_TEXT_INIT STATIC VOID OsTaskStackAlloc(VOID **topStack, UINT32 stack STATIC INLINE UINT32 OsTaskSyncCreate(LosTaskCB *taskCB) { -#if (LOSCFG_KERNEL_SMP_TASK_SYNC == YES) +#ifdef LOSCFG_KERNEL_SMP_TASK_SYNC UINT32 ret = LOS_SemCreate(0, &taskCB->syncSignal); if (ret != LOS_OK) { return LOS_ERRNO_TSK_MP_SYNC_RESOURCE; @@ -394,7 +394,7 @@ STATIC INLINE UINT32 OsTaskSyncCreate(LosTaskCB *taskCB) STATIC INLINE VOID OsTaskSyncDestroy(UINT32 syncSignal) { -#if (LOSCFG_KERNEL_SMP_TASK_SYNC == YES) +#ifdef LOSCFG_KERNEL_SMP_TASK_SYNC (VOID)LOS_SemDelete(syncSignal); #else (VOID)syncSignal; @@ -403,7 +403,7 @@ STATIC INLINE VOID OsTaskSyncDestroy(UINT32 syncSignal) LITE_OS_SEC_TEXT UINT32 OsTaskSyncWait(const LosTaskCB *taskCB) { -#if (LOSCFG_KERNEL_SMP_TASK_SYNC == YES) +#ifdef LOSCFG_KERNEL_SMP_TASK_SYNC UINT32 ret = LOS_OK; LOS_ASSERT(LOS_SpinHeld(&g_taskSpin)); @@ -428,7 +428,7 @@ LITE_OS_SEC_TEXT UINT32 OsTaskSyncWait(const LosTaskCB *taskCB) STATIC INLINE VOID OsTaskSyncWake(const LosTaskCB *taskCB) { -#if (LOSCFG_KERNEL_SMP_TASK_SYNC == YES) +#ifdef LOSCFG_KERNEL_SMP_TASK_SYNC (VOID)OsSemPostUnsafe(taskCB->syncSignal, NULL); #else (VOID)taskCB; @@ -485,7 +485,7 @@ LITE_OS_SEC_TEXT VOID OsTaskResourcesToFree(LosTaskCB *taskCB) processCB->processID, taskCB->taskID, mapBase, mapSize, ret); } -#if (LOSCFG_KERNEL_LITEIPC == YES) +#ifdef LOSCFG_KERNEL_LITEIPC LiteIpcRemoveServiceHandle(taskCB); #endif } @@ -494,7 +494,7 @@ LITE_OS_SEC_TEXT VOID OsTaskResourcesToFree(LosTaskCB *taskCB) if (taskCB->taskStatus & OS_TASK_STATUS_UNUSED) { topOfStack = taskCB->topOfStack; taskCB->topOfStack = 0; -#if (LOSCFG_KERNEL_SMP_TASK_SYNC == YES) +#ifdef LOSCFG_KERNEL_SMP_TASK_SYNC syncSignal = taskCB->syncSignal; taskCB->syncSignal = LOSCFG_BASE_IPC_SEM_LIMIT; #endif @@ -523,12 +523,12 @@ LITE_OS_SEC_TEXT_INIT STATIC VOID OsTaskCBInitBase(LosTaskCB *taskCB, taskCB->taskEntry = initParam->pfnTaskEntry; taskCB->signal = SIGNAL_NONE; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP taskCB->currCpu = OS_TASK_INVALID_CPUID; taskCB->cpuAffiMask = (initParam->usCpuAffiMask) ? initParam->usCpuAffiMask : LOSCFG_KERNEL_CPU_MASK; #endif -#if (LOSCFG_KERNEL_LITEIPC == YES) +#ifdef LOSCFG_KERNEL_LITEIPC LOS_ListInit(&(taskCB->msgListHead)); #endif taskCB->policy = (initParam->policy == LOS_SCHED_FIFO) ? LOS_SCHED_FIFO : LOS_SCHED_RR; @@ -654,7 +654,7 @@ LITE_OS_SEC_TEXT_INIT UINT32 LOS_TaskCreateOnly(UINT32 *taskID, TSK_INIT_PARAM_S LOS_ERREND_TCB_INIT: (VOID)LOS_MemFree(pool, topStack); LOS_ERREND_REWIND_SYNC: -#if (LOSCFG_KERNEL_SMP_TASK_SYNC == YES) +#ifdef LOSCFG_KERNEL_SMP_TASK_SYNC OsTaskSyncDestroy(taskCB->syncSignal); #endif LOS_ERREND_REWIND_TCB: @@ -769,7 +769,7 @@ LITE_OS_SEC_TEXT_INIT STATIC BOOL OsTaskSuspendCheckOnRun(LosTaskCB *taskCB, UIN /* init default out return value */ *ret = LOS_OK; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP /* ASYNCHRONIZED. No need to do task lock checking */ if (taskCB->currCpu != ArchCurrCpuid()) { taskCB->signal = SIGNAL_SUSPEND; @@ -909,7 +909,7 @@ STATIC BOOL OsRunTaskToDeleteCheckOnRun(LosTaskCB *taskCB, UINT32 *ret) /* init default out return value */ *ret = LOS_OK; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP /* ASYNCHRONIZED. No need to do task lock checking */ if (taskCB->currCpu != ArchCurrCpuid()) { /* @@ -994,7 +994,7 @@ LITE_OS_SEC_TEXT UINT32 OsTaskDeleteUnsafe(LosTaskCB *taskCB, UINT32 status, UIN SCHEDULER_LOCK(intSave); } -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP LOS_ASSERT(OsPercpuGet()->taskLockCnt == 1); #else LOS_ASSERT(OsPercpuGet()->taskLockCnt == 0); @@ -1235,7 +1235,7 @@ LITE_OS_SEC_TEXT_MINOR UINT32 LOS_TaskInfoGet(UINT32 taskID, TSK_INFO_S *taskInf LITE_OS_SEC_TEXT BOOL OsTaskCpuAffiSetUnsafe(UINT32 taskID, UINT16 newCpuAffiMask, UINT16 *oldCpuAffiMask) { -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP LosTaskCB *taskCB = OS_TCB_FROM_TID(taskID); taskCB->cpuAffiMask = newCpuAffiMask; @@ -1286,7 +1286,7 @@ LITE_OS_SEC_TEXT_MINOR UINT32 LOS_TaskCpuAffiSet(UINT32 taskID, UINT16 cpuAffiMa LITE_OS_SEC_TEXT_MINOR UINT16 LOS_TaskCpuAffiGet(UINT32 taskID) { -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP #define INVALID_CPU_AFFI_MASK 0 LosTaskCB *taskCB = NULL; UINT16 cpuAffiMask; @@ -1346,7 +1346,7 @@ LITE_OS_SEC_TEXT_MINOR VOID OsTaskProcSignal(VOID) /* suspend killed task may fail, ignore the result */ (VOID)LOS_TaskSuspend(runTask->taskID); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP } else if (runTask->signal & SIGNAL_AFFI) { runTask->signal &= ~SIGNAL_AFFI; @@ -1406,7 +1406,7 @@ STATIC VOID OsExitGroupActiveTaskKilled(LosProcessCB *processCB, LosTaskCB *task INT32 ret; taskCB->taskStatus |= OS_TASK_FLAG_EXIT_KILL; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP /* The other core that the thread is running on and is currently running in a non-system call */ if (!taskCB->sig.sigIntLock && (taskCB->taskStatus & OS_TASK_STATUS_RUNNING)) { taskCB->signal = SIGNAL_KILL; diff --git a/kernel/base/core/los_tick.c b/kernel/base/core/los_tick.c index e799e4db..b5c2794e 100644 --- a/kernel/base/core/los_tick.c +++ b/kernel/base/core/los_tick.c @@ -57,7 +57,7 @@ LITE_OS_SEC_TEXT VOID OsTickHandler(VOID) OsVdsoTimevalUpdate(); #endif -#if (LOSCFG_BASE_CORE_TICK_HW_TIME == YES) +#ifdef LOSCFG_BASE_CORE_TICK_HW_TIME HalClockIrqClear(); /* diff from every platform */ #endif diff --git a/kernel/base/include/los_percpu_pri.h b/kernel/base/include/los_percpu_pri.h index 0a82c530..70662bf1 100644 --- a/kernel/base/include/los_percpu_pri.h +++ b/kernel/base/include/los_percpu_pri.h @@ -43,7 +43,7 @@ extern "C" { #endif /* __cplusplus */ #endif /* __cplusplus */ -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP typedef enum { CPU_RUNNING = 0, /* cpu is running */ CPU_HALT, /* cpu in the halt */ @@ -66,7 +66,7 @@ typedef struct { UINT32 swtmrTaskID; /* software timer task id */ UINT32 schedFlag; /* pending scheduler flag */ -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP UINT32 excFlag; /* cpu halt or exc flag */ #endif } Percpu; diff --git a/kernel/base/include/los_process_pri.h b/kernel/base/include/los_process_pri.h index e07ea820..8cf6b7c0 100644 --- a/kernel/base/include/los_process_pri.h +++ b/kernel/base/include/los_process_pri.h @@ -36,7 +36,7 @@ #include "los_sem_pri.h" #include "los_process.h" #include "los_vm_map.h" -#if (LOSCFG_KERNEL_LITEIPC == YES) +#ifdef LOSCFG_KERNEL_LITEIPC #include "hm_liteipc.h" #endif #ifdef LOSCFG_SECURITY_CAPABILITY @@ -96,12 +96,12 @@ typedef struct ProcessCB { volatile UINT32 threadNumber; /**< Number of threads alive under this process */ UINT32 threadCount; /**< Total number of threads created under this process */ LOS_DL_LIST waitList; /**< The process holds the waitLits to support wait/waitpid */ -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP UINT32 timerCpu; /**< CPU core number of this task is delayed or pended */ #endif UINTPTR sigHandler; /**< Signal handler */ sigset_t sigShare; /**< Signal share bit */ -#if (LOSCFG_KERNEL_LITEIPC == YES) +#ifdef LOSCFG_KERNEL_LITEIPC ProcIpcInfo ipcInfo; /**< Memory pool for lite ipc */ #endif #ifdef LOSCFG_KERNEL_VM diff --git a/kernel/base/include/los_sched_pri.h b/kernel/base/include/los_sched_pri.h index e5f1ea7c..21af8ce6 100644 --- a/kernel/base/include/los_sched_pri.h +++ b/kernel/base/include/los_sched_pri.h @@ -112,7 +112,7 @@ STATIC INLINE BOOL OsPreemptableInSched(VOID) { BOOL preemptable = FALSE; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP /* * For smp systems, schedule must hold the task spinlock, and this counter * will increase by 1 in that case. diff --git a/kernel/base/include/los_sortlink_pri.h b/kernel/base/include/los_sortlink_pri.h index fa2edf17..07a04d91 100644 --- a/kernel/base/include/los_sortlink_pri.h +++ b/kernel/base/include/los_sortlink_pri.h @@ -50,7 +50,7 @@ typedef enum { typedef struct { LOS_DL_LIST sortLinkNode; UINT64 responseTime; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP UINT32 cpuid; #endif } SortLinkList; diff --git a/kernel/base/include/los_task_pri.h b/kernel/base/include/los_task_pri.h index a4fdf7d3..13e5b4f9 100644 --- a/kernel/base/include/los_task_pri.h +++ b/kernel/base/include/los_task_pri.h @@ -344,14 +344,14 @@ typedef struct { INT32 errorNo; /**< Error Num */ UINT32 signal; /**< Task signal */ sig_cb sig; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP UINT16 currCpu; /**< CPU core number of this task is running on */ UINT16 lastCpu; /**< CPU core number of this task is running on last time */ UINT16 cpuAffiMask; /**< CPU affinity mask, support up to 16 cores */ -#if (LOSCFG_KERNEL_SMP_TASK_SYNC == YES) +#ifdef LOSCFG_KERNEL_SMP_TASK_SYNC UINT32 syncSignal; /**< Synchronization for signal handling */ #endif -#if (LOSCFG_KERNEL_SMP_LOCKDEP == YES) +#ifdef LOSCFG_KERNEL_SMP_LOCKDEP LockDep lockDep; #endif #endif @@ -368,7 +368,7 @@ typedef struct { UINTPTR waitID; /**< Wait for the PID or GID of the child process */ UINT16 waitFlag; /**< The type of child process that is waiting, belonging to a group or parent, a specific child process, or any child process */ -#if (LOSCFG_KERNEL_LITEIPC == YES) +#ifdef LOSCFG_KERNEL_LITEIPC UINT32 ipcStatus; LOS_DL_LIST msgListHead; BOOL accessMap[LOSCFG_BASE_CORE_TSK_LIMIT]; diff --git a/kernel/base/ipc/los_event.c b/kernel/base/ipc/los_event.c index fd872d64..4b745f88 100644 --- a/kernel/base/ipc/los_event.c +++ b/kernel/base/ipc/los_event.c @@ -35,7 +35,7 @@ #include "los_mp.h" #include "los_percpu_pri.h" #include "los_sched_pri.h" -#if (LOSCFG_BASE_CORE_SWTMR == YES) +#ifdef LOSCFG_BASE_CORE_SWTMR_ENABLE #include "los_exc.h" #endif diff --git a/kernel/base/ipc/los_mux.c b/kernel/base/ipc/los_mux.c index 7dc321af..61ee89e0 100644 --- a/kernel/base/ipc/los_mux.c +++ b/kernel/base/ipc/los_mux.c @@ -38,7 +38,7 @@ #include "los_sched_pri.h" -#if (LOSCFG_BASE_IPC_MUX == YES) +#ifdef LOSCFG_BASE_IPC_MUX #define MUTEXATTR_TYPE_MASK 0x0FU LITE_OS_SEC_TEXT UINT32 LOS_MuxAttrInit(LosMuxAttr *attr) @@ -560,5 +560,5 @@ LITE_OS_SEC_TEXT UINT32 LOS_MuxUnlock(LosMux *mutex) return ret; } -#endif /* (LOSCFG_BASE_IPC_MUX == YES) */ +#endif /* LOSCFG_BASE_IPC_MUX */ diff --git a/kernel/base/ipc/los_queue.c b/kernel/base/ipc/los_queue.c index 983e11f1..be4d176f 100644 --- a/kernel/base/ipc/los_queue.c +++ b/kernel/base/ipc/los_queue.c @@ -38,7 +38,7 @@ #include "los_percpu_pri.h" -#if (LOSCFG_BASE_IPC_QUEUE == YES) +#ifdef LOSCFG_BASE_IPC_QUEUE #if (LOSCFG_BASE_IPC_QUEUE_LIMIT <= 0) #error "queue maxnum cannot be zero" #endif /* LOSCFG_BASE_IPC_QUEUE_LIMIT <= 0 */ @@ -493,5 +493,5 @@ QUEUE_END: return ret; } -#endif /* (LOSCFG_BASE_IPC_QUEUE == YES) */ +#endif /* LOSCFG_BASE_IPC_QUEUE */ diff --git a/kernel/base/ipc/los_sem.c b/kernel/base/ipc/los_sem.c index 7f80a0ae..a6f10a80 100644 --- a/kernel/base/ipc/los_sem.c +++ b/kernel/base/ipc/los_sem.c @@ -40,7 +40,7 @@ #include "los_percpu_pri.h" -#if (LOSCFG_BASE_IPC_SEM == YES) +#ifdef LOSCFG_BASE_IPC_SEM #if (LOSCFG_BASE_IPC_SEM_LIMIT <= 0) #error "sem maxnum cannot be zero" @@ -283,5 +283,5 @@ LITE_OS_SEC_TEXT UINT32 LOS_SemPost(UINT32 semHandle) return ret; } -#endif /* (LOSCFG_BASE_IPC_SEM == YES) */ +#endif /* LOSCFG_BASE_IPC_SEM */ diff --git a/kernel/base/mem/tlsf/los_memory.c b/kernel/base/mem/tlsf/los_memory.c index a958ce92..0642a692 100644 --- a/kernel/base/mem/tlsf/los_memory.c +++ b/kernel/base/mem/tlsf/los_memory.c @@ -147,7 +147,7 @@ struct OsMemPoolInfo { VOID *pool; UINT32 totalSize; UINT32 attr; -#if defined(OS_MEM_WATERLINE) && (OS_MEM_WATERLINE == YES) +#ifdef LOSCFG_MEM_WATERLINE UINT32 waterLine; /* Maximum usage size in a memory pool */ UINT32 curUsedSize; /* Current usage size in a memory pool */ #endif @@ -230,7 +230,7 @@ STATIC INLINE VOID OsMemNodeSetTaskID(struct OsMemUsedNodeHead *node) } #endif -#if defined(OS_MEM_WATERLINE) && (OS_MEM_WATERLINE == YES) +#ifdef LOSCFG_MEM_WATERLINE STATIC INLINE VOID OsMemWaterUsedRecord(struct OsMemPoolHead *pool, UINT32 size) { pool->info.curUsedSize += size; @@ -775,7 +775,7 @@ STATIC UINT32 OsMemPoolInit(VOID *pool, UINT32 size) endNode->ptr.prev = newNode; OS_MEM_NODE_SET_USED_FLAG(endNode->sizeAndFlag); #endif -#if defined(OS_MEM_WATERLINE) && (OS_MEM_WATERLINE == YES) +#ifdef LOSCFG_MEM_WATERLINE poolHead->info.curUsedSize = sizeof(struct OsMemPoolHead) + OS_MEM_NODE_HEAD_SIZE; poolHead->info.waterLine = poolHead->info.curUsedSize; #endif @@ -1171,7 +1171,7 @@ STATIC INLINE UINT32 OsMemFree(struct OsMemPoolHead *pool, struct OsMemNodeHead return ret; } -#if defined(OS_MEM_WATERLINE) && (OS_MEM_WATERLINE == YES) +#ifdef LOSCFG_MEM_WATERLINE pool->info.curUsedSize -= OS_MEM_NODE_GET_SIZE(node->sizeAndFlag); #endif @@ -1256,14 +1256,14 @@ UINT32 LOS_MemFree(VOID *pool, VOID *ptr) STATIC INLINE VOID OsMemReAllocSmaller(VOID *pool, UINT32 allocSize, struct OsMemNodeHead *node, UINT32 nodeSize) { -#if defined(OS_MEM_WATERLINE) && (OS_MEM_WATERLINE == YES) +#ifdef LOSCFG_MEM_WATERLINE struct OsMemPoolHead *poolInfo = (struct OsMemPoolHead *)pool; #endif node->sizeAndFlag = nodeSize; if ((allocSize + OS_MEM_NODE_HEAD_SIZE + OS_MEM_MIN_ALLOC_SIZE) <= nodeSize) { OsMemSplitNode(pool, node, allocSize); OS_MEM_NODE_SET_USED_FLAG(node->sizeAndFlag); -#if defined(OS_MEM_WATERLINE) && (OS_MEM_WATERLINE == YES) +#ifdef LOSCFG_MEM_WATERLINE poolInfo->info.curUsedSize -= nodeSize - allocSize; #endif } @@ -1603,7 +1603,7 @@ STATIC VOID OsMemPoolHeadCheck(const struct OsMemPoolHead *pool) OUT: if (flag) { PRINTK("mem pool info: poolAddr: %#x, poolSize: 0x%x\n", pool, pool->info.totalSize); -#if defined(OS_MEM_WATERLINE) && (OS_MEM_WATERLINE == YES) +#ifdef LOSCFG_MEM_WATERLINE PRINTK("mem pool info: poolWaterLine: 0x%x, poolCurUsedSize: 0x%x\n", pool->info.waterLine, pool->info.curUsedSize); #endif @@ -1844,7 +1844,7 @@ UINT32 LOS_MemInfoGet(VOID *pool, LOS_MEM_POOL_STATUS *poolStatus) OsMemInfoGet(poolInfo, tmpNode, poolStatus); } #endif -#if defined(OS_MEM_WATERLINE) && (OS_MEM_WATERLINE == YES) +#ifdef LOSCFG_MEM_WATERLINE poolStatus->usageWaterLine = poolInfo->info.waterLine; #endif MEM_UNLOCK(poolInfo, intSave); @@ -1861,7 +1861,7 @@ STATIC VOID OsMemInfoPrint(VOID *pool) return; } -#if defined(OS_MEM_WATERLINE) && (OS_MEM_WATERLINE == YES) +#ifdef LOSCFG_MEM_WATERLINE PRINTK("pool addr pool size used size free size " "max free node size used node num free node num UsageWaterLine\n"); PRINTK("--------------- -------- ------- -------- " diff --git a/kernel/base/misc/sysinfo_shellcmd.c b/kernel/base/misc/sysinfo_shellcmd.c index 31431743..ba9186f8 100644 --- a/kernel/base/misc/sysinfo_shellcmd.c +++ b/kernel/base/misc/sysinfo_shellcmd.c @@ -119,9 +119,21 @@ UINT32 OsShellCmdSwtmrCntGet(VOID) LITE_OS_SEC_TEXT_MINOR VOID OsShellCmdSystemInfoGet(VOID) { UINT8 isTaskEnable = YES; - UINT8 isSemEnable = LOSCFG_BASE_IPC_SEM; - UINT8 isQueueEnable = LOSCFG_BASE_IPC_QUEUE; - UINT8 isSwtmrEnable = LOSCFG_BASE_CORE_SWTMR; +#ifdef LOSCFG_BASE_IPC_SEM + UINT8 isSemEnable = YES; +#else + UINT8 isSemEnable = NO; +#endif +#ifdef LOSCFG_BASE_IPC_QUEUE + UINT8 isQueueEnable = YES; +#else + UINT8 isQueueEnable = NO; +#endif +#ifdef LOSCFG_BASE_CORE_SWTMR_ENABLE + UINT8 isSwtmrEnable = YES; +#else + UINT8 isSwtmrEnable = NO; +#endif PRINTK("\n Module Used Total Enabled\n"); PRINTK("--------------------------------------------\n"); diff --git a/kernel/base/misc/task_shellcmd.c b/kernel/base/misc/task_shellcmd.c index 085788ad..05623a56 100644 --- a/kernel/base/misc/task_shellcmd.c +++ b/kernel/base/misc/task_shellcmd.c @@ -428,7 +428,7 @@ EXIT: STATIC VOID OsShellCmdTskInfoTitle(VOID *seqBuf, UINT16 flag) { PROCESS_INFO_SHOW(seqBuf, "\r\n TID PID "); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP PROCESS_INFO_SHOW(seqBuf, "Affi CPU "); #endif PROCESS_INFO_SHOW(seqBuf, " Status StackSize WaterLine "); @@ -456,7 +456,7 @@ STATIC INLINE VOID OsShellTskInfoData(const LosTaskCB *taskCB, VOID *seqBuf, UIN #endif PROCESS_INFO_SHOW(seqBuf, " %4u%5u", taskCB->taskID, taskCB->processID); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP PROCESS_INFO_SHOW(seqBuf, "%#5x%4d ", taskCB->cpuAffiMask, (INT16)(taskCB->currCpu)); #endif diff --git a/kernel/base/mp/los_lockdep.c b/kernel/base/mp/los_lockdep.c index 2f2ac0b8..2b850eb7 100644 --- a/kernel/base/mp/los_lockdep.c +++ b/kernel/base/mp/los_lockdep.c @@ -37,7 +37,7 @@ #include "los_exc.h" -#if (LOSCFG_KERNEL_SMP_LOCKDEP == YES) +#ifdef LOSCFG_KERNEL_SMP_LOCKDEP #define LOCKDEP_GET_NAME(lockDep, index) (((SPIN_LOCK_S *)((lockDep)->heldLocks[(index)].lockPtr))->name) #define LOCKDEP_GET_ADDR(lockDep, index) ((lockDep)->heldLocks[(index)].lockAddr) diff --git a/kernel/base/mp/los_mp.c b/kernel/base/mp/los_mp.c index c98cc01e..7bdce6ac 100644 --- a/kernel/base/mp/los_mp.c +++ b/kernel/base/mp/los_mp.c @@ -36,7 +36,7 @@ #include "los_swtmr.h" #include "los_task_pri.h" -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP VOID LOS_MpSchedule(UINT32 target) { diff --git a/kernel/base/mp/los_spinlock.c b/kernel/base/mp/los_spinlock.c index 385291ec..991af71d 100644 --- a/kernel/base/mp/los_spinlock.c +++ b/kernel/base/mp/los_spinlock.c @@ -30,7 +30,7 @@ */ #include "los_spinlock.h" -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP #include "los_sched_pri.h" diff --git a/kernel/base/mp/los_stat.c b/kernel/base/mp/los_stat.c index 04e71f7d..a0d25ca0 100644 --- a/kernel/base/mp/los_stat.c +++ b/kernel/base/mp/los_stat.c @@ -32,7 +32,7 @@ #include "los_task_pri.h" -#if (LOSCFG_KERNEL_SCHED_STATISTICS == YES) +#ifdef LOSCFG_KERNEL_SCHED_STATISTICS #define HIGHTASKPRI 16 #define NS_PER_MS 1000000 #define DECIMAL_TO_PERCENTAGE 100 @@ -212,7 +212,7 @@ LITE_OS_SEC_TEXT_MINOR VOID OsShellMpStaticStart(VOID) for (loop = 0; loop < g_taskMaxNum; loop++) { taskCB = (((LosTaskCB *)g_taskCBArray) + loop); if (taskCB->taskStatus & OS_TASK_STATUS_RUNNING) { -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP cpuid = taskCB->currCpu; #endif if ((UINT32)(OS_TASK_INVALID_CPUID) == cpuid) { @@ -293,7 +293,7 @@ LITE_OS_SEC_TEXT_MINOR VOID OsShellMpStaticStop(VOID) for (loop = 0; loop < g_taskMaxNum; loop++) { taskCB = (((LosTaskCB *)g_taskCBArray) + loop); if (taskCB->taskStatus & OS_TASK_STATUS_RUNNING) { -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP cpuid = taskCB->currCpu; #endif if (cpuid == (UINT32)(OS_TASK_INVALID_CPUID)) { diff --git a/kernel/base/sched/sched_sq/los_sched.c b/kernel/base/sched/sched_sq/los_sched.c index 5ab81c4b..099d83be 100644 --- a/kernel/base/sched/sched_sq/los_sched.c +++ b/kernel/base/sched/sched_sq/los_sched.c @@ -39,7 +39,7 @@ #endif #include "los_hw_tick_pri.h" #include "los_tick_pri.h" -#if (LOSCFG_BASE_CORE_TSK_MONITOR == YES) +#ifdef LOSCFG_BASE_CORE_TSK_MONITOR #include "los_stackinfo_pri.h" #endif #include "los_mp.h" @@ -443,7 +443,7 @@ STATIC INLINE VOID OsSchedWakePendTimeTask(UINT64 currTime, LosTaskCB *taskCB, B if (tempStatus & (OS_TASK_STATUS_PENDING | OS_TASK_STATUS_DELAY)) { taskCB->taskStatus &= ~(OS_TASK_STATUS_PENDING | OS_TASK_STATUS_PEND_TIME | OS_TASK_STATUS_DELAY); if (tempStatus & OS_TASK_STATUS_PENDING) { -#if (LOSCFG_KERNEL_LITEIPC == YES) +#ifdef LOSCFG_KERNEL_LITEIPC taskCB->ipcStatus &= ~IPC_THREAD_STATUS_PEND; #endif taskCB->taskStatus |= OS_TASK_STATUS_TIMEOUT; @@ -819,7 +819,7 @@ STATIC LosTaskCB *OsGetTopTask(VOID) UINT32 bitmap; LosTaskCB *newTask = NULL; UINT32 processBitmap = g_sched->queueBitmap; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP UINT32 cpuid = ArchCurrCpuid(); #endif @@ -830,11 +830,11 @@ STATIC LosTaskCB *OsGetTopTask(VOID) while (bitmap) { priority = CLZ(bitmap); LOS_DL_LIST_FOR_EACH_ENTRY(newTask, &queueList->priQueueList[priority], LosTaskCB, pendList) { -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP if (newTask->cpuAffiMask & (1U << cpuid)) { #endif goto FIND_TASK; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP } #endif } @@ -869,7 +869,7 @@ VOID OsSchedStart(VOID) OsSchedSetStartTime(HalClockGetCycles()); newTask->startTime = OsGerCurrSchedTimeCycle(); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP /* * attention: current cpu needs to be set, in case first task deletion * may fail because this flag mismatch with the real current cpu. @@ -889,7 +889,7 @@ VOID OsSchedStart(VOID) OsTaskContextLoad(newTask); } -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP VOID OsSchedToUserReleaseLock(VOID) { /* The scheduling lock needs to be released before returning to user mode */ @@ -900,7 +900,7 @@ VOID OsSchedToUserReleaseLock(VOID) } #endif -#if (LOSCFG_BASE_CORE_TSK_MONITOR == YES) +#ifdef LOSCFG_BASE_CORE_TSK_MONITOR STATIC VOID OsTaskStackCheck(LosTaskCB *runTask, LosTaskCB *newTask) { if (!OS_STACK_MAGIC_CHECK(runTask->topOfStack)) { @@ -917,9 +917,9 @@ STATIC VOID OsTaskStackCheck(LosTaskCB *runTask, LosTaskCB *newTask) STATIC INLINE VOID OsSchedSwitchCheck(LosTaskCB *runTask, LosTaskCB *newTask) { -#if (LOSCFG_BASE_CORE_TSK_MONITOR == YES) +#ifdef LOSCFG_BASE_CORE_TSK_MONITOR OsTaskStackCheck(runTask, newTask); -#endif /* LOSCFG_BASE_CORE_TSK_MONITOR == YES */ +#endif /* LOSCFG_BASE_CORE_TSK_MONITOR */ OsTraceTaskSchedule(newTask, runTask); } @@ -955,7 +955,7 @@ STATIC VOID OsSchedTaskSwicth(LosTaskCB *runTask, LosTaskCB *newTask) runTask->taskStatus &= ~OS_TASK_STATUS_RUNNING; newTask->taskStatus |= OS_TASK_STATUS_RUNNING; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP /* mask new running task's owner processor */ runTask->currCpu = OS_TASK_INVALID_CPUID; newTask->currCpu = ArchCurrCpuid(); @@ -1043,7 +1043,7 @@ VOID OsSchedIrqEndCheckNeedSched(VOID) VOID OsSchedResched(VOID) { LOS_ASSERT(LOS_SpinHeld(&g_taskSpin)); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP LOS_ASSERT(OsPercpuGet()->taskLockCnt == 1); #else LOS_ASSERT(OsPercpuGet()->taskLockCnt == 0); diff --git a/kernel/base/vm/oom.c b/kernel/base/vm/oom.c index f0c3c471..176429d5 100644 --- a/kernel/base/vm/oom.c +++ b/kernel/base/vm/oom.c @@ -37,7 +37,7 @@ #include "los_vm_phys.h" #include "los_vm_filemap.h" #include "los_process_pri.h" -#if (LOSCFG_BASE_CORE_SWTMR == YES) +#ifdef LOSCFG_BASE_CORE_SWTMR_ENABLE #include "los_swtmr_pri.h" #endif @@ -55,12 +55,12 @@ LITE_OS_SEC_TEXT_MINOR STATIC UINT32 OomScoreProcess(LosProcessCB *candidateProc { UINT32 actualPm; -#if (LOSCFG_KERNEL_SMP != YES) +#ifndef LOSCFG_KERNEL_SMP (VOID)LOS_MuxAcquire(&candidateProcess->vmSpace->regionMux); #endif /* we only consider actual physical memory here. */ OsUProcessPmUsage(candidateProcess->vmSpace, NULL, &actualPm); -#if (LOSCFG_KERNEL_SMP != YES) +#ifndef LOSCFG_KERNEL_SMP (VOID)LOS_MuxRelease(&candidateProcess->vmSpace->regionMux); #endif return actualPm; diff --git a/kernel/common/console.c b/kernel/common/console.c index c70466c3..461025cb 100644 --- a/kernel/common/console.c +++ b/kernel/common/console.c @@ -1662,7 +1662,7 @@ STATIC UINT32 ConsoleSendTask(UINTPTR param) return LOS_OK; } -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP VOID OsWaitConsoleSendTaskPend(UINT32 taskID) { UINT32 i; diff --git a/kernel/common/console.h b/kernel/common/console.h index ff50d3c8..68018385 100644 --- a/kernel/common/console.h +++ b/kernel/common/console.h @@ -120,7 +120,7 @@ extern INT32 FilepWrite(struct file *filep, const struct file_operations_vfs *fo extern INT32 FilepPoll(struct file *filep, const struct file_operations_vfs *fops, poll_table *fds); extern INT32 FilepIoctl(struct file *filep, const struct file_operations_vfs *fops, INT32 cmd, unsigned long arg); extern INT32 GetFilepOps(const struct file *filep, struct file **privFilep, const struct file_operations_vfs **fops); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP extern VOID OsWaitConsoleSendTaskPend(UINT32 taskID); extern VOID OsWakeConsoleSendTask(VOID); #endif diff --git a/kernel/common/los_config.c b/kernel/common/los_config.c index afd45a78..adfafd70 100644 --- a/kernel/common/los_config.c +++ b/kernel/common/los_config.c @@ -65,7 +65,7 @@ SystemRebootFunc OsGetRebootHook(VOID) extern UINT32 OsSystemInit(VOID); extern VOID SystemInit(VOID); -#if (LOSCFG_KERNEL_SMP == 1) +#ifdef LOSCFG_KERNEL_SMP extern VOID release_secondary_cores(VOID); #endif @@ -90,7 +90,7 @@ LITE_OS_SEC_TEXT_INIT STATIC UINT32 ArchEarlyInit(VOID) HalClockFreqWrite(OS_SYS_CLOCK); #endif -#if (LOSCFG_PLATFORM_HWI == 1) +#ifdef LOSCFG_PLATFORM_HWI OsHwiInit(); #endif @@ -118,7 +118,7 @@ LITE_OS_SEC_TEXT_INIT STATIC UINT32 OsIpcInit(VOID) { UINT32 ret; -#if (LOSCFG_BASE_IPC_SEM == 1) +#ifdef LOSCFG_BASE_IPC_SEM ret = OsSemInit(); if (ret != LOS_OK) { PRINT_ERR("OsSemInit error\n"); @@ -126,7 +126,7 @@ LITE_OS_SEC_TEXT_INIT STATIC UINT32 OsIpcInit(VOID) } #endif -#if (LOSCFG_BASE_IPC_QUEUE == 1) +#ifdef LOSCFG_BASE_IPC_QUEUE ret = OsQueueInit(); if (ret != LOS_OK) { PRINT_ERR("OsQueueInit error\n"); @@ -151,7 +151,7 @@ LITE_OS_SEC_TEXT_INIT STATIC UINT32 PlatformInit(VOID) LITE_OS_SEC_TEXT_INIT STATIC UINT32 KModInit(VOID) { -#if (LOSCFG_BASE_CORE_SWTMR == 1) +#ifdef LOSCFG_BASE_CORE_SWTMR_ENABLE OsSwtmrInit(); #endif return LOS_OK; @@ -167,7 +167,7 @@ LITE_OS_SEC_TEXT_INIT VOID OsSystemInfo(VOID) PRINT_RELEASE("\n******************Welcome******************\n\n" "Processor : %s" -#if (LOSCFG_KERNEL_SMP == 1) +#ifdef LOSCFG_KERNEL_SMP " * %d\n" "Run Mode : SMP\n" #else @@ -179,7 +179,7 @@ LITE_OS_SEC_TEXT_INIT VOID OsSystemInfo(VOID) "Kernel : %s %d.%d.%d.%d/%s\n" "\n*******************************************\n", LOS_CpuInfo(), -#if (LOSCFG_KERNEL_SMP == 1) +#ifdef LOSCFG_KERNEL_SMP LOSCFG_KERNEL_SMP_CORE_NUM, #endif HalIrqVersion(), __DATE__, __TIME__,\ @@ -265,7 +265,7 @@ LITE_OS_SEC_TEXT_INIT INT32 OsMain(VOID) OsInitCall(LOS_INIT_LEVEL_KMOD_EXTENDED); -#if (LOSCFG_KERNEL_SMP == 1) +#ifdef LOSCFG_KERNEL_SMP release_secondary_cores(); #endif @@ -303,7 +303,7 @@ STATIC UINT32 OsSystemInitTaskCreate(VOID) sysTask.pcName = "SystemInit"; sysTask.usTaskPrio = LOSCFG_BASE_CORE_TSK_DEFAULT_PRIO; sysTask.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == 1) +#ifdef LOSCFG_KERNEL_SMP sysTask.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif return LOS_TaskCreate(&taskID, &sysTask); diff --git a/kernel/common/los_config.h b/kernel/common/los_config.h index 520bf56a..3ce31935 100644 --- a/kernel/common/los_config.h +++ b/kernel/common/los_config.h @@ -116,16 +116,15 @@ extern UINT32 __heap_end; * External configuration item for timer tailoring */ #ifndef LOSCFG_BASE_CORE_TICK_HW_TIME -#define LOSCFG_BASE_CORE_TICK_HW_TIME NO +#undef LOSCFG_BASE_CORE_TICK_HW_TIME #endif - /****************************** Hardware interrupt module configuration ******************************/ /** * @ingroup los_config * Configuration item for hardware interrupt tailoring */ #ifndef LOSCFG_PLATFORM_HWI -#define LOSCFG_PLATFORM_HWI YES +#define LOSCFG_PLATFORM_HWI #endif /** @@ -221,15 +220,7 @@ extern UINT32 __heap_end; * Configuration item for task (stack) monitoring module tailoring */ #ifndef LOSCFG_BASE_CORE_TSK_MONITOR -#define LOSCFG_BASE_CORE_TSK_MONITOR YES -#endif - -/** - * @ingroup los_config - * Configuration item for task perf task filter hook - */ -#ifndef OS_PERF_TSK_FILTER -#define OS_PERF_TSK_FILTER NO +#define LOSCFG_BASE_CORE_TSK_MONITOR #endif /****************************** Semaphore module configuration ******************************/ @@ -238,7 +229,7 @@ extern UINT32 __heap_end; * Configuration item for semaphore module tailoring */ #ifndef LOSCFG_BASE_IPC_SEM -#define LOSCFG_BASE_IPC_SEM YES +#define LOSCFG_BASE_IPC_SEM #endif /** @@ -263,7 +254,7 @@ extern UINT32 __heap_end; * Configuration item for mutex module tailoring */ #ifndef LOSCFG_BASE_IPC_MUX -#define LOSCFG_BASE_IPC_MUX YES +#define LOSCFG_BASE_IPC_MUX #endif /****************************** Queue module configuration ********************************/ @@ -272,7 +263,7 @@ extern UINT32 __heap_end; * Configuration item for queue module tailoring */ #ifndef LOSCFG_BASE_IPC_QUEUE -#define LOSCFG_BASE_IPC_QUEUE YES +#define LOSCFG_BASE_IPC_QUEUE #endif /** @@ -283,14 +274,20 @@ extern UINT32 __heap_end; #define LOSCFG_BASE_IPC_QUEUE_LIMIT 1024 #endif /****************************** Software timer module configuration **************************/ -#if (LOSCFG_BASE_IPC_QUEUE == YES) +#ifdef LOSCFG_BASE_IPC_QUEUE /** * @ingroup los_config * Configuration item for software timer module tailoring */ -#ifndef LOSCFG_BASE_CORE_SWTMR -#define LOSCFG_BASE_CORE_SWTMR YES +#ifndef LOSCFG_BASE_CORE_SWTMR_ENABLE +#define LOSCFG_BASE_CORE_SWTMR_ENABLE +#endif + +#ifdef LOSCFG_BASE_CORE_SWTMR_ENABLE +#define LOSCFG_BASE_CORE_SWTMR 1 +#else +#define LOSCFG_BASE_CORE_SWTMR 0 #endif /** @@ -338,23 +335,7 @@ extern UINT32 __heap_end; #endif /****************************** SMP module configuration **************************/ -#ifndef LOSCFG_KERNEL_SMP -#define LOSCFG_KERNEL_SMP NO -#endif - -#ifndef LOSCFG_KERNEL_SMP_LOCKDEP -#define LOSCFG_KERNEL_SMP_LOCKDEP NO -#endif - -#ifndef LOSCFG_KERNEL_SMP_TASK_SYNC -#define LOSCFG_KERNEL_SMP_TASK_SYNC NO -#endif - -#ifndef LOSCFG_KERNEL_SCHED_STATISTICS -#define LOSCFG_KERNEL_SCHED_STATISTICS NO -#endif - -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP #define LOSCFG_KERNEL_CORE_NUM LOSCFG_KERNEL_SMP_CORE_NUM #else #define LOSCFG_KERNEL_CORE_NUM 1 @@ -391,11 +372,6 @@ extern UINT32 __heap_end; #define VERSION_NUM(a, b, c, d) (((a) << 24) | ((b) << 16) | (c) << 8 | (d)) #define KERNEL_OPEN_VERSION_NUM VERSION_NUM(KERNEL_MAJOR, KERNEL_MINOR, KERNEL_PATCH, KERNEL_ITRE) -/****************************** Dynamic loading module configuration **************************/ -#ifndef OS_AUTOINIT_DYNLOADER -#define OS_AUTOINIT_DYNLOADER YES -#endif - /****************************** Exception information configuration ******************************/ #ifdef LOSCFG_SAVE_EXCINFO /** diff --git a/kernel/extended/liteipc/hm_liteipc.c b/kernel/extended/liteipc/hm_liteipc.c index 6788815a..6068396e 100644 --- a/kernel/extended/liteipc/hm_liteipc.c +++ b/kernel/extended/liteipc/hm_liteipc.c @@ -40,7 +40,7 @@ #include "los_sched_pri.h" #include "los_spinlock.h" #include "los_task_pri.h" -#if (LOSCFG_KERNEL_TRACE == YES) +#ifdef LOSCFG_KERNEL_TRACE #include "los_trace.h" #include "los_trace_frame.h" #endif @@ -100,7 +100,7 @@ STATIC const struct file_operations_vfs g_liteIpcFops = { .mmap = LiteIpcMmap, /* mmap */ }; -#if (LOSCFG_KERNEL_TRACE == YES) +#ifdef LOSCFG_KERNEL_TRACE typedef enum { WRITE, WRITE_DROP, @@ -160,7 +160,7 @@ LITE_OS_SEC_TEXT_INIT UINT32 OsLiteIpcInit(VOID) for (i = 0; i < LOSCFG_BASE_CORE_PROCESS_LIMIT; i++) { LOS_ListInit(&(g_ipcUsedNodelist[i])); } -#if (LOSCFG_KERNEL_TRACE == YES) +#ifdef LOSCFG_KERNEL_TRACE ret = LOS_TraceReg(LOS_TRACE_IPC, OsIpcTrace, LOS_TRACE_IPC_NAME, LOS_TRACE_ENABLE); if (ret != LOS_OK) { PRINT_ERR("liteipc LOS_TraceReg failed:%d\n", ret); @@ -939,7 +939,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 CheckPara(IpcContent *content, UINT32 *dstTid) } #if (USE_TIMESTAMP == YES) if (now > msg->timestamp + LITEIPC_TIMEOUT_NS) { -#if (LOSCFG_KERNEL_TRACE == YES) +#ifdef LOSCFG_KERNEL_TRACE IpcTrace(msg, WRITE_DROP, 0, msg->type); #endif PRINT_ERR("A timeout reply, request timestamp:%lld, now:%lld\n", msg->timestamp, now); @@ -997,7 +997,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 LiteIpcWrite(IpcContent *content) SCHEDULER_LOCK(intSave); LosTaskCB *tcb = OS_TCB_FROM_TID(dstTid); LOS_ListTailInsert(&(tcb->msgListHead), &(buf->listNode)); -#if (LOSCFG_KERNEL_TRACE == YES) +#ifdef LOSCFG_KERNEL_TRACE IpcTrace(&buf->msg, WRITE, tcb->ipcStatus, buf->msg.type); #endif if (tcb->ipcStatus & IPC_THREAD_STATUS_PEND) { @@ -1057,13 +1057,13 @@ LITE_OS_SEC_TEXT STATIC UINT32 CheckRecievedMsg(IpcListNode *node, IpcContent *c ret = -EINVAL; } if (ret != LOS_OK) { -#if (LOSCFG_KERNEL_TRACE == YES) +#ifdef LOSCFG_KERNEL_TRACE IpcTrace(&node->msg, READ_DROP, tcb->ipcStatus, node->msg.type); #endif (VOID)HandleSpecialObjects(LOS_CurTaskIDGet(), node, TRUE); (VOID)LiteIpcNodeFree(LOS_GetCurrProcessID(), (VOID *)node); } else { -#if (LOSCFG_KERNEL_TRACE == YES) +#ifdef LOSCFG_KERNEL_TRACE IpcTrace(&node->msg, READ, tcb->ipcStatus, node->msg.type); #endif } @@ -1085,14 +1085,14 @@ LITE_OS_SEC_TEXT STATIC UINT32 LiteIpcRead(IpcContent *content) do { SCHEDULER_LOCK(intSave); if (LOS_ListEmpty(listHead)) { -#if (LOSCFG_KERNEL_TRACE == YES) +#ifdef LOSCFG_KERNEL_TRACE IpcTrace(NULL, TRY_READ, tcb->ipcStatus, syncFlag ? MT_REPLY : MT_REQUEST); #endif tcb->ipcStatus |= IPC_THREAD_STATUS_PEND; OsTaskWaitSetPendMask(OS_TASK_WAIT_LITEIPC, OS_INVALID_VALUE, timeout); ret = OsSchedTaskWait(&g_ipcPendlist, timeout, TRUE); if (ret == LOS_ERRNO_TSK_TIMEOUT) { -#if (LOSCFG_KERNEL_TRACE == YES) +#ifdef LOSCFG_KERNEL_TRACE IpcTrace(NULL, READ_TIMEOUT, tcb->ipcStatus, syncFlag ? MT_REPLY : MT_REQUEST); #endif SCHEDULER_UNLOCK(intSave); diff --git a/kernel/include/los_memory.h b/kernel/include/los_memory.h index 3ced9ad0..8dd00599 100644 --- a/kernel/include/los_memory.h +++ b/kernel/include/los_memory.h @@ -77,19 +77,6 @@ extern UINT8 *m_aucSysMem0; */ extern UINT8 *m_aucSysMem1; -/** - * @ingroup los_memory - * The memory Maximum memory usage statistics. - * @attention - *
  • If running as debug mode, it will affect the performance of memory malloc and free.
  • - *
  • OS_MEM_WATERLINE=YES: open the function for Maximum memory usage statistics
  • - *
  • OS_MEM_WATERLINE=NO: close the function for Maximum memory usage statistics, it set to NO as usual
  • - *
- */ -#ifdef LOSCFG_MEM_WATERLINE -#define OS_MEM_WATERLINE YES -#endif - #ifdef LOSCFG_MEM_MUL_POOL /** * @ingroup los_memory @@ -141,7 +128,7 @@ typedef struct { UINT32 maxFreeNodeSize; UINT32 usedNodeNum; UINT32 freeNodeNum; -#if defined(OS_MEM_WATERLINE) && (OS_MEM_WATERLINE == YES) +#ifdef LOSCFG_MEM_WATERLINE UINT32 usageWaterLine; #endif } LOS_MEM_POOL_STATUS; diff --git a/kernel/include/los_mp.h b/kernel/include/los_mp.h index 2b456620..dcb3e4cd 100644 --- a/kernel/include/los_mp.h +++ b/kernel/include/los_mp.h @@ -50,7 +50,7 @@ typedef enum { LOS_MP_IPI_HALT, } MP_IPI_TYPE; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP extern VOID LOS_MpSchedule(UINT32 target); extern VOID OsMpWakeHandler(VOID); extern VOID OsMpScheduleHandler(VOID); diff --git a/kernel/include/los_spinlock.h b/kernel/include/los_spinlock.h index 504fcfb0..8ee14b9d 100644 --- a/kernel/include/los_spinlock.h +++ b/kernel/include/los_spinlock.h @@ -49,14 +49,14 @@ extern INT32 ArchSpinTrylock(size_t *lock); typedef struct Spinlock { size_t rawLock; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP UINT32 cpuid; VOID *owner; const CHAR *name; #endif } SPIN_LOCK_S; -#if (LOSCFG_KERNEL_SMP_LOCKDEP == YES) +#ifdef LOSCFG_KERNEL_SMP_LOCKDEP #define LOCKDEP_CHECK_IN(lock) OsLockDepCheckIn(lock) #define LOCKDEP_RECORD(lock) OsLockDepRecord(lock) #define LOCKDEP_CHECK_OUT(lock) OsLockDepCheckOut(lock) @@ -68,7 +68,7 @@ typedef struct Spinlock { #define LOCKDEP_CLEAR_LOCKS() #endif -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP #define SPINLOCK_OWNER_INIT NULL #define SPIN_LOCK_INITIALIZER(lockName) \ diff --git a/kernel/include/los_task.h b/kernel/include/los_task.h index 49df83b3..6477c735 100644 --- a/kernel/include/los_task.h +++ b/kernel/include/los_task.h @@ -498,7 +498,7 @@ typedef struct tagTskInitParam { UINTPTR auwArgs[4]; /**< Task parameters, of which the maximum number is four */ UINT32 uwStackSize; /**< Task stack size */ CHAR *pcName; /**< Task name */ -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP UINT16 usCpuAffiMask; /**< Task cpu affinity mask */ #endif UINT32 uwResved; /**< It is automatically deleted if set to LOS_TASK_STATUS_DETACHED. diff --git a/net/lwip-2.1/porting/src/sys_arch.c b/net/lwip-2.1/porting/src/sys_arch.c index 9826fba7..7e08ec57 100644 --- a/net/lwip-2.1/porting/src/sys_arch.c +++ b/net/lwip-2.1/porting/src/sys_arch.c @@ -40,11 +40,11 @@ #include #include -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP SPIN_LOCK_INIT(arch_protect_spin); static u32_t lwprot_thread = LOS_ERRNO_TSK_ID_INVALID; static int lwprot_count = 0; -#endif /* LOSCFG_KERNEL_SMP == YES */ +#endif /* LOSCFG_KERNEL_SMP */ #define ROUND_UP_DIV(val, div) (((val) + (div) - 1) / (div)) @@ -103,7 +103,7 @@ u16_t lwip_standard_chksum(const void *dataptr, int len) sys_prot_t sys_arch_protect(void) { -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP /* Note that we are using spinlock instead of mutex for LiteOS-SMP here: * 1. spinlock is more effective for short critical region protection. * 2. this function is called only in task context, not in interrupt handler. @@ -121,14 +121,14 @@ sys_prot_t sys_arch_protect(void) } #else LOS_TaskLock(); -#endif /* LOSCFG_KERNEL_SMP == YES */ +#endif /* LOSCFG_KERNEL_SMP */ return 0; /* return value is unused */ } void sys_arch_unprotect(sys_prot_t pval) { LWIP_UNUSED_ARG(pval); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP if (lwprot_thread == LOS_CurTaskIDGet()) { lwprot_count--; if (lwprot_count == 0) { @@ -138,7 +138,7 @@ void sys_arch_unprotect(sys_prot_t pval) } #else LOS_TaskUnlock(); -#endif /* LOSCFG_KERNEL_SMP == YES */ +#endif /* LOSCFG_KERNEL_SMP */ } diff --git a/net/telnet/src/telnet_dev.c b/net/telnet/src/telnet_dev.c index 06ab5685..0af77518 100644 --- a/net/telnet/src/telnet_dev.c +++ b/net/telnet/src/telnet_dev.c @@ -38,7 +38,7 @@ #include "pthread.h" #include "los_printf.h" -#if (LOSCFG_BASE_CORE_SWTMR == YES) +#ifdef LOSCFG_BASE_CORE_SWTMR_ENABLE #include "los_swtmr_pri.h" #endif #include "los_sched_pri.h" @@ -265,7 +265,7 @@ STATIC ssize_t TelnetWrite(struct file *file, const CHAR *buf, const size_t bufL } if (telnetDev->clientFd != 0) { -#if (LOSCFG_BASE_CORE_SWTMR == YES) +#ifdef LOSCFG_BASE_CORE_SWTMR_ENABLE /* DO NOT call blocking API in software timer task */ if (((LosTaskCB*)OsCurrTaskGet())->taskEntry == (TSK_ENTRY_FUNC)OsSwtmrTask) { TelnetUnlock(); diff --git a/platform/main.c b/platform/main.c index a021b1d9..7a9aa62c 100644 --- a/platform/main.c +++ b/platform/main.c @@ -40,13 +40,13 @@ #include "los_swtmr_pri.h" #include "los_task_pri.h" -#if (LOSCFG_KERNEL_SMP == 1) +#ifdef LOSCFG_KERNEL_SMP STATIC Atomic g_ncpu = 1; #endif LITE_OS_SEC_TEXT_INIT VOID secondary_cpu_start(VOID) { -#if (LOSCFG_KERNEL_SMP == 1) +#ifdef LOSCFG_KERNEL_SMP UINT32 cpuid = ArchCurrCpuid(); OsCurrTaskSet(OsGetMainTask()); @@ -73,7 +73,7 @@ LITE_OS_SEC_TEXT_INIT VOID secondary_cpu_start(VOID) OsCurrProcessSet(OS_PCB_FROM_PID(OsGetKernelInitProcessID())); OsInitCall(LOS_INIT_LEVEL_KMOD_BASIC); -#if (LOSCFG_BASE_CORE_SWTMR == 1) +#ifdef LOSCFG_BASE_CORE_SWTMR_ENABLE OsSwtmrInit(); #endif @@ -89,7 +89,7 @@ LITE_OS_SEC_TEXT_INIT VOID secondary_cpu_start(VOID) #endif } -#if (LOSCFG_KERNEL_SMP == 1) +#ifdef LOSCFG_KERNEL_SMP #ifdef LOSCFG_TEE_ENABLE #define TSP_CPU_ON 0xb2000011UL STATIC INT32 raw_smc_send(UINT32 cmd) diff --git a/syscall/process_syscall.c b/syscall/process_syscall.c index b4f5d002..997f631c 100644 --- a/syscall/process_syscall.c +++ b/syscall/process_syscall.c @@ -1037,7 +1037,7 @@ int SysSchedGetAffinity(int id, unsigned int *cpuset, int flag) } } -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP cpuAffiMask = (unsigned int)OS_TCB_FROM_TID(taskID)->cpuAffiMask; #else cpuAffiMask = 1; diff --git a/testsuites/kernel/include/iCunit.h b/testsuites/kernel/include/iCunit.h index a0de0031..c0c67484 100644 --- a/testsuites/kernel/include/iCunit.h +++ b/testsuites/kernel/include/iCunit.h @@ -522,7 +522,7 @@ extern void ICunitSaveErr(iiUINT32 line, iiUINT32 retCode); } while (0) #endif -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP extern SPIN_LOCK_S g_testSuitSpin; #define TESTSUIT_LOCK(state) LOS_SpinLockSave(&g_testSuitSpin, &(state)) #define TESTSUIT_UNLOCK(state) LOS_SpinUnlockRestore(&g_testSuitSpin, state) diff --git a/testsuites/kernel/include/osTest.h b/testsuites/kernel/include/osTest.h index 7ad31b69..901dcf72 100644 --- a/testsuites/kernel/include/osTest.h +++ b/testsuites/kernel/include/osTest.h @@ -96,7 +96,7 @@ extern "C" { testTask.uwResved = LOS_TASK_STATUS_DETACHED; \ } while (0); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP #define TEST_TASK_PARAM_INIT_AFFI(testTask, task_name, entry, prio, affi) \ TEST_TASK_PARAM_INIT(testTask, task_name, entry, prio) \ testTask.usCpuAffiMask = affi; diff --git a/testsuites/kernel/sample/kernel_base/core/hwi/It_smp_hwi.c b/testsuites/kernel/sample/kernel_base/core/hwi/It_smp_hwi.c index 36bea719..68d45192 100644 --- a/testsuites/kernel/sample/kernel_base/core/hwi/It_smp_hwi.c +++ b/testsuites/kernel/sample/kernel_base/core/hwi/It_smp_hwi.c @@ -38,7 +38,7 @@ extern "C" { #endif /* __cpluscplus */ VOID ItSuiteSmpHwi(VOID) { -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP ItSmpLosHwi001(); ItSmpLosHwi002(); ItSmpLosHwi003(); @@ -84,7 +84,7 @@ VOID ItSuiteSmpHwi(VOID) ItSmpLosHwiNest007(); ItSmpLosHwiNest008(); #endif -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST, 1); HalIrqSetAffinity(HWI_NUM_TEST1, 1); HalIrqSetAffinity(HWI_NUM_TEST2, 1); diff --git a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_001.c b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_001.c index aa823736..a60728b6 100644 --- a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_001.c +++ b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_001.c @@ -36,7 +36,7 @@ extern "C" { #endif /* __cpluscplus */ #endif /* __cpluscplus */ -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP static UINT32 g_testTimes; static VOID HwiF01(void) diff --git a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_002.c b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_002.c index 06fde600..bc8bbf94 100644 --- a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_002.c +++ b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_002.c @@ -36,7 +36,7 @@ extern "C" { #endif /* __cpluscplus */ #endif /* __cpluscplus */ -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP static VOID HwiF01(void) { LOS_AtomicInc(&g_testCount); diff --git a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_003.c b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_003.c index f0b422da..c7cb8f1e 100644 --- a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_003.c +++ b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_003.c @@ -36,7 +36,7 @@ extern "C" { #endif /* __cpluscplus */ #endif /* __cpluscplus */ -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP static UINT32 g_testTimes; static VOID HwiF01(void) diff --git a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_004.c b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_004.c index ed809362..8a6e5138 100644 --- a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_004.c +++ b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_004.c @@ -37,7 +37,7 @@ extern "C" { #endif /* __cpluscplus */ #endif /* __cpluscplus */ -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP static UINT32 g_testTimes; static VOID HwiF01(void) diff --git a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_005.c b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_005.c index 2a408e27..3811c4e1 100644 --- a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_005.c +++ b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_005.c @@ -36,7 +36,7 @@ extern "C" { #endif /* __cpluscplus */ #endif /* __cpluscplus */ -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP static VOID HwiF01(void) { diff --git a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_006.c b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_006.c index 221678df..f3d58cda 100644 --- a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_006.c +++ b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_006.c @@ -37,7 +37,7 @@ extern "C" { #endif /* __cpluscplus */ #endif /* __cpluscplus */ -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP static VOID HwiF01(void) { diff --git a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_007.c b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_007.c index a63b39b0..1a901cc3 100644 --- a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_007.c +++ b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_007.c @@ -36,7 +36,7 @@ extern "C" { #endif /* __cpluscplus */ #endif /* __cpluscplus */ -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP static VOID HwiF01(void) { diff --git a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_008.c b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_008.c index b26f6adf..497d73eb 100644 --- a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_008.c +++ b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_008.c @@ -36,7 +36,7 @@ extern "C" { #endif /* __cpluscplus */ #endif /* __cpluscplus */ -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP static UINT32 g_ret = 0; static VOID HwiF01(void) diff --git a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_009.c b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_009.c index 22bb709f..f1541a4e 100644 --- a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_009.c +++ b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_009.c @@ -36,7 +36,7 @@ extern "C" { #endif /* __cpluscplus */ #endif /* __cpluscplus */ -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP static UINT32 g_ret = 0; static VOID HwiF01(void) diff --git a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_010.c b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_010.c index b28b2f42..230ae933 100644 --- a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_010.c +++ b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_010.c @@ -36,7 +36,7 @@ extern "C" { #endif /* __cpluscplus */ #endif /* __cpluscplus */ -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP static UINT32 g_szId[LOSCFG_KERNEL_CORE_NUM] = {0}; static VOID SwtmrF01(void) { diff --git a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_011.c b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_011.c index b9ee190b..d58221d9 100644 --- a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_011.c +++ b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_011.c @@ -36,7 +36,7 @@ extern "C" { #endif /* __cpluscplus */ #endif /* __cpluscplus */ -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP static UINT32 g_szId[LOSCFG_KERNEL_CORE_NUM] = {0}; static VOID SwtmrF01(void) { diff --git a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_012.c b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_012.c index 4d6ba350..ae21951c 100644 --- a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_012.c +++ b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_012.c @@ -36,7 +36,7 @@ extern "C" { #endif /* __cpluscplus */ #endif /* __cpluscplus */ -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP static UINT32 g_szId[LOSCFG_KERNEL_CORE_NUM] = {0}; static VOID SwtmrF01(void) { diff --git a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_013.c b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_013.c index 7c3a571e..9b4604b3 100644 --- a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_013.c +++ b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_013.c @@ -36,7 +36,7 @@ extern "C" { #endif /* __cpluscplus */ #endif /* __cpluscplus */ -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP static VOID SwtmrF01(void) { diff --git a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_001.c b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_001.c index 820e3858..7507779e 100644 --- a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_001.c +++ b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_001.c @@ -36,7 +36,7 @@ extern "C" { #endif /* __cpluscplus */ #endif /* __cpluscplus */ -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP static UINT32 g_targetCpuid; static VOID HwiF01(void) diff --git a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_002.c b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_002.c index a19ad70c..054771aa 100644 --- a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_002.c +++ b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_002.c @@ -36,7 +36,7 @@ extern "C" { #endif /* __cpluscplus */ #endif /* __cpluscplus */ -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP static UINT32 g_targetCpuid; static VOID HwiF01(void) diff --git a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_003.c b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_003.c index 180b5065..d7c82d16 100644 --- a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_003.c +++ b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_003.c @@ -36,7 +36,7 @@ extern "C" { #endif /* __cpluscplus */ #endif /* __cpluscplus */ -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP static UINT32 g_targetCpuid; static VOID HwiF01(void) diff --git a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_004.c b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_004.c index a37d3108..b1ef1588 100644 --- a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_004.c +++ b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_004.c @@ -36,7 +36,7 @@ extern "C" { #endif /* __cpluscplus */ #endif /* __cpluscplus */ -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP static UINT32 g_targetCpuid; static VOID HwiF01(void) diff --git a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_005.c b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_005.c index 663e37e4..03964fc9 100644 --- a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_005.c +++ b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_005.c @@ -36,7 +36,7 @@ extern "C" { #endif /* __cpluscplus */ #endif /* __cpluscplus */ -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP static UINT32 g_targetCpuid; static VOID HwiF01(void) diff --git a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_006.c b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_006.c index d7f2a75b..4e4cc7b2 100644 --- a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_006.c +++ b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_006.c @@ -36,7 +36,7 @@ extern "C" { #endif /* __cpluscplus */ #endif /* __cpluscplus */ -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP static UINT32 g_targetCpuid; static UINT32 g_szId[LOSCFG_KERNEL_CORE_NUM] = {0}; diff --git a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_007.c b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_007.c index 3597112f..e8decb70 100644 --- a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_007.c +++ b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_007.c @@ -36,7 +36,7 @@ extern "C" { #endif /* __cpluscplus */ #endif /* __cpluscplus */ -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP static UINT32 g_targetCpuid; /* for debugging */ diff --git a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_008.c b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_008.c index eb621014..ccfe146c 100644 --- a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_008.c +++ b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_008.c @@ -36,7 +36,7 @@ extern "C" { #endif /* __cpluscplus */ #endif /* __cpluscplus */ -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP static UINT32 g_targetCpuid; static VOID SwtmrF01(void) diff --git a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_001.c b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_001.c index 4d863e68..8bd2d2f0 100644 --- a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_001.c +++ b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_001.c @@ -36,7 +36,7 @@ extern "C" { #endif /* __cpluscplus */ #endif /* __cpluscplus */ -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP static UINT32 g_targetCpuid; static VOID HwiF02(void) diff --git a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_002.c b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_002.c index 6e334c56..4d8f9a27 100644 --- a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_002.c +++ b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_002.c @@ -36,7 +36,7 @@ extern "C" { #endif /* __cpluscplus */ #endif /* __cpluscplus */ -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP static UINT32 g_targetCpuid; extern EVENT_CB_S g_event; static VOID HwiF02(void) diff --git a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_003.c b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_003.c index 8be106dd..9f71aa5d 100644 --- a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_003.c +++ b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_003.c @@ -36,7 +36,7 @@ extern "C" { #endif /* __cpluscplus */ #endif /* __cpluscplus */ -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP static UINT32 g_targetCpuid; static VOID HwiF02(void) diff --git a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_004.c b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_004.c index ef9720b0..62a285c0 100644 --- a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_004.c +++ b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_004.c @@ -36,7 +36,7 @@ extern "C" { #endif /* __cpluscplus */ #endif /* __cpluscplus */ -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP static UINT32 g_targetCpuid; static VOID HwiF02(void) diff --git a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_005.c b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_005.c index ce7aa34d..87414631 100644 --- a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_005.c +++ b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_005.c @@ -36,7 +36,7 @@ extern "C" { #endif /* __cpluscplus */ #endif /* __cpluscplus */ -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP static UINT32 g_targetCpuid; static VOID HwiF02(void) diff --git a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_006.c b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_006.c index f06786b3..fb416702 100644 --- a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_006.c +++ b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_006.c @@ -36,7 +36,7 @@ extern "C" { #endif /* __cpluscplus */ #endif /* __cpluscplus */ -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP static UINT32 g_targetCpuid; static VOID HwiF02(void) diff --git a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_007.c b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_007.c index 609c2275..b9050a8b 100644 --- a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_007.c +++ b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_007.c @@ -36,7 +36,7 @@ extern "C" { #endif /* __cpluscplus */ #endif /* __cpluscplus */ -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP static UINT32 g_targetCpuid; static VOID HwiF02(void) diff --git a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_008.c b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_008.c index 9d6a4ef6..d1fea484 100644 --- a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_008.c +++ b/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_008.c @@ -36,7 +36,7 @@ extern "C" { #endif /* __cpluscplus */ #endif /* __cpluscplus */ -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP static UINT32 g_targetCpuid; static VOID HwiF02(void) diff --git a/testsuites/kernel/sample/kernel_base/core/swtmr/It_los_swtmr.c b/testsuites/kernel/sample/kernel_base/core/swtmr/It_los_swtmr.c index 7ad82c51..f49d472c 100644 --- a/testsuites/kernel/sample/kernel_base/core/swtmr/It_los_swtmr.c +++ b/testsuites/kernel/sample/kernel_base/core/swtmr/It_los_swtmr.c @@ -53,7 +53,7 @@ VOID ItSuiteLosSwtmr(VOID) ItLosSwtmr053(); ItLosSwtmr058(); #endif -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP ItSmpLosSwtmr001(); /* Concurrent Multi-core */ ItSmpLosSwtmr002(); /* Stop Across Cores */ ItSmpLosSwtmr003(); diff --git a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_033.c b/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_033.c index 7aa9b526..40cf3c17 100644 --- a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_033.c +++ b/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_033.c @@ -87,7 +87,7 @@ static UINT32 Testcase(VOID) ret = LOS_HwiCreate(HWI_NUM_TEST, 1, 0, HwiF01, 0); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); #endif diff --git a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_039.c b/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_039.c index 954f9d1a..f349fdf7 100644 --- a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_039.c +++ b/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_039.c @@ -74,7 +74,7 @@ static UINT32 Testcase(VOID) hwiMode = 0; ret = TEST_HwiCreate(HWI_NUM_TEST, hwiPrio, hwiMode, (HWI_PROC_FUNC)SwtmrF01, (HwiIrqParam *)arg); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT3); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); #endif TestHwiTrigger(HWI_NUM_TEST); diff --git a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_040.c b/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_040.c index d42b666c..c9e0dc7d 100644 --- a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_040.c +++ b/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_040.c @@ -79,7 +79,7 @@ static UINT32 Testcase(VOID) hwiMode = 0; ret = TEST_HwiCreate(HWI_NUM_TEST, hwiPrio, hwiMode, (HWI_PROC_FUNC)HwiF01, (HwiIrqParam *)arg); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT3); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); #endif diff --git a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_041.c b/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_041.c index 34a6aa23..05e28865 100644 --- a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_041.c +++ b/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_041.c @@ -95,7 +95,7 @@ static UINT32 Testcase(VOID) ret = TEST_HwiCreate(HWI_NUM_TEST, hwiPrio, hwiMode, (HWI_PROC_FUNC)SwtmrF01, (HwiIrqParam *)arg); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT5); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); #endif diff --git a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_043.c b/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_043.c index 070da1c3..b0e37b0f 100644 --- a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_043.c +++ b/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_043.c @@ -76,7 +76,7 @@ static UINT32 Testcase(VOID) ret = LOS_HwiCreate(HWI_NUM_TEST, 1, 0, HwiF01, 0); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); #endif diff --git a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_064.c b/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_064.c index afcb99f4..543eab9c 100644 --- a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_064.c +++ b/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_064.c @@ -72,7 +72,7 @@ static UINT32 Testcase(VOID) hwiMode = 0; ret = TEST_HwiCreate(HWI_NUM_TEST, hwiPrio, hwiMode, (HWI_PROC_FUNC)HwiF01, (HwiIrqParam *)arg); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT3); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); #endif diff --git a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_065.c b/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_065.c index 190056f6..ddd739c2 100644 --- a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_065.c +++ b/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_065.c @@ -72,7 +72,7 @@ static UINT32 Testcase(VOID) hwiMode = 0; ret = TEST_HwiCreate(HWI_NUM_TEST, hwiPrio, hwiMode, (HWI_PROC_FUNC)HwiF01, (HwiIrqParam *)arg); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT3); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); #endif ret = LOS_SwtmrStart(g_swTmrID1); diff --git a/testsuites/kernel/sample/kernel_base/core/task/It_los_task.c b/testsuites/kernel/sample/kernel_base/core/task/It_los_task.c index 48f146bc..b200fc64 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/It_los_task.c +++ b/testsuites/kernel/sample/kernel_base/core/task/It_los_task.c @@ -62,7 +62,7 @@ void ItSuiteLosTask(void) ItLosTask105(); ItLosTask099(); ItLosTaskTimeslice001(); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP // reserved 20 for smoke test ItSmpLosTask001(); /* Task Affinity */ ItSmpLosTask002(); /* Task Deletion Across Cores */ @@ -137,7 +137,7 @@ void ItSuiteLosTask(void) ItLosTask072(); ItLosTask073(); ItLosTask074(); -#if (LOSCFG_KERNEL_SMP != YES) +#ifndef LOSCFG_KERNEL_SMP ItLosTask075(); #endif ItLosTask076(); @@ -193,7 +193,7 @@ void ItSuiteLosTask(void) ItLosTaskTimeslice002(); ItLosTaskTimeslice003(); ItLosTaskTimeslice004(); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP #ifndef LOSCFG_ARCH_FPU_DISABLE ItSmpLosFloatSwitch001(); @@ -290,7 +290,7 @@ void ItSuiteLosTask(void) ItSmpLosTask112(); ItSmpLosTask114(); ItSmpLosTask115(); -#if (LOSCFG_KERNEL_SMP_TASK_SYNC == NO) +#ifndef LOSCFG_KERNEL_SMP_TASK_SYNC ItSmpLosTask117(); #endif ItSmpLosTask126(); @@ -325,7 +325,7 @@ void ItSuiteLosTask(void) #endif #endif -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST, 1); HalIrqSetAffinity(HWI_NUM_TEST1, 1); HalIrqSetAffinity(HWI_NUM_TEST3, 1); diff --git a/testsuites/kernel/sample/kernel_base/core/task/It_los_task.h b/testsuites/kernel/sample/kernel_base/core/task/It_los_task.h index 9b0e9058..7f47bb5f 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/It_los_task.h +++ b/testsuites/kernel/sample/kernel_base/core/task/It_los_task.h @@ -51,7 +51,7 @@ extern "C" { #define SWTMR_LOOP_NUM 10 #define TEST_HWI_RUNTIME 0x100000 #define TASK_LOOP_NUM 0x100000 -#if (YES == LOSCFG_BASE_CORE_SWTMR) +#ifdef LOSCFG_BASE_CORE_SWTMR_ENABLE #define TASK_EXISTED_NUM 4 #else #define TASK_EXISTED_NUM 2 @@ -364,4 +364,4 @@ void ItLosTaskTimeslice004(void); #endif /* __cpluscplus */ #endif /* __cpluscplus */ -#endif \ No newline at end of file +#endif diff --git a/testsuites/kernel/sample/kernel_base/core/task/float/It_smp_los_float_switch_007.c b/testsuites/kernel/sample/kernel_base/core/task/float/It_smp_los_float_switch_007.c index 3aee9fb0..ce199698 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/float/It_smp_los_float_switch_007.c +++ b/testsuites/kernel/sample/kernel_base/core/task/float/It_smp_los_float_switch_007.c @@ -38,7 +38,7 @@ extern "C" { #endif /* __cpluscplus */ #ifndef LOSCFG_ARCH_FPU_DISABLE -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP static UINT32 g_targetCpuid; static void HwiF01(UINT32 arg) diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_008.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_008.c index 7bb9ec52..7302772f 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_008.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_008.c @@ -55,7 +55,7 @@ static UINT32 Testcase(void) task1.uwStackSize = TASK_STACK_SIZE_TEST; task1.pcName = "Tsk007A_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; task1.usTaskPrio = TASK_PRIO_TEST_TASK - 1; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_011.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_011.c index 0fc65c5c..3d985709 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_011.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_011.c @@ -61,7 +61,7 @@ static UINT32 Testcase(void) ret = LOS_TaskCreate(&g_testTaskID01, &task1); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP /* Wait TaskF01 to start */ while (g_testCount == 0) { } diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_016.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_016.c index 4d8d6dad..94549436 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_016.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_016.c @@ -88,7 +88,7 @@ static UINT32 Testcase(void) task1.uwResved = LOS_TASK_STATUS_DETACHED; // 0xffff, initializes the args. this parameter has no special meaning. task1.auwArgs[0] = 0xffff; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_017.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_017.c index bc91737a..8adb7c1d 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_017.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_017.c @@ -51,7 +51,7 @@ static UINT32 Testcase(void) task1.uwStackSize = TASK_STACK_SIZE_TEST; task1.pcName = "Tsk017A"; task1.usTaskPrio = 1; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_018.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_018.c index 26fa787f..7f22abba 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_018.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_018.c @@ -51,7 +51,7 @@ static UINT32 Testcase(void) task1.uwStackSize = TASK_STACK_SIZE_TEST; task1.pcName = "Tsk018A"; task1.usTaskPrio = OS_TASK_PRIORITY_LOWEST; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_025.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_025.c index 738d30cd..37a3619f 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_025.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_025.c @@ -56,7 +56,7 @@ static UINT32 Testcase(void) task1.uwStackSize = TASK_STACK_SIZE_TEST; task1.pcName = "Tsk025A"; task1.usTaskPrio = TASK_PRIO_TEST_TASK - 1; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_029.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_029.c index 1b913a63..87a18286 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_029.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_029.c @@ -67,7 +67,7 @@ static UINT32 Testcase(void) task1.uwStackSize = TASK_STACK_SIZE_TEST; task1.pcName = "Tsk029A"; task1.usTaskPrio = TASK_PRIO_TEST_TASK - 1; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_031.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_031.c index 1a444084..5065607e 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_031.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_031.c @@ -65,7 +65,7 @@ static UINT32 Testcase(void) task1.uwStackSize = TASK_STACK_SIZE_TEST; task1.pcName = "Tsk031A"; task1.usTaskPrio = TASK_PRIO_TEST_TASK - 1; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_033.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_033.c index 39712122..b4ba7424 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_033.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_033.c @@ -65,7 +65,7 @@ static UINT32 Testcase(void) task1.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; task1.pcName = "Tsk033A"; task1.usTaskPrio = TASK_PRIO_TEST_TASK - 1; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_038.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_038.c index d7965f31..6df1d299 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_038.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_038.c @@ -68,7 +68,7 @@ static UINT32 Testcase(void) task1.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task1.uwResved = LOS_TASK_STATUS_DETACHED; g_testCount = 0; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_039.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_039.c index 9ec8fb14..38fbdef6 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_039.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_039.c @@ -56,7 +56,7 @@ static UINT32 Testcase(void) task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; task1.uwStackSize = TASK_STACK_SIZE_TEST; task1.usTaskPrio = TASK_PRIO_TEST_TASK + 1; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_040.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_040.c index 005d3b83..9b7fcb23 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_040.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_040.c @@ -51,7 +51,7 @@ static UINT32 Testcase(void) TSK_INIT_PARAM_S task1 = { 0 }; task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; task1.uwStackSize = TASK_STACK_SIZE_TEST; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif LOS_TaskLock(); diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_041.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_041.c index 02f46c11..a5268b06 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_041.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_041.c @@ -60,7 +60,7 @@ static UINT32 Testcase(void) task1.pcName = "Tsk041A"; task1.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_042.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_042.c index 21e5fa0c..9ff64254 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_042.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_042.c @@ -63,7 +63,7 @@ static UINT32 Testcase(void) task1.pcName = "Tsk042A"; task1.uwStackSize = TASK_STACK_SIZE_TEST; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_043.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_043.c index 881b9689..3b9a6f16 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_043.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_043.c @@ -59,7 +59,7 @@ static UINT32 Testcase(void) task1.pcName = "Tsk043A"; task1.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_047.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_047.c index 00c35910..bb983c34 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_047.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_047.c @@ -69,7 +69,7 @@ static UINT32 Testcase(void) // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_050.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_050.c index 3352043d..b02ac19e 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_050.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_050.c @@ -54,7 +54,7 @@ static void TaskF01(void) task1.pcName = "Tsk050B"; task1.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif @@ -82,7 +82,7 @@ static UINT32 Testcase(void) // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_052.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_052.c index 9e8b5699..fe98cbf9 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_052.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_052.c @@ -55,7 +55,7 @@ static void TaskF01(void) // 3, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 3; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 0, g_testCount); @@ -80,7 +80,7 @@ static UINT32 Testcase(void) task1.pcName = "Tsk052A"; task1.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_053.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_053.c index 710cae51..a1c80e09 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_053.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_053.c @@ -57,7 +57,7 @@ static void TaskF01(void) ret = LOS_HwiCreate(HWI_NUM_TEST, 1, 0, HwiF01, 0); ICUNIT_ASSERT_EQUAL_VOID(ret, LOS_OK, ret); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); #endif @@ -78,7 +78,7 @@ static UINT32 Testcase(void) task1.pcName = "Tsk053A"; task1.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_054.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_054.c index 09a7c3c0..d746a77d 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_054.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_054.c @@ -67,7 +67,7 @@ static void TaskF01(void) task1.pcName = "Tsk054B"; task1.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount++; @@ -78,7 +78,7 @@ static void TaskF01(void) ret = LOS_HwiCreate(HWI_NUM_TEST, 1, 0, HwiF01, 0); ICUNIT_ASSERT_EQUAL_VOID(ret, LOS_OK, ret); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); #endif @@ -100,7 +100,7 @@ static UINT32 Testcase(void) // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_055.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_055.c index b4edf7d7..66b9dd72 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_055.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_055.c @@ -51,7 +51,7 @@ static void TaskF01(void) task1.pcName = "Tsk055B"; task1.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif @@ -80,7 +80,7 @@ static UINT32 Testcase(void) // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_056.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_056.c index 0f453580..ac7823f9 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_056.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_056.c @@ -59,7 +59,7 @@ static void TaskF01(void) task1.pcName = "Tsk056B"; task1.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif @@ -89,7 +89,7 @@ static UINT32 Testcase(void) // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_057.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_057.c index f38e21ca..7f1451e3 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_057.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_057.c @@ -76,7 +76,7 @@ static UINT32 Testcase(void) task1.pcName = "Tsk057A"; task1.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_058.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_058.c index f5684124..0137b11a 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_058.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_058.c @@ -95,7 +95,7 @@ static UINT32 Testcase(void) task1.pcName = "Tsk058A"; // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_060.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_060.c index 6673370b..2e0a188f 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_060.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_060.c @@ -78,7 +78,7 @@ static UINT32 Testcase(void) // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_061.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_061.c index 59a683a0..c0ed2a19 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_061.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_061.c @@ -60,7 +60,7 @@ static void TaskF02(void) ret = LOS_HwiCreate(HWI_NUM_TEST, 1, 0, HwiF01, 0); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); #endif @@ -101,7 +101,7 @@ static UINT32 Testcase(void) // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; @@ -116,7 +116,7 @@ static UINT32 Testcase(void) task1.pcName = "Tsk061B"; task1.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID02, &task1); diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_063.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_063.c index 922a2f99..9da5327e 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_063.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_063.c @@ -81,7 +81,7 @@ static UINT32 Testcase(void) // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif @@ -97,7 +97,7 @@ static UINT32 Testcase(void) task1.pcName = "Tsk063B"; task1.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID02, &task1); diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_064.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_064.c index 2571a845..b82cceeb 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_064.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_064.c @@ -60,7 +60,7 @@ static void TaskF02(void) ret = LOS_HwiCreate(HWI_NUM_TEST, 1, 0, HwiF01, 0); ICUNIT_ASSERT_EQUAL_VOID(ret, LOS_OK, ret); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); #endif @@ -84,7 +84,7 @@ static void TaskF01(void) task1.pcName = "Tsk064B"; task1.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount++; @@ -110,7 +110,7 @@ static UINT32 Testcase(void) // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_065.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_065.c index ed904307..92623f6a 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_065.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_065.c @@ -54,7 +54,7 @@ static void TaskF01(void) task1.pcName = "Tsk065B"; task1.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 0, g_testCount); @@ -79,7 +79,7 @@ static UINT32 Testcase(void) // 3, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 3; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_066.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_066.c index b5509d4d..b85ecf61 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_066.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_066.c @@ -63,7 +63,7 @@ static void TaskF01(void) // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 0, g_testCount); @@ -76,7 +76,7 @@ static void TaskF01(void) task1.pcName = "Tsk066C"; task1.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID03, &task1); @@ -98,7 +98,7 @@ static UINT32 Testcase(void) // 3, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 3; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_067.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_067.c index 5d1a7f05..d7b9cf90 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_067.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_067.c @@ -60,7 +60,7 @@ static void TaskF01(void) // 3, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 3; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 0, g_testCount); @@ -90,7 +90,7 @@ static UINT32 Testcase(void) task1.pcName = "Tsk067A"; task1.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_068.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_068.c index 93a1149f..92f726aa 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_068.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_068.c @@ -59,7 +59,7 @@ static void TaskF01(void) task1.pcName = "Tsk068B"; task1.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 0, g_testCount); @@ -85,7 +85,7 @@ static UINT32 Testcase(void) // 3, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 3; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_069.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_069.c index fd08e7ff..d3668b0f 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_069.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_069.c @@ -56,7 +56,7 @@ static void TaskF01(void) task1.pcName = "Tsk069B"; task1.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 0, g_testCount); @@ -86,7 +86,7 @@ static UINT32 Testcase(void) // 3, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 3; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_071.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_071.c index 5d043d0e..963df73a 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_071.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_071.c @@ -54,7 +54,7 @@ static UINT32 Testcase(void) task1.pcName = "Tsk071A"; task1.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_072.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_072.c index ae27bf8b..3a72268f 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_072.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_072.c @@ -54,7 +54,7 @@ static UINT32 Testcase(void) task1.pcName = "Tsk072A"; task1.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_073.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_073.c index 7e0cb5dd..dee78432 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_073.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_073.c @@ -94,7 +94,7 @@ static UINT32 Testcase(void) // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_074.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_074.c index e8a003d4..44a86715 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_074.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_074.c @@ -63,7 +63,7 @@ static UINT32 Testcase(void) task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.pcName = "Tsk074A"; task1.uwStackSize = TASK_STACK_SIZE_TEST; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_075.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_075.c index 9d9a81ba..2ba3c829 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_075.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_075.c @@ -99,7 +99,7 @@ static UINT32 Testcase(void) // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; @@ -117,7 +117,7 @@ static UINT32 Testcase(void) task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF02; task1.pcName = "Tsk075B"; task1.usTaskPrio = TASK_PRIO_TEST_TASK - 1; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID02, &task1); diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_076.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_076.c index 2074443e..bc193435 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_076.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_076.c @@ -77,7 +77,7 @@ static UINT32 Testcase(void) // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_077.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_077.c index 0c0dc6ea..5189bb24 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_077.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_077.c @@ -79,7 +79,7 @@ static UINT32 Testcase(void) // 3, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 3; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_078.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_078.c index 1c02aa73..22a88563 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_078.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_078.c @@ -66,7 +66,7 @@ static UINT32 Testcase(void) task1.pcName = "Tsk078A"; // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_079.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_079.c index 885f2c15..41d12880 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_079.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_079.c @@ -65,7 +65,7 @@ static UINT32 Testcase(void) // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_080.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_080.c index b2209d73..43e792c0 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_080.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_080.c @@ -65,7 +65,7 @@ static UINT32 Testcase(void) ret = LOS_HwiCreate(HWI_NUM_TEST, hwiPrio, mode, (HWI_PROC_FUNC)HwiF01, (HwiIrqParam *)arg); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); #endif diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_082.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_082.c index f270941a..ac9b3a88 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_082.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_082.c @@ -77,7 +77,7 @@ static UINT32 Testcase(void) LOS_EventWrite(&g_eventCb01, 0x1); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ICUNIT_ASSERT_EQUAL(g_testCount, 2, g_testCount); // 2, assert that g_testCount is equal to this. diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_090.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_090.c index 3154d945..3a8c9803 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_090.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_090.c @@ -70,7 +70,7 @@ static UINT32 Testcase(void) task1.pcName = "Tsk090A"; task1.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_093.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_093.c index 6bcfc350..7cd2591a 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_093.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_093.c @@ -69,7 +69,7 @@ static UINT32 Testcase(void) task1.pcName = "Tsk093A"; // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_094.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_094.c index c3712a2b..f3269e4f 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_094.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_094.c @@ -82,7 +82,7 @@ static UINT32 Testcase(void) // 0xffff, initializes the args. this parameter has no special meaning. task1.auwArgs[0] = 0xffff; task1.processID = LOS_GetCurrProcessID(); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; @@ -104,7 +104,7 @@ static UINT32 Testcase(void) // 3, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 3; task1.processID = LOS_GetCurrProcessID(); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif task1.processID = LOS_GetCurrProcessID(); @@ -129,7 +129,7 @@ static UINT32 Testcase(void) // 4, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 4; task1.processID = LOS_GetCurrProcessID(); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif task1.processID = LOS_GetCurrProcessID(); diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_095.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_095.c index ffde8962..41ee35b1 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_095.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_095.c @@ -54,7 +54,7 @@ static UINT32 Testcase(void) task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; task1.processID = LOS_GetCurrProcessID(); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif task1.processID = LOS_GetCurrProcessID(); diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_096.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_096.c index 09be0708..57b5c8a0 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_096.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_096.c @@ -56,7 +56,7 @@ static void TaskF01(void) // 3, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 3; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID02, &task1); @@ -81,7 +81,7 @@ static UINT32 Testcase(void) task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = 0; task1.processID = LOS_GetCurrProcessID(); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif task1.processID = LOS_GetCurrProcessID(); diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_098.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_098.c index 0be50c2c..e8ef4d8f 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_098.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_098.c @@ -54,7 +54,7 @@ static void TaskF01(void) task1.usTaskPrio = TASK_PRIO_TEST_TASK - 3; task1.uwResved = LOS_TASK_STATUS_DETACHED; task1.processID = LOS_GetCurrProcessID(); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif task1.processID = LOS_GetCurrProcessID(); @@ -87,7 +87,7 @@ static UINT32 Testcase(void) task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; task1.processID = LOS_GetCurrProcessID(); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif task1.processID = LOS_GetCurrProcessID(); diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_100.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_100.c index 6cbc00f2..da22e5b4 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_100.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_100.c @@ -60,7 +60,7 @@ static UINT32 Testcase(void) task1.pcName = "Tsk100A"; task1.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_102.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_102.c index b6669305..e395c577 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_102.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_102.c @@ -59,7 +59,7 @@ static void TaskF01(void) ret = LOS_HwiCreate(HWI_NUM_TEST, 1, 0, HwiF01, 0); ICUNIT_ASSERT_EQUAL_VOID(ret, LOS_OK, ret); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); #endif @@ -80,7 +80,7 @@ static UINT32 Testcase(void) task1.pcName = "Tsk102A"; task1.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_103.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_103.c index 46ac159b..ef91eb9d 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_103.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_103.c @@ -59,7 +59,7 @@ static void TaskF01(void) task1.pcName = "Tsk103B"; task1.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif @@ -95,7 +95,7 @@ static UINT32 Testcase(void) // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_104.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_104.c index 3d5b1923..844f38f6 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_104.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_104.c @@ -68,7 +68,7 @@ static void TaskF01(void) // 3, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 3; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID02, &task1); @@ -98,7 +98,7 @@ static UINT32 Testcase(void) // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_106.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_106.c index ad166138..e3b067d2 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_106.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_106.c @@ -74,7 +74,7 @@ static void TaskF01(void) ret = LOS_HwiCreate(HWI_NUM_TEST, 1, 0, HwiF01, 0); ICUNIT_ASSERT_EQUAL_VOID(ret, LOS_OK, ret); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); #endif @@ -96,7 +96,7 @@ static UINT32 Testcase(void) task1.pcName = "Tsk106A"; task1.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_107.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_107.c index 6674235d..3b8430bd 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_107.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_107.c @@ -68,7 +68,7 @@ static void TaskF01(void) // 3, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 3; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID02, &task1); @@ -99,7 +99,7 @@ static UINT32 Testcase(void) // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_108.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_108.c index 72c0b976..afefcb22 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_108.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_108.c @@ -67,7 +67,7 @@ static void TaskF01(void) // 3, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 3; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ICUNIT_GOTO_EQUAL(g_testCount, 0, g_testCount, EXIT); @@ -102,7 +102,7 @@ static UINT32 Testcase(void) // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_109.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_109.c index 627369e7..981af5ce 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_109.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_109.c @@ -67,7 +67,7 @@ static void TaskF01(void) // 3, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 3; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID02, &task1); @@ -98,7 +98,7 @@ static UINT32 Testcase(void) // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_110.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_110.c index bdf1791f..117485d8 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_110.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_110.c @@ -68,7 +68,7 @@ static void TaskF01(void) // 3, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 3; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ICUNIT_GOTO_EQUAL(g_testCount, 0, g_testCount, EXIT); @@ -104,7 +104,7 @@ static UINT32 Testcase(void) // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_111.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_111.c index 5fd53d2c..9036dc02 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_111.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_111.c @@ -67,7 +67,7 @@ static void TaskF01(void) task1.pcName = "Tsk111B"; task1.usTaskPrio = TASK_PRIO_TEST_TASK - 3; // 3, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID02, &task1); @@ -99,7 +99,7 @@ static UINT32 Testcase(void) // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_112.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_112.c index 62d01f3f..09d6fc9d 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_112.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_112.c @@ -67,7 +67,7 @@ static void TaskF01(void) // 4, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 4; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID02, &task1); @@ -105,7 +105,7 @@ static UINT32 Testcase(void) // 3, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 3; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_113.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_113.c index bfc87872..70d96b3a 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_113.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_113.c @@ -67,7 +67,7 @@ static void TaskF01(void) task1.pcName = "Tsk113B"; task1.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ICUNIT_GOTO_EQUAL(g_testCount, 0, g_testCount, EXIT); @@ -107,7 +107,7 @@ static UINT32 Testcase(void) // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_114.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_114.c index 2eb472f2..414a279c 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_114.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_114.c @@ -61,7 +61,7 @@ static void TaskF01(void) ret = LOS_HwiCreate(HWI_NUM_TEST, hwiPrio, mode, (HWI_PROC_FUNC)HwiF01, (HwiIrqParam *)arg); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT1); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); #endif @@ -90,7 +90,7 @@ static UINT32 Testcase(void) // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_115.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_115.c index 2677f918..5cfd8fb8 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_115.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_115.c @@ -74,7 +74,7 @@ static void TaskF01(void) // 4, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 4; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID02, &task1); @@ -112,7 +112,7 @@ static UINT32 Testcase(void) // 3, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 3; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_116.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_116.c index b1e2806c..7b5fdd2d 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_116.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_116.c @@ -97,7 +97,7 @@ static UINT32 Testcase(void) // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_118.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_118.c index 85531ef9..7054a2fd 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_118.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_118.c @@ -85,7 +85,7 @@ static void TaskF01(void) ret = LOS_HwiCreate(HWI_NUM_TEST, hwiPrio, mode, (HWI_PROC_FUNC)HwiF01, arg); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); #endif @@ -136,7 +136,7 @@ static UINT32 Testcase(void) // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID01, &task1); @@ -149,7 +149,7 @@ static UINT32 Testcase(void) // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID02, &task1); diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_119.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_119.c index 467c8d39..908e332e 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_119.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_119.c @@ -56,7 +56,7 @@ static UINT32 Testcase(void) task1.pcName = "Task_119"; // 32, Set the priority according to the task purpose task1.usTaskPrio = 32; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_120.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_120.c index d1f4a1e4..03b989f1 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_120.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_120.c @@ -61,7 +61,7 @@ static UINT32 Testcase(void) // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_121.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_121.c index 0e8aef7f..1d569e65 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_121.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_121.c @@ -56,7 +56,7 @@ static UINT32 Testcase(void) task1.pcName = "Task_121"; // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID01, &task1); diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_122.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_122.c index 94d36286..e3ccd8b1 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_122.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_122.c @@ -55,7 +55,7 @@ static void TaskF01(void) task1.pcName = "Task_122_1"; task1.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID02, &task1); @@ -91,7 +91,7 @@ static UINT32 Testcase(void) // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_123.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_123.c index f2636d2c..b7346365 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_123.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_123.c @@ -54,7 +54,7 @@ static void TaskF01(void) task1.pcName = "Task_123_1"; task1.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID02, &task1); @@ -86,7 +86,7 @@ static UINT32 Testcase(void) // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_124.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_124.c index d51caa7c..79244497 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_124.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_124.c @@ -58,7 +58,7 @@ static void TaskF01(void) // 3, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 3; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID02, &task1); @@ -90,7 +90,7 @@ static UINT32 Testcase(void) // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_125.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_125.c index 24b56ca1..28d09aad 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_125.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_125.c @@ -62,7 +62,7 @@ static void TaskF01(void) ret = LOS_HwiCreate(HWI_NUM_TEST, 1, 0, (HWI_PROC_FUNC)HwiF01, 0); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); #endif @@ -88,7 +88,7 @@ static UINT32 Testcase(void) // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_126.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_126.c index 030ac91e..46d46126 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_126.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_126.c @@ -76,7 +76,7 @@ static void TaskF01(void) task1.pcName = "Task_126_1"; task1.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID02, &task1); @@ -85,7 +85,7 @@ static void TaskF01(void) ret = LOS_HwiCreate(HWI_NUM_TEST, 1, 0, (HWI_PROC_FUNC)HwiF01, 0); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT1); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); #endif @@ -120,7 +120,7 @@ static UINT32 Testcase(void) // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_127.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_127.c index c9ed5a99..e3ea0943 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_127.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_127.c @@ -51,7 +51,7 @@ static void TaskF01(void) task1.pcName = "Task_127_1"; task1.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID02, &task1); @@ -77,7 +77,7 @@ static UINT32 Testcase(void) // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_128.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_128.c index 04614748..ff52a0b3 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_128.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_128.c @@ -63,7 +63,7 @@ static void TaskF01(void) task1.pcName = "Task_128_1"; task1.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID02, &task1); @@ -92,7 +92,7 @@ static UINT32 Testcase(void) // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_129.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_129.c index c80a883e..051c06b4 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_129.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_129.c @@ -52,7 +52,7 @@ static void HwiF01(void) // 3, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 3; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif TEST_HwiClear(HWI_NUM_TEST); @@ -79,7 +79,7 @@ static UINT32 Testcase(void) ret = LOS_HwiCreate(HWI_NUM_TEST, 1, 0, (HWI_PROC_FUNC)HwiF01, 0); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); #endif diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_130.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_130.c index 1af58128..ab3e7bd3 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_130.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_130.c @@ -95,7 +95,7 @@ static UINT32 Testcase(void) // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; @@ -110,7 +110,7 @@ static UINT32 Testcase(void) task1.pcName = "Task_130_1"; task1.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID02, &task1); diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_131.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_131.c index 136011b1..7bc428d0 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_131.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_131.c @@ -68,7 +68,7 @@ static void TaskF02(void) ret = LOS_HwiCreate(HWI_NUM_TEST, 1, 0, (HWI_PROC_FUNC)HwiF01, 0); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT1); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); #endif @@ -130,7 +130,7 @@ static UINT32 Testcase(void) // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; @@ -145,7 +145,7 @@ static UINT32 Testcase(void) task1.pcName = "Task_131_1"; task1.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID02, &task1); diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_133.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_133.c index a607f4f8..9385e15a 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_133.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_133.c @@ -58,7 +58,7 @@ static UINT32 Testcase(void) // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID01, &task1); diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_134.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_134.c index ceb015fc..ac30ed74 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_134.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_134.c @@ -56,7 +56,7 @@ static UINT32 Testcase(void) // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK + 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID01, &task1); diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_135.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_135.c index 03f5ba0c..f95914f3 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_135.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_135.c @@ -60,7 +60,7 @@ static UINT32 Testcase(void) task1.pcName = "Tsk138A"; task1.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID01, &task1); diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_136.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_136.c index 78e86856..5a142e34 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_136.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_136.c @@ -73,7 +73,7 @@ static UINT32 Testcase(void) // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif task2.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF02; @@ -81,7 +81,7 @@ static UINT32 Testcase(void) task2.pcName = "Task_136_2"; task2.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task2.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task2.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif for (i = 0; i < IT_TASK_SMP_LOOP; i++) { diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_138.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_138.c index 74aa61fb..e3410976 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_138.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_138.c @@ -85,7 +85,7 @@ static void TaskF01(void) ret = LOS_HwiCreate(HWI_NUM_TEST, hwiPrio, mode, (HWI_PROC_FUNC)HwiF01, (HwiIrqParam *)arg); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); #endif @@ -136,7 +136,7 @@ static UINT32 Testcase(void) // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID01, &task1); @@ -149,7 +149,7 @@ static UINT32 Testcase(void) // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID02, &task1); diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_141.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_141.c index 8e56235a..a41d892a 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_141.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_141.c @@ -83,7 +83,7 @@ static UINT32 Testcase(void) task1.uwStackSize = TASK_STACK_SIZE_TEST; task1.pcName = "TskTstA"; task1.usTaskPrio = TASK_PRIO_TEST_TASK + 1; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_142.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_142.c index daeb6075..0f3f260c 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_142.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_142.c @@ -73,7 +73,7 @@ static UINT32 Testcase(void) ret = LOS_HwiCreate(HWI_NUM_TEST3, hwiPrio, mode, (HWI_PROC_FUNC)ItHwi, arg); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST3, ArchCurrCpuid() + 1); // curret cpu #endif float d1 = 100.0f; diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_timeslice_002.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_timeslice_002.c index 9b5b56ef..d055f0cd 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_timeslice_002.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_timeslice_002.c @@ -84,7 +84,7 @@ static UINT32 Testcase(void) task.uwStackSize = TASK_STACK_SIZE_TEST * 2; task.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif @@ -96,7 +96,7 @@ static UINT32 Testcase(void) task.uwStackSize = TASK_STACK_SIZE_TEST; task.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_timeslice_003.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_timeslice_003.c index c8de1cc6..c62a362f 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_timeslice_003.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_timeslice_003.c @@ -126,7 +126,7 @@ static UINT32 Testcase(void) task.uwStackSize = TASK_STACK_SIZE_TEST * 2; task.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif @@ -139,7 +139,7 @@ static UINT32 Testcase(void) task.uwStackSize = TASK_STACK_SIZE_TEST * 2; task.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif @@ -151,7 +151,7 @@ static UINT32 Testcase(void) task.uwStackSize = TASK_STACK_SIZE_TEST; task.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif diff --git a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_timeslice_004.c b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_timeslice_004.c index c96e453a..d59e9882 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_timeslice_004.c +++ b/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_timeslice_004.c @@ -131,7 +131,7 @@ static UINT32 Testcase(void) task.uwStackSize = TASK_STACK_SIZE_TEST * 3; task.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif @@ -143,7 +143,7 @@ static UINT32 Testcase(void) task.uwStackSize = TASK_STACK_SIZE_TEST; task.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif diff --git a/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_049.c b/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_049.c index b3e8d03a..3742a238 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_049.c +++ b/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_049.c @@ -83,7 +83,7 @@ static UINT32 Testcase(void) // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif diff --git a/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_081.c b/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_081.c index 359c9aee..d37870f7 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_081.c +++ b/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_081.c @@ -105,7 +105,7 @@ static UINT32 Testcase(void) task1.pcName = "Tsk081A"; // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_097.c b/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_097.c index 5b67c366..dee48ee6 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_097.c +++ b/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_097.c @@ -57,7 +57,7 @@ static void TaskF01(void) task1.usTaskPrio = TASK_PRIO_TEST_TASK - 3; task1.uwResved = 0; task1.processID = LOS_GetCurrProcessID(); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif task1.processID = LOS_GetCurrProcessID(); @@ -87,7 +87,7 @@ static UINT32 Testcase(void) // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif task1.processID = -1; diff --git a/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_099.c b/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_099.c index 5b884572..79459cf6 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_099.c +++ b/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_099.c @@ -55,7 +55,7 @@ static UINT32 Testcase(void) // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.processID = LOS_GetCurrProcessID(); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif task1.processID = LOS_GetCurrProcessID(); diff --git a/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_101.c b/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_101.c index c84a6869..d16703f0 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_101.c +++ b/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_101.c @@ -60,7 +60,7 @@ static UINT32 Testcase(void) task1.pcName = "Tsk101A"; task1.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_105.c b/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_105.c index e186f8ed..55932c80 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_105.c +++ b/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_105.c @@ -63,7 +63,7 @@ static UINT32 Testcase(void) task1.pcName = "Tsk105A"; task1.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_timeslice_001.c b/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_timeslice_001.c index 93515685..bc5ad154 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_timeslice_001.c +++ b/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_timeslice_001.c @@ -75,7 +75,7 @@ static UINT32 Testcase(void) task.uwStackSize = TASK_STACK_SIZE_TEST * 2; task.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif @@ -87,7 +87,7 @@ static UINT32 Testcase(void) task.uwStackSize = TASK_STACK_SIZE_TEST; task.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif diff --git a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_002.c b/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_002.c index ad1ee4a4..0958e7bc 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_002.c +++ b/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_002.c @@ -62,7 +62,7 @@ static UINT32 Testcase(void) LOS_TaskDelay(2); // 2, set delay time. ret = LOS_TaskDelete(testid); -#if (LOSCFG_KERNEL_SMP_TASK_SYNC == NO) +#ifndef LOSCFG_KERNEL_SMP_TASK_SYNC /* delay and check */ LOS_TaskDelay(10); // 10, set delay time. #endif diff --git a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_024.c b/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_024.c index a35fcfc9..d1b38e31 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_024.c +++ b/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_024.c @@ -76,7 +76,7 @@ static UINT32 Testcase(void) g_itTestResult = LOS_OK; LOS_TaskLock(); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP currCpuid = (ArchCurrCpuid() + 1) % LOSCFG_KERNEL_CORE_NUM; #endif diff --git a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_025.c b/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_025.c index b0c7cd42..33270a17 100644 --- a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_025.c +++ b/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_025.c @@ -95,7 +95,7 @@ static UINT32 Testcase(void) g_itTestResult = LOS_NOK; LOS_TaskLock(); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP currCpuid = (ArchCurrCpuid() + 1) % LOSCFG_KERNEL_CORE_NUM; #endif diff --git a/testsuites/kernel/sample/kernel_base/ipc/event/It_los_event.c b/testsuites/kernel/sample/kernel_base/ipc/event/It_los_event.c index ee305b7f..949e547f 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/event/It_los_event.c +++ b/testsuites/kernel/sample/kernel_base/ipc/event/It_los_event.c @@ -39,7 +39,7 @@ extern "C" { VOID ItSuiteLosEvent(VOID) { -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP ItSmpLosEvent001(); ItSmpLosEvent002(); ItSmpLosEvent003(); @@ -107,7 +107,7 @@ VOID ItSuiteLosEvent(VOID) ItLosEvent023(); ItLosEvent024(); ItLosEvent025(); -#if (LOSCFG_KERNEL_SMP != YES) +#ifndef LOSCFG_KERNEL_SMP ItLosEvent026(); #endif ItLosEvent027(); @@ -117,7 +117,7 @@ VOID ItSuiteLosEvent(VOID) ItLosEvent033(); // / ItLosEvent037(); ItLosEvent038(); -#if (LOSCFG_KERNEL_SMP != YES) +#ifndef LOSCFG_KERNEL_SMP ItLosEvent039(); #endif ItLosEvent040(); @@ -134,7 +134,7 @@ VOID ItSuiteLosEvent(VOID) ItLosEvent017(); ItLosEvent034(); #endif -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST, 1); #endif } diff --git a/testsuites/kernel/sample/kernel_base/ipc/event/It_los_event.h b/testsuites/kernel/sample/kernel_base/ipc/event/It_los_event.h index 61451f0c..26dad0f9 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/event/It_los_event.h +++ b/testsuites/kernel/sample/kernel_base/ipc/event/It_los_event.h @@ -151,7 +151,7 @@ extern VOID ItLosEvent017(VOID); extern VOID ItLosEvent034(VOID); #endif -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP VOID ItSmpLosEvent001(VOID); VOID ItSmpLosEvent002(VOID); VOID ItSmpLosEvent003(VOID); diff --git a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_018.c b/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_018.c index cb6b34b0..9f43e7cb 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_018.c +++ b/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_018.c @@ -46,7 +46,7 @@ static VOID TaskF02(VOID) ret = LOS_EventWrite(&g_event, 0x10); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); -#if (LOSCFG_KERNEL_SMP != YES) +#ifndef LOSCFG_KERNEL_SMP ICUNIT_GOTO_EQUAL(g_testCount, 4, g_testCount, EXIT); // 4, Here, assert that g_testCount is equal to 4. #endif g_testCount++; diff --git a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_023.c b/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_023.c index f08a1c6f..24ffccee 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_023.c +++ b/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_023.c @@ -61,7 +61,7 @@ static VOID TaskF01(VOID) ICUNIT_GOTO_EQUAL(ret, g_event.uwEventID, ret, EXIT); ICUNIT_ASSERT_EQUAL_VOID(ret, 0x11, ret); -#if (LOSCFG_KERNEL_SMP != YES) +#ifndef LOSCFG_KERNEL_SMP ICUNIT_GOTO_EQUAL(g_testCount, 5, g_testCount, EXIT); // 5, Here, assert that g_testCount is equal to 5. #endif g_testCount++; @@ -80,7 +80,7 @@ static VOID TaskF02(VOID) ICUNIT_GOTO_EQUAL(ret, g_event.uwEventID, ret, EXIT); ICUNIT_ASSERT_EQUAL_VOID(ret, 0x11, ret); -#if (LOSCFG_KERNEL_SMP != YES) +#ifndef LOSCFG_KERNEL_SMP ICUNIT_GOTO_EQUAL(g_testCount, 6, g_testCount, EXIT); // 6, Here, assert that g_testCount is equal to 6. #endif g_testCount++; @@ -121,7 +121,7 @@ static UINT32 Testcase(VOID) ret = LOS_HwiCreate(HWI_NUM_TEST, 0, 0, HwiF01, 0); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); #endif diff --git a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_024.c b/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_024.c index 988a6d1b..32d754be 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_024.c +++ b/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_024.c @@ -58,7 +58,7 @@ static UINT32 Testcase(VOID) ret = LOS_HwiCreate(HWI_NUM_TEST, 1, 0, HwiF01, 0); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); #endif diff --git a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_026.c b/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_026.c index 73069046..fc30d6a2 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_026.c +++ b/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_026.c @@ -73,7 +73,7 @@ static UINT32 Testcase(VOID) task1.uwStackSize = TASK_STACK_SIZE_TEST; task1.usTaskPrio = TASK_PRIO_TEST - 2; // 2, set new task priority, it is higher than the current task. task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_038.c b/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_038.c index 6a523f9f..ff269c61 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_038.c +++ b/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_038.c @@ -116,7 +116,7 @@ static UINT32 Testcase(VOID) task1.uwStackSize = TASK_STACK_SIZE_TEST; task1.usTaskPrio = TASK_PRIO_TEST - 2; // 2, set new task priority, it is higher than the current task. task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif @@ -128,7 +128,7 @@ static UINT32 Testcase(VOID) task1.uwStackSize = TASK_STACK_SIZE_TEST; task1.usTaskPrio = TASK_PRIO_TEST - 1; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif @@ -139,7 +139,7 @@ static UINT32 Testcase(VOID) ret = LOS_HwiCreate(HWI_NUM_TEST, 0, 0, HwiF01, 0); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT1); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); #endif diff --git a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_039.c b/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_039.c index 4afc4dcf..7ded8636 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_039.c +++ b/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_039.c @@ -65,7 +65,7 @@ static UINT32 Testcase(VOID) task1.uwStackSize = TASK_STACK_SIZE_TEST; task1.usTaskPrio = TASK_PRIO_TEST - 2; // 2, set new task priority, it is higher than the current task. task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/ipc/event/smoke/It_los_event_036.c b/testsuites/kernel/sample/kernel_base/ipc/event/smoke/It_los_event_036.c index a5edd54a..7428ff16 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/event/smoke/It_los_event_036.c +++ b/testsuites/kernel/sample/kernel_base/ipc/event/smoke/It_los_event_036.c @@ -66,7 +66,7 @@ static UINT32 Testcase(VOID) task1.uwStackSize = TASK_STACK_SIZE_TEST; task1.usTaskPrio = TASK_PRIO_TEST - 2; // 2, set new task priority, it is higher than the current task. task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_032.c b/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_032.c index ef39eb66..9c56de16 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_032.c +++ b/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_032.c @@ -37,7 +37,7 @@ extern "C" { #endif /* __cpluscplus */ #endif /* __cpluscplus */ -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP static UINT32 g_ret1, g_ret2, g_ret3; static UINT32 g_szId[3] = {0}; diff --git a/testsuites/kernel/sample/kernel_base/ipc/mux/It_los_mux.c b/testsuites/kernel/sample/kernel_base/ipc/mux/It_los_mux.c index c68b18f3..b0cb2a26 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/mux/It_los_mux.c +++ b/testsuites/kernel/sample/kernel_base/ipc/mux/It_los_mux.c @@ -107,7 +107,7 @@ VOID ItSuiteLosMux(void) ItLosMux043(); #endif -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP ItSmpLosMux001(); ItSmpLosMux002(); ItSmpLosMux003(); @@ -143,7 +143,7 @@ VOID ItSuiteLosMux(void) ItSmpLosMux2029(); #endif -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST, 1); HalIrqSetAffinity(HWI_NUM_TEST1, 1); #endif diff --git a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_013.c b/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_013.c index 76e1167e..d7b003b0 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_013.c +++ b/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_013.c @@ -72,11 +72,11 @@ static UINT32 Testcase(VOID) ret = LOS_HwiCreate(HWI_NUM_TEST, 0, 0, (HWI_PROC_FUNC)HwiF01, 0); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); #endif TestHwiTrigger(HWI_NUM_TEST); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP TestBusyTaskDelay(5); // 5, delay for Timing control. #endif ICUNIT_ASSERT_EQUAL(g_testCount, 1, g_testCount); diff --git a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_016.c b/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_016.c index 3db8a392..cd2ab6e1 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_016.c +++ b/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_016.c @@ -65,12 +65,12 @@ static UINT32 Testcase(VOID) ret = LOS_HwiCreate(HWI_NUM_TEST, 0, 0, (HWI_PROC_FUNC)HwiF01, 0); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); #endif TestHwiTrigger(HWI_NUM_TEST); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP TestBusyTaskDelay(10); // 10, delay for Timing control. #endif diff --git a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_017.c b/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_017.c index 27ad8361..c98ff4e9 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_017.c +++ b/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_017.c @@ -64,7 +64,7 @@ static UINT32 Testcase(VOID) ret = LOS_HwiCreate(HWI_NUM_TEST, 0, 0, (HWI_PROC_FUNC)HwiF01, 0); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); #endif TestHwiTrigger(HWI_NUM_TEST); diff --git a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_020.c b/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_020.c index 97230ac6..4da64155 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_020.c +++ b/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_020.c @@ -78,7 +78,7 @@ static UINT32 Testcase(VOID) ret = LOS_HwiCreate(HWI_NUM_TEST0, 0, 0, (HWI_PROC_FUNC)HwiF02, 0); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); HalIrqSetAffinity(HWI_NUM_TEST0, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); #endif diff --git a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_021.c b/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_021.c index 0c7873c1..b91b06af 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_021.c +++ b/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_021.c @@ -69,7 +69,7 @@ VOID TaskF02(void) task1.uwStackSize = TASK_STACK_SIZE_TEST; task1.usTaskPrio = TASK_PRIO_TEST - 3; // 3, set reasonable priority. task1.uwResved = 0; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID02, &task1); @@ -101,7 +101,7 @@ static UINT32 Testcase(VOID) task.pcName = "LosMB2_1"; task.uwStackSize = 0x900; task.uwResved = 0; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID01, &task); diff --git a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_026.c b/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_026.c index 5220c6fc..edb52dfe 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_026.c +++ b/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_026.c @@ -117,7 +117,7 @@ static VOID TaskAFunc(VOID) task1.pcName = "TaskB"; task1.uwStackSize = TASK_STACK_SIZE_TEST; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID02, &task1); @@ -135,7 +135,7 @@ static VOID TaskAFunc(VOID) task2.pcName = "TaskC"; task2.uwStackSize = TASK_STACK_SIZE_TEST; task2.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task2.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID03, &task2); @@ -152,7 +152,7 @@ static VOID TaskAFunc(VOID) task3.pcName = "TaskD"; task3.uwStackSize = TASK_STACK_SIZE_TEST; task3.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task3.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID04, &task3); @@ -210,7 +210,7 @@ static UINT32 Testcase(VOID) task.pcName = "TaskA"; task.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; task.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID01, &task); diff --git a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_027.c b/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_027.c index bf957e9a..01db9295 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_027.c +++ b/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_027.c @@ -111,7 +111,7 @@ static VOID TaskA1Func(VOID) task1.pcName = "TaskB"; task1.uwStackSize = TASK_STACK_SIZE_TEST; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID02, &task1); @@ -122,7 +122,7 @@ static VOID TaskA1Func(VOID) task2.pcName = "TaskC"; task2.uwStackSize = TASK_STACK_SIZE_TEST; task2.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task2.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID03, &task2); @@ -133,7 +133,7 @@ static VOID TaskA1Func(VOID) task3.pcName = "TaskD"; task3.uwStackSize = TASK_STACK_SIZE_TEST; task3.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task3.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID04, &task3); @@ -168,7 +168,7 @@ static UINT32 Testcase(void) task.pcName = "TaskA"; task.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; task.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID01, &task); diff --git a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_028.c b/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_028.c index de9234b4..6e367d5a 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_028.c +++ b/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_028.c @@ -103,7 +103,7 @@ static VOID TaskA2Func(VOID) task1.pcName = "TaskB"; task1.uwStackSize = TASK_STACK_SIZE_TEST; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID02, &task1); @@ -115,7 +115,7 @@ static VOID TaskA2Func(VOID) task2.pcName = "TaskC"; task2.uwStackSize = TASK_STACK_SIZE_TEST; task2.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task2.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID03, &task2); @@ -127,7 +127,7 @@ static VOID TaskA2Func(VOID) task3.pcName = "TaskD"; task3.uwStackSize = TASK_STACK_SIZE_TEST; task3.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task3.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID04, &task3); @@ -164,7 +164,7 @@ static UINT32 Testcase(VOID) task.pcName = "TaskA"; task.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; task.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID01, &task); diff --git a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_029.c b/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_029.c index cdb90189..a46e0e36 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_029.c +++ b/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_029.c @@ -75,7 +75,7 @@ static VOID TaskC3Func(VOID) task1.pcName = "TaskD"; task1.uwStackSize = TASK_STACK_SIZE_TEST; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID04, &task1); @@ -130,7 +130,7 @@ static VOID TaskA3Func(VOID) task1.pcName = "TaskB"; task1.uwStackSize = TASK_STACK_SIZE_TEST; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID02, &task1); @@ -141,7 +141,7 @@ static VOID TaskA3Func(VOID) task2.pcName = "TaskC"; task2.uwStackSize = TASK_STACK_SIZE_TEST; task2.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task2.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID03, &task2); @@ -178,7 +178,7 @@ static UINT32 Testcase(VOID) task.pcName = "TaskA"; task.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; task.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID01, &task); diff --git a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_031.c b/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_031.c index f0afad92..dde87d11 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_031.c +++ b/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_031.c @@ -119,7 +119,7 @@ static VOID TaskA5Func(VOID) task1.pcName = "TaskB"; task1.uwStackSize = TASK_STACK_SIZE_TEST; task1.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID02, &task1); @@ -130,7 +130,7 @@ static VOID TaskA5Func(VOID) task2.pcName = "TaskC"; task2.uwStackSize = TASK_STACK_SIZE_TEST; task2.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task2.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID03, &task2); @@ -141,7 +141,7 @@ static VOID TaskA5Func(VOID) task3.pcName = "TaskD"; task3.uwStackSize = TASK_STACK_SIZE_TEST; task3.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task3.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID04, &task3); @@ -182,7 +182,7 @@ static UINT32 Testcase(VOID) task.pcName = "TaskA"; task.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; task.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreate(&g_testTaskID01, &task); diff --git a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_035.c b/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_035.c index b9c75822..db1e4f62 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_035.c +++ b/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_035.c @@ -100,7 +100,7 @@ static VOID TaskMisc10Func(VOID) task1.pcName = "TaskService_3"; task1.uwStackSize = LOS_TASK_MIN_STACK_SIZE; task1.uwResved = 0; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif @@ -134,7 +134,7 @@ static UINT32 Testcase(VOID) task.pcName = "TaskMisc_10"; task.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; task.uwResved = 0; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif @@ -146,7 +146,7 @@ static UINT32 Testcase(VOID) task.pcName = "TaskFe_2"; task.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; task.uwResved = 0; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif diff --git a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_036.c b/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_036.c index dd41f227..a050575e 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_036.c +++ b/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_036.c @@ -87,7 +87,7 @@ static VOID TaskMisc10Func(VOID) task1.pcName = "TaskService_5"; task1.uwStackSize = LOS_TASK_MIN_STACK_SIZE; task1.uwResved = 0; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif @@ -118,7 +118,7 @@ static UINT32 Testcase(VOID) task.pcName = "TaskMisc_10"; task.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; task.uwResved = 0; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif @@ -132,7 +132,7 @@ static UINT32 Testcase(VOID) task.pcName = "TaskFe_4"; task.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; task.uwResved = 0; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif diff --git a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_037.c b/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_037.c index 046a06fc..e0cf203b 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_037.c +++ b/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_037.c @@ -95,7 +95,7 @@ static UINT32 Testcase(VOID) task.pcName = "TaskMisc_10"; task.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; task.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif @@ -107,7 +107,7 @@ static UINT32 Testcase(VOID) task.pcName = "TaskFe_4"; task.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; task.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif diff --git a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_038.c b/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_038.c index 8ca4c571..a4560186 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_038.c +++ b/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_038.c @@ -89,7 +89,7 @@ static UINT32 Testcase(VOID) task.pcName = "TaskMisc_10"; task.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; task.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif @@ -101,7 +101,7 @@ static UINT32 Testcase(VOID) task.pcName = "TaskFe_4"; task.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; task.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif diff --git a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_039.c b/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_039.c index 854dc3ff..63d13309 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_039.c +++ b/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_039.c @@ -106,7 +106,7 @@ static UINT32 Testcase(VOID) task.pcName = "TaskMisc_10"; task.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; task.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif @@ -121,7 +121,7 @@ static UINT32 Testcase(VOID) task.pcName = "TaskFe_4"; task.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; task.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif diff --git a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_040.c b/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_040.c index 1a0523bd..e362c7fe 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_040.c +++ b/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_040.c @@ -199,7 +199,7 @@ static UINT32 Testcase(VOID) task.pcName = "TaskMisc_10"; task.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; task.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif @@ -214,7 +214,7 @@ static UINT32 Testcase(VOID) task.pcName = "TaskFe_9"; task.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; task.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif @@ -229,7 +229,7 @@ static UINT32 Testcase(VOID) task.pcName = "TaskFe_8"; task.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; task.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif @@ -244,7 +244,7 @@ static UINT32 Testcase(VOID) task.pcName = "TaskFe_7"; task.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; task.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif diff --git a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_041.c b/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_041.c index a0b9fdf8..4fb84b90 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_041.c +++ b/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_041.c @@ -81,7 +81,7 @@ static UINT32 Testcase(VOID) taskParam.pcName = "TaskMisc_10"; taskParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; taskParam.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP taskParam.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif diff --git a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_042.c b/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_042.c index 59ecf212..f0cdfc3d 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_042.c +++ b/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_042.c @@ -99,7 +99,7 @@ static UINT32 Testcase(VOID) taskParam.pcName = "TaskMisc_10"; taskParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; taskParam.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP taskParam.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif @@ -115,7 +115,7 @@ static UINT32 Testcase(VOID) taskParam.pcName = "TaskFe_4"; taskParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; taskParam.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP taskParam.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif diff --git a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_043.c b/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_043.c index 0aa758fb..41324aef 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_043.c +++ b/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_043.c @@ -120,7 +120,7 @@ static UINT32 Testcase(VOID) taskParam.pcName = "TaskMisc_10"; taskParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; taskParam.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP taskParam.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif @@ -136,7 +136,7 @@ static UINT32 Testcase(VOID) taskParam.pcName = "TaskFe_4"; taskParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; taskParam.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP taskParam.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif diff --git a/testsuites/kernel/sample/kernel_base/ipc/queue/It_los_queue.c b/testsuites/kernel/sample/kernel_base/ipc/queue/It_los_queue.c index 2a7816a1..a1dd0a3a 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/queue/It_los_queue.c +++ b/testsuites/kernel/sample/kernel_base/ipc/queue/It_los_queue.c @@ -40,7 +40,7 @@ extern "C" { VOID ItSuiteLosQueue(VOID) { -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP ItSmpLosQueue001(); ItSmpLosQueue002(); ItSmpLosQueue003(); @@ -101,7 +101,7 @@ VOID ItSuiteLosQueue(VOID) ItLosQueue018(); ItLosQueue019(); ItLosQueue020(); -#if (LOSCFG_KERNEL_SMP != YES) +#ifndef LOSCFG_KERNEL_SMP ItLosQueue021(); #endif ItLosQueue022(); @@ -228,7 +228,7 @@ VOID ItSuiteLosQueue(VOID) ItLosQueueHead042(); #endif -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST, 1); #endif } diff --git a/testsuites/kernel/sample/kernel_base/ipc/queue/It_los_queue.h b/testsuites/kernel/sample/kernel_base/ipc/queue/It_los_queue.h index fb0b30b6..0309563c 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/queue/It_los_queue.h +++ b/testsuites/kernel/sample/kernel_base/ipc/queue/It_los_queue.h @@ -256,7 +256,7 @@ VOID ItLosQueueDebug001(void); #endif #endif -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP VOID ItSmpLosQueue001(VOID); VOID ItSmpLosQueue002(VOID); VOID ItSmpLosQueue003(VOID); diff --git a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_044.c b/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_044.c index 3ceae8d8..f47b3586 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_044.c +++ b/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_044.c @@ -70,7 +70,7 @@ static UINT32 Testcase(VOID) ret = TEST_HwiCreate(HWI_NUM_TEST, 1, 0, HwiF01, 0); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); #endif diff --git a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_045.c b/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_045.c index e11fcd6f..e57f3ec8 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_045.c +++ b/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_045.c @@ -64,7 +64,7 @@ static UINT32 Testcase(VOID) ret = TEST_HwiCreate(HWI_NUM_TEST, 1, 0, HwiF01, 0); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); #endif diff --git a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_046.c b/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_046.c index 24336641..19bca4a7 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_046.c +++ b/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_046.c @@ -83,7 +83,7 @@ static UINT32 Testcase(VOID) ret = TEST_HwiCreate(HWI_NUM_TEST3, 1, 0, HwiF02, 0); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); #endif diff --git a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_047.c b/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_047.c index 3fb31a6c..f336392b 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_047.c +++ b/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_047.c @@ -95,7 +95,7 @@ static UINT32 Testcase(VOID) ret = TEST_HwiCreate(HWI_NUM_TEST, 1, 0, HwiF01, 0); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); #endif diff --git a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_048.c b/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_048.c index 99f6dd66..3847f03f 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_048.c +++ b/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_048.c @@ -88,7 +88,7 @@ static UINT32 Testcase(VOID) ret = TEST_HwiCreate(HWI_NUM_TEST, 1, 0, HwiF01, 0); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); #endif diff --git a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_050.c b/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_050.c index f1d4a9f6..205ab668 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_050.c +++ b/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_050.c @@ -68,7 +68,7 @@ static UINT32 Testcase(VOID) ret = TEST_HwiCreate(HWI_NUM_TEST, 1, 0, HwiF01, 0); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); #endif diff --git a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_108.c b/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_108.c index 9a2d44b2..48e42202 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_108.c +++ b/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_108.c @@ -75,7 +75,7 @@ static UINT32 Testcase(VOID) ret = TEST_HwiCreate(HWI_NUM_TEST, 1, 0, HwiF01, 0); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); #endif diff --git a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_111.c b/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_111.c index 72e22d82..84ed0f2a 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_111.c +++ b/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_111.c @@ -77,7 +77,7 @@ static UINT32 Testcase(VOID) ret = TEST_HwiCreate(HWI_NUM_TEST, 1, 0, HwiF01, 0); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); #endif diff --git a/testsuites/kernel/sample/kernel_base/ipc/sem/It_los_sem.c b/testsuites/kernel/sample/kernel_base/ipc/sem/It_los_sem.c index 4a07e548..08468c7d 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/sem/It_los_sem.c +++ b/testsuites/kernel/sample/kernel_base/ipc/sem/It_los_sem.c @@ -39,7 +39,7 @@ extern "C" { VOID ItSuiteLosSem(void) { -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP /* fixed */ ItSmpLosSem008(); ItSmpLosSem022(); @@ -114,7 +114,7 @@ VOID ItSuiteLosSem(void) ItLosSem036(); ItLosSem037(); ItLosSem038(); -#if (LOSCFG_KERNEL_SMP_TASK_SYNC != YES) +#ifndef LOSCFG_KERNEL_SMP_TASK_SYNC // LOSCFG_KERNEL_SMP_TASK_SYNC is opened ,create task success is depend on created semaphore successed; ItLosSem039(); ItLosSem040(); @@ -134,7 +134,7 @@ VOID ItSuiteLosSem(void) ItLosSem024(); ItLosSem030(); ItLosSem032(); -#if (LOSCFG_KERNEL_SMP != YES) +#ifndef LOSCFG_KERNEL_SMP ItLosSem033(); #endif LltLosSem001(); @@ -153,7 +153,7 @@ VOID ItSuiteLosSem(void) #endif #endif -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST, 1); #endif } diff --git a/testsuites/kernel/sample/kernel_base/ipc/sem/It_los_sem.h b/testsuites/kernel/sample/kernel_base/ipc/sem/It_los_sem.h index 0da88acf..62368917 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/sem/It_los_sem.h +++ b/testsuites/kernel/sample/kernel_base/ipc/sem/It_los_sem.h @@ -102,7 +102,7 @@ VOID ItLosSem043(void); VOID ItLosSem044(void); #endif -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP VOID ItSmpLosSem001(VOID); VOID ItSmpLosSem002(VOID); VOID ItSmpLosSem003(VOID); diff --git a/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_020.c b/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_020.c index be911426..47bb469c 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_020.c +++ b/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_020.c @@ -59,7 +59,7 @@ static UINT32 Testcase(VOID) task.uwStackSize = TASK_STACK_SIZE_TEST; task.usTaskPrio = TASK_PRIO_TEST - 1; task.uwResved = LOS_TASK_STATUS_DETACHED; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP task.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif g_testCount = 0; diff --git a/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_022.c b/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_022.c index db7ae18d..56ffb69d 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_022.c +++ b/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_022.c @@ -60,12 +60,12 @@ static VOID TaskF02(void) LOS_TaskLock(); ret = LOS_SemPost(g_semID); ICUNIT_TRACK_EQUAL(ret, LOS_OK, ret); -#if (LOSCFG_KERNEL_SMP != YES) +#ifndef LOSCFG_KERNEL_SMP ICUNIT_TRACK_EQUAL(g_testCount, 1, g_testCount); #endif LOS_TaskUnlock(); -#if (LOSCFG_KERNEL_SMP != YES) +#ifndef LOSCFG_KERNEL_SMP ICUNIT_TRACK_EQUAL(g_testCount, 1, g_testCount); #endif g_testCount++; diff --git a/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_023.c b/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_023.c index 4eb0ab8c..263c6c41 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_023.c +++ b/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_023.c @@ -88,7 +88,7 @@ static UINT32 Testcase(VOID) TEST_HwiDelete(HWI_NUM_TEST); ret = TEST_HwiCreate(HWI_NUM_TEST, 0, 0, HwiF01, 0); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT2); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); #endif diff --git a/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_026.c b/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_026.c index 5195b921..65132b95 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_026.c +++ b/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_026.c @@ -44,7 +44,7 @@ static VOID TaskF02(void) g_testCount++; ret = LOS_SemPend(g_semID, LOS_WAIT_FOREVER); ICUNIT_ASSERT_EQUAL_VOID(ret, LOS_OK, ret); -#if (LOSCFG_KERNEL_SMP != YES) +#ifndef LOSCFG_KERNEL_SMP ICUNIT_TRACK_EQUAL(g_testCount, 2, g_testCount); // 2, Here, assert that g_testCount is equal to #endif g_testCount++; @@ -61,7 +61,7 @@ static VOID TaskF01(void) ret = LOS_SemPend(g_semID, LOS_WAIT_FOREVER); ICUNIT_ASSERT_EQUAL_VOID(ret, LOS_OK, ret); -#if (LOSCFG_KERNEL_SMP != YES) +#ifndef LOSCFG_KERNEL_SMP ICUNIT_TRACK_EQUAL(g_testCount, 3, g_testCount); // 3, Here, assert that g_testCount is equal to #endif g_testCount++; diff --git a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_030.c b/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_030.c index 742a1042..fdc8155b 100644 --- a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_030.c +++ b/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_030.c @@ -38,7 +38,7 @@ extern "C" { #endif /* __cpluscplus */ #endif /* __cpluscplus */ -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP static UINT32 g_ret1, g_ret2, g_ret3; static UINT32 g_szId[3] = {0}; diff --git a/testsuites/kernel/sample/kernel_extend/cpup/It_extend_cpup.c b/testsuites/kernel/sample/kernel_extend/cpup/It_extend_cpup.c index f4217d4e..fc348ff5 100644 --- a/testsuites/kernel/sample/kernel_extend/cpup/It_extend_cpup.c +++ b/testsuites/kernel/sample/kernel_extend/cpup/It_extend_cpup.c @@ -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 diff --git a/testsuites/kernel/sample/kernel_extend/cpup/It_extend_cpup.h b/testsuites/kernel/sample/kernel_extend/cpup/It_extend_cpup.h index 7e54b537..7a4d8eea 100644 --- a/testsuites/kernel/sample/kernel_extend/cpup/It_extend_cpup.h +++ b/testsuites/kernel/sample/kernel_extend/cpup/It_extend_cpup.h @@ -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 diff --git a/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_004.c b/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_004.c index 98cb5671..2643a713 100644 --- a/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_004.c +++ b/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_004.c @@ -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; diff --git a/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_005.c b/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_005.c index b47ac536..2e80bad8 100644 --- a/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_005.c +++ b/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_005.c @@ -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; diff --git a/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_006.c b/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_006.c index e90de96d..152f2e29 100644 --- a/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_006.c +++ b/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_006.c @@ -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; diff --git a/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_008.c b/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_008.c index 86e9e792..45188fd0 100644 --- a/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_008.c +++ b/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_008.c @@ -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; diff --git a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_001.c b/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_001.c index d72a879b..5efd147e 100644 --- a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_001.c +++ b/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_001.c @@ -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); diff --git a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_002.c b/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_002.c index a05abf00..be0802cc 100644 --- a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_002.c +++ b/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_002.c @@ -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); diff --git a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_003.c b/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_003.c index 4b476b9a..c3649397 100644 --- a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_003.c +++ b/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_003.c @@ -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); diff --git a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_004.c b/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_004.c index 1fecac72..853a0643 100644 --- a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_004.c +++ b/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_004.c @@ -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); diff --git a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_005.c b/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_005.c index 6b247384..72d12677 100644 --- a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_005.c +++ b/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_005.c @@ -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); diff --git a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_007.c b/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_007.c index 6f596788..4b401738 100644 --- a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_007.c +++ b/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_007.c @@ -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); diff --git a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_008.c b/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_008.c index 3be498fc..3a961ac9 100644 --- a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_008.c +++ b/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_008.c @@ -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); diff --git a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_009.c b/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_009.c index d64b8486..034ad59d 100644 --- a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_009.c +++ b/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_009.c @@ -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); diff --git a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_010.c b/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_010.c index d2037338..3bcbb4b5 100644 --- a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_010.c +++ b/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_010.c @@ -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); diff --git a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_011.c b/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_011.c index b572f834..a4056e0e 100644 --- a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_011.c +++ b/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_011.c @@ -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); diff --git a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_012.c b/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_012.c index 7a320ed6..42206fb7 100644 --- a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_012.c +++ b/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_012.c @@ -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); diff --git a/testsuites/kernel/sample/posix/mutex/It_posix_mutex.c b/testsuites/kernel/sample/posix/mutex/It_posix_mutex.c index da2a543f..c253061e 100644 --- a/testsuites/kernel/sample/posix/mutex/It_posix_mutex.c +++ b/testsuites/kernel/sample/posix/mutex/It_posix_mutex.c @@ -119,7 +119,7 @@ VOID ItSuitePosixMutex(void) ItPosixMux072(); ItPosixMux073(); ItPosixMux074(); -#if (LOSCFG_KERNEL_SMP != YES) +#ifndef LOSCFG_KERNEL_SMP ItPosixMux075(); #endif ItPosixMux076(); diff --git a/testsuites/kernel/sample/posix/pthread/It_posix_pthread.c b/testsuites/kernel/sample/posix/pthread/It_posix_pthread.c index 160b5a5f..3607d837 100644 --- a/testsuites/kernel/sample/posix/pthread/It_posix_pthread.c +++ b/testsuites/kernel/sample/posix/pthread/It_posix_pthread.c @@ -251,7 +251,7 @@ VOID ItSuitePosixPthread() ItPosixPthread044(); ItPosixPthread045(); ItPosixPthread046(); -#if (LOSCFG_KERNEL_SMP != YES) +#ifndef LOSCFG_KERNEL_SMP ItPosixPthread047(); // pthread preemption, may not happen on smp #endif ItPosixPthread048(); diff --git a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_066.c b/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_066.c index a7e03f6c..76132c12 100644 --- a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_066.c +++ b/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_066.c @@ -76,7 +76,7 @@ static VOID *PthreadF01(void *argument) ret = pthread_create(&g_newTh2, &attr, PthreadF02, NULL); ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP while (g_testCount < 2) { // 2, delay until g_testCount is equal to 2. TestBusyTaskDelay(1); } diff --git a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_068.c b/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_068.c index 6ced64b9..a71ec33b 100644 --- a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_068.c +++ b/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_068.c @@ -74,7 +74,7 @@ static VOID *PthreadF01(VOID *argument) ret = pthread_create(&g_newTh2, &attr, PthreadF02, NULL); ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP while (g_testCount < 2) { // 2, delay until g_testCount is equal to 2. TestBusyTaskDelay(1); } diff --git a/testsuites/kernel/src/iCunit.c b/testsuites/kernel/src/iCunit.c index 9b8b709a..1515ba2d 100644 --- a/testsuites/kernel/src/iCunit.c +++ b/testsuites/kernel/src/iCunit.c @@ -50,7 +50,7 @@ extern "C" { #define ARRAY_SIZE 2 -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP LITE_OS_SEC_BSS SPIN_LOCK_INIT(g_testSuitSpin); #endif @@ -125,13 +125,13 @@ u_long ICunitRand(void) void ICunitSaveErr(iiUINT32 line, iiUINT32 retCode) { -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP UINT32 intSave; TESTSUIT_LOCK(intSave); #endif g_iCunitErrCode = ((g_iCunitErrCode == 0) && (g_iCunitErrLineNo == 0)) ? (iiUINT32)retCode : g_iCunitErrCode; g_iCunitErrLineNo = (g_iCunitErrLineNo == 0) ? line : g_iCunitErrLineNo; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP TESTSUIT_UNLOCK(intSave); #endif } @@ -184,7 +184,7 @@ iUINT32 ICunitAddCase(const iCHAR *caseName, CASE_FUNCTION caseFunc, iUINT16 tes UINT32 g_cunitInitFlag = 0; iUINT32 ICunitInit(void) { -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP if (LOS_AtomicCmpXchg32bits(&g_cunitInitFlag, 1, 0)) { PRINTK("other core already done iCunitInit\n"); return (iUINT32)ICUNIT_SUCCESS; diff --git a/testsuites/kernel/src/osTest.c b/testsuites/kernel/src/osTest.c index a9762cec..5317ea77 100644 --- a/testsuites/kernel/src/osTest.c +++ b/testsuites/kernel/src/osTest.c @@ -259,7 +259,7 @@ void TestHwiTrigger(unsigned int irq) VOID TestExtraTaskDelay(UINT32 tick) { -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP // trigger task schedule may occor on another core // needs adding delay and checking status later LOS_TaskDelay(tick); @@ -327,7 +327,7 @@ VOID TestTestHwiDelete(unsigned int irq, VOID *devId) VOID TestDumpCpuid(VOID) { -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP PRINT_DEBUG("%d,cpuid = %d\n", LOS_CurTaskIDGet(), ArchCurrCpuid()); #endif return; @@ -530,7 +530,7 @@ void TestSystemInit(void) testProcess = OS_PCB_FROM_PID(pid); g_testTskHandle = testProcess->threadGroupID; -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP ((LosTaskCB *)OS_TCB_FROM_TID(g_testTskHandle))->cpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif } diff --git a/testsuites/unittest/common/include/osTest.h b/testsuites/unittest/common/include/osTest.h index 5fa25e69..0623b40a 100644 --- a/testsuites/unittest/common/include/osTest.h +++ b/testsuites/unittest/common/include/osTest.h @@ -84,7 +84,7 @@ stTestTask.uwResved = LOS_TASK_STATUS_DETACHED; \ } while (0) -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP #define TEST_TASK_PARAM_INIT_AFFI(stTestTask, task_name, entry, prio, affi) \ TEST_TASK_PARAM_INIT(stTestTask, task_name, entry, prio) \ stTestTask.usCpuAffiMask = affi; diff --git a/testsuites/unittest/common/osTest.cpp b/testsuites/unittest/common/osTest.cpp index 6bcb34de..a771a147 100644 --- a/testsuites/unittest/common/osTest.cpp +++ b/testsuites/unittest/common/osTest.cpp @@ -162,7 +162,7 @@ UINT32 LosTaskDelay(UINT32 tick) VOID TestExtraTaskDelay(UINT32 uwTick) { -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP // trigger task schedule may occor on another core // needs adding delay and checking status later LosTaskDelay(uwTick); diff --git a/testsuites/unittest/fs/proc/It_vfs_proc.cpp b/testsuites/unittest/fs/proc/It_vfs_proc.cpp index df08e332..a4d42574 100644 --- a/testsuites/unittest/fs/proc/It_vfs_proc.cpp +++ b/testsuites/unittest/fs/proc/It_vfs_proc.cpp @@ -48,7 +48,7 @@ VOID ItSuiteVfsProc(VOID) #endif #if defined(LOSCFG_USER_TEST_PRESSURE) -#if(LOSCFG_KERNEL_SMP != YES) +#ifndef LOSCFG_KERNEL_SMP #endif #endif } diff --git a/testsuites/unittest/posix/mqueue/full/It_posix_queue_124.cpp b/testsuites/unittest/posix/mqueue/full/It_posix_queue_124.cpp index a1e96331..774c8dd1 100644 --- a/testsuites/unittest/posix/mqueue/full/It_posix_queue_124.cpp +++ b/testsuites/unittest/posix/mqueue/full/It_posix_queue_124.cpp @@ -106,7 +106,7 @@ static UINT32 Testcase(VOID) uret = LOS_HwiCreate(HWI_NUM_TEST1, 1, 0, (HWI_PROC_FUNC)HwiF02, 0); ICUNIT_GOTO_EQUAL(uret, MQUEUE_NO_ERROR, uret, EXIT); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST1, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); #endif @@ -117,7 +117,7 @@ static UINT32 Testcase(VOID) uret = LOS_HwiCreate(HWI_NUM_TEST, 1, 0, (HWI_PROC_FUNC)HwiF01, 0); ICUNIT_GOTO_EQUAL(uret, MQUEUE_NO_ERROR, uret, EXIT1); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP HalIrqSetAffinity(HWI_NUM_TEST, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); #endif diff --git a/testsuites/unittest/posix/mqueue/posix_mqueue_test.cpp b/testsuites/unittest/posix/mqueue/posix_mqueue_test.cpp index 49475701..b49ce837 100644 --- a/testsuites/unittest/posix/mqueue/posix_mqueue_test.cpp +++ b/testsuites/unittest/posix/mqueue/posix_mqueue_test.cpp @@ -257,7 +257,7 @@ HWTEST_F(PosixMqueueTest, ItPosixQueue016, TestSize.Level0) ItPosixQueue016(); } -#if (LOSCFG_KERNEL_SMP != YES) +#ifndef LOSCFG_KERNEL_SMP /** * @tc.name: IT_POSIX_QUEUE_113 * @tc.desc: function for PosixMqueueTest diff --git a/testsuites/unittest/posix/pthread/full/It_posix_pthread_066.cpp b/testsuites/unittest/posix/pthread/full/It_posix_pthread_066.cpp index 260017e7..193faba3 100644 --- a/testsuites/unittest/posix/pthread/full/It_posix_pthread_066.cpp +++ b/testsuites/unittest/posix/pthread/full/It_posix_pthread_066.cpp @@ -71,7 +71,7 @@ static VOID *pthread_f01(void *argument) ret = pthread_create(&g_newTh2, &attr, pthread_f02, NULL); ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); -#if (LOSCFG_KERNEL_SMP == YES) +#ifdef LOSCFG_KERNEL_SMP while (g_testCount < 2) { TestBusyTaskDelay(1); } diff --git a/tools/build/mk/los_config.mk b/tools/build/mk/los_config.mk index cc97cdfe..9c3923bd 100644 --- a/tools/build/mk/los_config.mk +++ b/tools/build/mk/los_config.mk @@ -185,12 +185,6 @@ ifeq ($(LOSCFG_KERNEL_CPUP), y) LITEOS_CPUP_INCLUDE := -I $(LITEOSTOPDIR)/kernel/extended/cpup endif -ifeq ($(LOSCFG_KERNEL_SCHED_STATISTICS), y) - LITEOS_CMACRO += -DLOSCFG_KERNEL_SCHED_STATISTICS=1 -else - LITEOS_CMACRO += -DLOSCFG_KERNEL_SCHED_STATISTICS=0 -endif - ifeq ($(LOSCFG_KERNEL_DYNLOAD), y) LITEOS_BASELIB += -ldynload LIB_SUBDIRS += kernel/extended/dynload From e57dc7762bddefe772a04a1d0985a34242f3505b Mon Sep 17 00:00:00 2001 From: vcbchang Date: Tue, 15 Jun 2021 09:10:25 +0800 Subject: [PATCH 07/43] =?UTF-8?q?test:=20=E4=BF=AE=E5=A4=8D=E4=BA=86?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E7=B3=BB=E7=BB=9F=E4=B8=ADjffs=E7=9A=84?= =?UTF-8?q?=E5=85=A8=E9=87=8F=E7=94=A8=E4=BE=8B=E5=92=8C=E5=8E=8B=E6=B5=8B?= =?UTF-8?q?=E7=94=A8=E4=BE=8B=E4=B8=AD=E5=87=BA=E7=8E=B0=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【背景】当前的fs中的jffs用例存在运行不通过的问题,现将其一一修复。 【修改方案】 1. 默认storage文件夹没有文件,如果存在,删除后测试 2. BUG中存在判断不通过的情况,可能是移植过程中出现的变量判断错误,修改变量名正确通过 3. 移植过程中没有考虑现在falsh的大小,有时会出现写入量过多而容量不够的情况,则通过减少写入量来解决问题。 4. 为了尽量减少修改的内容,这里主要以更改全局宏大小或者在代码中修改变量的初始值。 【影响】 主要是jffs用例的写入flash的大小发生变化,其余没有影响。 Signed-off-by: vcbchang Change-Id: I878fe3ad855e0e430bf7f36e066120893f756828 --- testsuites/unittest/config.gni | 2 +- testsuites/unittest/fs/BUILD.gn | 8 +++--- testsuites/unittest/fs/jffs/It_vfs_jffs.h | 2 +- .../unittest/fs/jffs/full/It_jffs_011.cpp | 2 +- .../unittest/fs/jffs/full/It_jffs_012.cpp | 2 +- .../unittest/fs/jffs/full/It_vfs_jffs_045.cpp | 2 +- .../unittest/fs/jffs/full/It_vfs_jffs_077.cpp | 1 + .../unittest/fs/jffs/full/It_vfs_jffs_078.cpp | 2 +- .../unittest/fs/jffs/full/It_vfs_jffs_215.cpp | 2 +- .../unittest/fs/jffs/full/It_vfs_jffs_427.cpp | 6 ++--- .../pressure/It_fs_jffs_performance_009.cpp | 2 ++ .../jffs/pressure/It_fs_jffs_pressure_023.cpp | 9 ++++--- .../jffs/pressure/It_fs_jffs_pressure_026.cpp | 5 ++-- .../jffs/pressure/It_fs_jffs_pressure_033.cpp | 2 +- .../jffs/pressure/It_fs_jffs_pressure_047.cpp | 4 +-- .../jffs/pressure/It_fs_jffs_pressure_052.cpp | 3 ++- .../jffs/pressure/It_fs_jffs_pressure_310.cpp | 4 +-- .../jffs/pressure/It_fs_jffs_pressure_311.cpp | 5 ++-- .../pressure/It_vfs_jffs_multipthread_002.cpp | 27 ++++++++++--------- .../pressure/It_vfs_jffs_multipthread_014.cpp | 2 +- .../pressure/It_vfs_jffs_multipthread_015.cpp | 6 ++--- .../pressure/It_vfs_jffs_multipthread_016.cpp | 6 ++--- .../pressure/It_vfs_jffs_multipthread_017.cpp | 6 ++--- .../pressure/It_vfs_jffs_multipthread_018.cpp | 6 ++--- .../pressure/It_vfs_jffs_multipthread_019.cpp | 6 ++--- .../pressure/It_vfs_jffs_multipthread_020.cpp | 6 ++--- .../pressure/It_vfs_jffs_multipthread_021.cpp | 6 ++--- .../pressure/It_vfs_jffs_multipthread_022.cpp | 6 ++--- .../pressure/It_vfs_jffs_multipthread_023.cpp | 6 ++--- .../pressure/It_vfs_jffs_multipthread_024.cpp | 6 ++--- .../pressure/It_vfs_jffs_multipthread_025.cpp | 6 ++--- .../pressure/It_vfs_jffs_multipthread_036.cpp | 6 ++--- .../pressure/It_vfs_jffs_multipthread_038.cpp | 6 ++--- .../pressure/It_vfs_jffs_multipthread_039.cpp | 6 ++--- .../pressure/It_vfs_jffs_multipthread_040.cpp | 6 ++--- .../pressure/It_vfs_jffs_multipthread_041.cpp | 6 ++--- .../pressure/It_vfs_jffs_multipthread_042.cpp | 6 ++--- .../pressure/It_vfs_jffs_multipthread_043.cpp | 6 ++--- .../pressure/It_vfs_jffs_multipthread_044.cpp | 6 ++--- .../pressure/It_vfs_jffs_multipthread_045.cpp | 6 ++--- .../pressure/It_vfs_jffs_multipthread_046.cpp | 6 ++--- .../pressure/It_vfs_jffs_multipthread_047.cpp | 6 ++--- .../pressure/It_vfs_jffs_multipthread_052.cpp | 2 -- .../pressure/It_vfs_jffs_multipthread_053.cpp | 1 - .../pressure/It_vfs_jffs_multipthread_054.cpp | 1 - .../pressure/It_vfs_jffs_multipthread_055.cpp | 1 - .../pressure/It_vfs_jffs_multipthread_056.cpp | 1 - .../pressure/It_vfs_jffs_multipthread_057.cpp | 1 - .../pressure/It_vfs_jffs_multipthread_058.cpp | 1 - .../pressure/It_vfs_jffs_multipthread_059.cpp | 1 - .../pressure/It_vfs_jffs_multipthread_060.cpp | 1 - .../pressure/It_vfs_jffs_multipthread_061.cpp | 1 - .../pressure/It_vfs_jffs_multipthread_062.cpp | 1 - .../pressure/It_vfs_jffs_multipthread_063.cpp | 1 - testsuites/unittest/fs/jffs/vfs_jffs_test.cpp | 27 ++++++++----------- 55 files changed, 128 insertions(+), 136 deletions(-) diff --git a/testsuites/unittest/config.gni b/testsuites/unittest/config.gni index d7c6da1c..0520a702 100644 --- a/testsuites/unittest/config.gni +++ b/testsuites/unittest/config.gni @@ -73,4 +73,4 @@ LOSCFG_USER_TEST_SIGNAL = true LOSCFG_USER_TEST_SYS = true LOSCFG_USER_TEST_TIME_CLOCK = true LOSCFG_USER_TEST_TIME_TIMER = true -LOSCFG_USER_TEST_UTIL = true \ No newline at end of file +LOSCFG_USER_TEST_UTIL = true diff --git a/testsuites/unittest/fs/BUILD.gn b/testsuites/unittest/fs/BUILD.gn index 7fc066b3..bc1b6d76 100644 --- a/testsuites/unittest/fs/BUILD.gn +++ b/testsuites/unittest/fs/BUILD.gn @@ -55,7 +55,7 @@ sources_smoke = [ "jffs/smoke/It_vfs_jffs_035.cpp", "jffs/smoke/It_vfs_jffs_094.cpp", "jffs/smoke/It_vfs_jffs_095.cpp", - #"jffs/smoke/It_vfs_jffs_103.cpp", + "jffs/smoke/It_vfs_jffs_103.cpp", "jffs/smoke/It_vfs_jffs_535.cpp", "jffs/smoke/It_vfs_jffs_Dac_001.cpp", ] @@ -128,7 +128,7 @@ sources_pressure = [ "jffs/pressure/It_fs_jffs_pressure_053.cpp", "jffs/pressure/It_fs_jffs_pressure_301.cpp", "jffs/pressure/It_fs_jffs_pressure_302.cpp", - #"jffs/pressure/It_fs_jffs_pressure_303.cpp", + "jffs/pressure/It_fs_jffs_pressure_303.cpp", "jffs/pressure/It_fs_jffs_pressure_304.cpp", "jffs/pressure/It_fs_jffs_pressure_305.cpp", "jffs/pressure/It_fs_jffs_pressure_306.cpp", @@ -289,7 +289,7 @@ sources_full = [ "jffs/full/It_vfs_jffs_048.cpp", "jffs/full/It_vfs_jffs_049.cpp", "jffs/full/It_vfs_jffs_050.cpp", - #"jffs/full/It_vfs_jffs_051.cpp", + "jffs/full/It_vfs_jffs_051.cpp", "jffs/full/It_vfs_jffs_053.cpp", "jffs/full/It_vfs_jffs_055.cpp", "jffs/full/It_vfs_jffs_056.cpp", @@ -837,4 +837,4 @@ if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_HIGH) { configs = [ "..:public_config_for_pressure" ] deps = [ "//third_party/bounds_checking_function:libsec_shared" ] } -} \ No newline at end of file +} diff --git a/testsuites/unittest/fs/jffs/It_vfs_jffs.h b/testsuites/unittest/fs/jffs/It_vfs_jffs.h index f1fd0b30..a64eddb8 100644 --- a/testsuites/unittest/fs/jffs/It_vfs_jffs.h +++ b/testsuites/unittest/fs/jffs/It_vfs_jffs.h @@ -137,7 +137,7 @@ constexpr int JFFS_MAX_DEF_BUF_NUM = 21; constexpr int JFFS_FILE_LIMITTED_NUM = 200; constexpr int JFFS_FILE_SIZE_TEST = 100 * 1024 * 1024; // *1024 -constexpr int JFFS_PERFORMANCE_W_R_SIZE = 10 * 1024 * 1024; +constexpr int JFFS_PERFORMANCE_W_R_SIZE = 5 * 1024 * 1024; constexpr int JFFS_FILE_PER_WRITE_SIZE = 5 * 1024 * 1024; constexpr int JFFS_PRESSURE_W_R_SIZE1 = 1 * 1024 * 1024; constexpr int JFFS_PRESSURE_W_R_SIZE2 = 5 * 1024 * 1024; diff --git a/testsuites/unittest/fs/jffs/full/It_jffs_011.cpp b/testsuites/unittest/fs/jffs/full/It_jffs_011.cpp index 451e274a..df31ea3f 100644 --- a/testsuites/unittest/fs/jffs/full/It_jffs_011.cpp +++ b/testsuites/unittest/fs/jffs/full/It_jffs_011.cpp @@ -40,7 +40,7 @@ static UINT32 Testcase(VOID) CHAR *pfd = NULL; ret = chdir(pathname1); - ICUNIT_GOTO_NOT_EQUAL(fd, JFFS_IS_ERROR, fd, EXIT); + ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT); pfd = mktemp(tempFile); ICUNIT_GOTO_NOT_EQUAL(pfd, NULL, pfd, EXIT1); diff --git a/testsuites/unittest/fs/jffs/full/It_jffs_012.cpp b/testsuites/unittest/fs/jffs/full/It_jffs_012.cpp index 29ea6a29..931adfd6 100644 --- a/testsuites/unittest/fs/jffs/full/It_jffs_012.cpp +++ b/testsuites/unittest/fs/jffs/full/It_jffs_012.cpp @@ -40,7 +40,7 @@ static UINT32 Testcase(VOID) CHAR *pfd = NULL; ret = chdir(pathname1); - ICUNIT_GOTO_NOT_EQUAL(fd, JFFS_IS_ERROR, fd, EXIT); + ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT); pfd = mkdtemp(tempFile); ICUNIT_GOTO_NOT_EQUAL(pfd, NULL, pfd, EXIT1); diff --git a/testsuites/unittest/fs/jffs/full/It_vfs_jffs_045.cpp b/testsuites/unittest/fs/jffs/full/It_vfs_jffs_045.cpp index 650663b7..f99e7df8 100644 --- a/testsuites/unittest/fs/jffs/full/It_vfs_jffs_045.cpp +++ b/testsuites/unittest/fs/jffs/full/It_vfs_jffs_045.cpp @@ -55,7 +55,7 @@ static UINT32 Testcase(VOID) ICUNIT_GOTO_NOT_EQUAL(fd1, -1, fd1, EXIT3); len = read(fd1, readbuf, JFFS_STANDARD_NAME_LENGTH); - ICUNIT_GOTO_EQUAL(len, 0, len, EXIT3); + ICUNIT_GOTO_EQUAL(len, 10, len, EXIT3); // 10 means read size len = write(fd1, "abcde", 6); // 6 means write len ICUNIT_GOTO_EQUAL(len, 6, len, EXIT3); diff --git a/testsuites/unittest/fs/jffs/full/It_vfs_jffs_077.cpp b/testsuites/unittest/fs/jffs/full/It_vfs_jffs_077.cpp index 127ad1b7..0665026f 100644 --- a/testsuites/unittest/fs/jffs/full/It_vfs_jffs_077.cpp +++ b/testsuites/unittest/fs/jffs/full/It_vfs_jffs_077.cpp @@ -47,6 +47,7 @@ static UINT32 Testcase(VOID) ret = mkdir(pathname1, HIGHEST_AUTHORITY); ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1); + strcat_s(pathname2, sizeof(pathname2), "/test"); strcat_s(pathname2, sizeof(pathname2), "/test"); ret = mkdir(pathname2, HIGHEST_AUTHORITY); ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT2); diff --git a/testsuites/unittest/fs/jffs/full/It_vfs_jffs_078.cpp b/testsuites/unittest/fs/jffs/full/It_vfs_jffs_078.cpp index 7399288b..c9d5c6d7 100644 --- a/testsuites/unittest/fs/jffs/full/It_vfs_jffs_078.cpp +++ b/testsuites/unittest/fs/jffs/full/It_vfs_jffs_078.cpp @@ -48,7 +48,7 @@ static UINT32 Testcase(VOID) fd1 = open(pathname1, O_NONBLOCK | O_CREAT | O_RDWR | O_EXCL, HIGHEST_AUTHORITY); ICUNIT_GOTO_NOT_EQUAL(fd1, -1, fd1, EXIT1); - strcat_s(pathname2, sizeof(pathname2), "/test"); + strcat_s(pathname2, sizeof(pathname2), "/TEst"); fd2 = open(pathname2, O_NONBLOCK | O_CREAT | O_RDWR | O_EXCL, HIGHEST_AUTHORITY); ICUNIT_GOTO_NOT_EQUAL(fd2, -1, fd2, EXIT2); diff --git a/testsuites/unittest/fs/jffs/full/It_vfs_jffs_215.cpp b/testsuites/unittest/fs/jffs/full/It_vfs_jffs_215.cpp index 70ad022a..6927fc30 100644 --- a/testsuites/unittest/fs/jffs/full/It_vfs_jffs_215.cpp +++ b/testsuites/unittest/fs/jffs/full/It_vfs_jffs_215.cpp @@ -48,7 +48,7 @@ static UINT32 TestCase(VOID) ICUNIT_GOTO_NOT_EQUAL(pret, NULL, pret, EXIT); ICUNIT_GOTO_STRING_EQUAL(buf, JFFS_PATH_NAME0, buf, EXIT); - pret = getcwd(buf, JFFS_STANDARD_NAME_LENGTH); + pret = getcwd(buf, 5); // 5 is less than path length ICUNIT_GOTO_EQUAL(pret, NULL, pret, EXIT); ICUNIT_GOTO_EQUAL(errno, ERANGE, errno, EXIT); diff --git a/testsuites/unittest/fs/jffs/full/It_vfs_jffs_427.cpp b/testsuites/unittest/fs/jffs/full/It_vfs_jffs_427.cpp index a36d242f..4f3b227c 100644 --- a/testsuites/unittest/fs/jffs/full/It_vfs_jffs_427.cpp +++ b/testsuites/unittest/fs/jffs/full/It_vfs_jffs_427.cpp @@ -105,12 +105,12 @@ static UINT32 Testcase(VOID) memset(bufW2, 0, JFFS_SHORT_ARRAY_LENGTH + 1); off = lseek(fd3, 0, SEEK_SET); - ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT6); + ICUNIT_GOTO_EQUAL(off, JFFS_NO_ERROR, off, EXIT6); g_jffsIov[0].iov_base = bufW1; - g_jffsIov[0].iov_len = 0xffff; + g_jffsIov[0].iov_len = JFFS_SHORT_ARRAY_LENGTH; g_jffsIov[1].iov_base = bufW2; - g_jffsIov[1].iov_len = 0xffff; + g_jffsIov[1].iov_len = JFFS_SHORT_ARRAY_LENGTH; lenV = readv(fd3, g_jffsIov, 2); // reads 2 buffers from the fd ICUNIT_GOTO_EQUAL(lenV, 20, lenV, EXIT6); // compare ret lenV to target 20 lenV diff --git a/testsuites/unittest/fs/jffs/pressure/It_fs_jffs_performance_009.cpp b/testsuites/unittest/fs/jffs/pressure/It_fs_jffs_performance_009.cpp index ac22734f..3d744ad5 100644 --- a/testsuites/unittest/fs/jffs/pressure/It_fs_jffs_performance_009.cpp +++ b/testsuites/unittest/fs/jffs/pressure/It_fs_jffs_performance_009.cpp @@ -75,6 +75,8 @@ static UINT32 TestCase(VOID) len = write(fd[index], bufW, strlen(bufW)); if (len <= 0) { flag = 1; + ret = close(fd[index]); + ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT2); break; } diff --git a/testsuites/unittest/fs/jffs/pressure/It_fs_jffs_pressure_023.cpp b/testsuites/unittest/fs/jffs/pressure/It_fs_jffs_pressure_023.cpp index 2c827eeb..842ed161 100644 --- a/testsuites/unittest/fs/jffs/pressure/It_fs_jffs_pressure_023.cpp +++ b/testsuites/unittest/fs/jffs/pressure/It_fs_jffs_pressure_023.cpp @@ -38,6 +38,7 @@ static UINT32 TestCase(VOID) INT32 i = 0; INT32 j = 0; INT32 k = JFFS_SHORT_ARRAY_LENGTH; + INT32 jffsPressureCycles = 4; // write size 4 * 1024 * 1024 signed long long offset; CHAR filebuf[FILE_BUF_SIZE] = @@ -101,11 +102,11 @@ static UINT32 TestCase(VOID) fd = open(pathname1, O_NONBLOCK | O_CREAT | O_RDWR | O_EXCL, HIGHEST_AUTHORITY); ICUNIT_GOTO_NOT_EQUAL(fd, -1, fd, EXIT2); - for (j = 0; j < JFFS_PRESSURE_CYCLES; j++) { + for (j = 0; j < jffsPressureCycles; j++) { off = lseek(fd, 0, SEEK_SET); ICUNIT_GOTO_EQUAL(off, 0, off, EXIT2); - for (i = 0; i < JFFS_PRESSURE_CYCLES; i++) { + for (i = 0; i < jffsPressureCycles; i++) { ret = write(fd, bufW, strlen(bufW)); printf("cnt=%d %d\n", i, j); ICUNIT_GOTO_EQUAL(ret, BYTES_PER_MBYTE, ret, EXIT2); @@ -115,8 +116,8 @@ static UINT32 TestCase(VOID) } ret = stat(pathname1, &statfile); ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT2); - // file size: 10 * 1024 * 1024 - ICUNIT_GOTO_EQUAL(statfile.st_size, 10 * 1024 * 1024, statfile.st_size, EXIT2); + // file size: 4 * 1024 * 1024 + ICUNIT_GOTO_EQUAL(statfile.st_size, 4 * 1024 * 1024, statfile.st_size, EXIT2); } ret = close(fd); diff --git a/testsuites/unittest/fs/jffs/pressure/It_fs_jffs_pressure_026.cpp b/testsuites/unittest/fs/jffs/pressure/It_fs_jffs_pressure_026.cpp index 8b4fb549..c0075f20 100644 --- a/testsuites/unittest/fs/jffs/pressure/It_fs_jffs_pressure_026.cpp +++ b/testsuites/unittest/fs/jffs/pressure/It_fs_jffs_pressure_026.cpp @@ -44,7 +44,7 @@ static UINT32 TestCase(VOID) CHAR readbuf[JFFS_STANDARD_NAME_LENGTH] = "liteos"; CHAR bufname[JFFS_STANDARD_NAME_LENGTH] = "123"; CHAR pathname1[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME0 }; - CHAR pathname2[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME0 }; + CHAR pathname2[JFFS_NAME_LIMITTED_SIZE] = { JFFS_PATH_NAME0 }; CHAR pathname3[JFFS_SHORT_ARRAY_LENGTH][JFFS_NAME_LIMITTED_SIZE] = {0}; CHAR pathname4[JFFS_SHORT_ARRAY_LENGTH][JFFS_NAME_LIMITTED_SIZE] = {0}; CHAR pathname5[JFFS_SHORT_ARRAY_LENGTH][JFFS_NAME_LIMITTED_SIZE] = {0}; @@ -67,7 +67,8 @@ static UINT32 TestCase(VOID) for (i = 0; i < JFFS_SHORT_ARRAY_LENGTH; i++) { snprintf_s(bufname, JFFS_STANDARD_NAME_LENGTH, JFFS_STANDARD_NAME_LENGTH - 1, "/test%d", i); - strcat_s(pathname2, JFFS_STANDARD_NAME_LENGTH, bufname); + strcat_s(pathname2, JFFS_NAME_LIMITTED_SIZE, bufname); + strcpy_s(pathname3[i], JFFS_NAME_LIMITTED_SIZE, pathname2); ret = mkdir(pathname3[i], HIGHEST_AUTHORITY); diff --git a/testsuites/unittest/fs/jffs/pressure/It_fs_jffs_pressure_033.cpp b/testsuites/unittest/fs/jffs/pressure/It_fs_jffs_pressure_033.cpp index e6e486aa..04498908 100644 --- a/testsuites/unittest/fs/jffs/pressure/It_fs_jffs_pressure_033.cpp +++ b/testsuites/unittest/fs/jffs/pressure/It_fs_jffs_pressure_033.cpp @@ -170,7 +170,7 @@ static VOID *PthreadF02(void *arg) CHAR *bufR = NULL; CHAR *bufW = NULL; off_t off; - INT32 bufRSize = 6075; // 6075: read length + INT32 bufRSize = 6074; // 6074: read length ret = pthread_mutex_lock(&g_jffs2GlobalLock1); printf("[%d] Thread2 Start frist get lock\n", __LINE__); diff --git a/testsuites/unittest/fs/jffs/pressure/It_fs_jffs_pressure_047.cpp b/testsuites/unittest/fs/jffs/pressure/It_fs_jffs_pressure_047.cpp index 10c0ebb0..2e207ae3 100644 --- a/testsuites/unittest/fs/jffs/pressure/It_fs_jffs_pressure_047.cpp +++ b/testsuites/unittest/fs/jffs/pressure/It_fs_jffs_pressure_047.cpp @@ -34,7 +34,7 @@ static VOID *PthreadF01(void *arg) { INT32 ret, len; - UINT32 writeSize = JFFS_PRESSURE_W_R_SIZE2; + UINT32 writeSize = JFFS_PRESSURE_W_R_SIZE1; CHAR pathname1[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME0 }; CHAR writebuf[JFFS_STANDARD_NAME_LENGTH] = "0123456789"; CHAR *writeBuf = NULL; @@ -66,7 +66,7 @@ static VOID *PthreadF01(void *arg) printf("[%d]lseek64 off64:%lld Fd:%d \n", __LINE__, off64, g_jffsFd); ICUNIT_GOTO_EQUAL(statbuf1.st_size, off64, statbuf1.st_size, EXIT1); - len = write(g_jffsFd, writebuf, strlen(writebuf)); + len = write(g_jffsFd, writeBuf, strlen(writeBuf)); printf("[%d]lseek64 len:%d Fd:%d, errno:%d\n", __LINE__, len, g_jffsFd, errno); ICUNIT_GOTO_EQUAL(len, JFFS_IS_ERROR, len, EXIT1); ICUNIT_GOTO_EQUAL(errno, ENOSPC, errno, EXIT1); diff --git a/testsuites/unittest/fs/jffs/pressure/It_fs_jffs_pressure_052.cpp b/testsuites/unittest/fs/jffs/pressure/It_fs_jffs_pressure_052.cpp index 06ea0f94..de6b6c9a 100644 --- a/testsuites/unittest/fs/jffs/pressure/It_fs_jffs_pressure_052.cpp +++ b/testsuites/unittest/fs/jffs/pressure/It_fs_jffs_pressure_052.cpp @@ -98,8 +98,9 @@ static VOID *PthreadF01(void *arg) testSpeed); return NULL; -EXIT: +EXIT1: close(g_jffsFd); +EXIT: return NULL; } diff --git a/testsuites/unittest/fs/jffs/pressure/It_fs_jffs_pressure_310.cpp b/testsuites/unittest/fs/jffs/pressure/It_fs_jffs_pressure_310.cpp index 3549107e..bec8b3f2 100644 --- a/testsuites/unittest/fs/jffs/pressure/It_fs_jffs_pressure_310.cpp +++ b/testsuites/unittest/fs/jffs/pressure/It_fs_jffs_pressure_310.cpp @@ -33,7 +33,8 @@ static UINT32 TestCase(VOID) { - INT32 ret, i; + INT32 ret; + INT32 i = 0; INT32 scandirCount = 0; CHAR pathname1[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME0 }; CHAR pathname2[JFFS_NAME_LIMITTED_SIZE] = ""; @@ -52,7 +53,6 @@ static UINT32 TestCase(VOID) memset_s(pathname2, JFFS_NAME_LIMITTED_SIZE, 0, JFFS_NAME_LIMITTED_SIZE); memset_s(pathname3, JFFS_NAME_LIMITTED_SIZE, 0, JFFS_NAME_LIMITTED_SIZE); strcat_s(pathname6, JFFS_NAME_LIMITTED_SIZE, "/"); - // PATH_MAX test. The dirname has occupied 14 bytes. while (i < 241) { // loop times: 241 i++; diff --git a/testsuites/unittest/fs/jffs/pressure/It_fs_jffs_pressure_311.cpp b/testsuites/unittest/fs/jffs/pressure/It_fs_jffs_pressure_311.cpp index 5b36e4b7..40fa396c 100644 --- a/testsuites/unittest/fs/jffs/pressure/It_fs_jffs_pressure_311.cpp +++ b/testsuites/unittest/fs/jffs/pressure/It_fs_jffs_pressure_311.cpp @@ -33,7 +33,8 @@ static UINT32 TestCase(VOID) { - INT32 ret, i; + INT32 ret; + INT32 i = 0; INT32 fd = -1; INT32 scandirCount = 0; CHAR pathname1[JFFS_STANDARD_NAME_LENGTH] = { JFFS_MAIN_DIR0 }; @@ -82,7 +83,7 @@ static UINT32 TestCase(VOID) ICUNIT_GOTO_EQUAL(strlen(pathname3), 256, strlen(pathname3), EXIT); // pathname length: 256 fd = open(pathname3, O_NONBLOCK | O_CREAT | O_RDWR | O_EXCL, HIGHEST_AUTHORITY); ICUNIT_GOTO_EQUAL(fd, -1, fd, EXIT1); - ICUNIT_GOTO_EQUAL(errno, ENAMETOOLONG, errno, EXIT2); + ICUNIT_GOTO_EQUAL(errno, EINVAL, errno, EXIT2); ret = chdir("/"); ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT2); diff --git a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_002.cpp b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_002.cpp index 98175ae3..f09d48cd 100644 --- a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_002.cpp +++ b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_002.cpp @@ -40,6 +40,7 @@ static VOID *PthreadF01(void *arg) INT32 i = 0; INT32 j = 0; INT32 k = JFFS_SHORT_ARRAY_LENGTH; + INT32 jffsMaxCycles = 1; // 1 means 1 * 1024 * 1024 byte size CHAR filebuf[FILE_BUF_SIZE] = "abcdeabcde0123456789abcedfghij9876543210abcdeabcde0123456789abcedfghij9876543210abcdeabcde0123" "456789abcedfghij9876543210abcdeabcde0123456789abcedfghij9876543210abcdeabcde0123456789abcedfgh" @@ -87,7 +88,7 @@ static VOID *PthreadF01(void *arg) strcat_s(pathname2, JFFS_STANDARD_NAME_LENGTH, "/004.txt"); // /storage/test/004.txt fd1 = open(pathname2, O_NONBLOCK | O_CREAT | O_RDWR | O_EXCL, HIGHEST_AUTHORITY); - ICUNIT_GOTO_NOT_EQUAL(fd, JFFS_IS_ERROR, fd, EXIT2); + ICUNIT_GOTO_NOT_EQUAL(fd1, JFFS_IS_ERROR, fd1, EXIT2); len = write(fd1, writebuf, strlen(writebuf)); ICUNIT_GOTO_EQUAL(len, strlen(writebuf), len, EXIT2); @@ -112,7 +113,7 @@ static VOID *PthreadF01(void *arg) off = lseek(fd, 0, SEEK_SET); ICUNIT_GOTO_EQUAL(off, JFFS_NO_ERROR, off, EXIT2); - for (i = 0; i < JFFS_MAX_CYCLES; i++) { + for (i = 0; i < jffsMaxCycles; i++) { ret = write(fd, bufW, strlen(bufW)); ICUNIT_GOTO_EQUAL(ret, BYTES_PER_MBYTE, ret, EXIT2); @@ -131,8 +132,8 @@ static VOID *PthreadF01(void *arg) ret = stat(pathname1, &statfile); ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT2); - // 5 * 1024 * 1024: filesize - ICUNIT_GOTO_EQUAL(statfile.st_size, 5 * 1024 * 1024, statfile.st_size, EXIT2); + // 1 * 1024 * 1024: filesize + ICUNIT_GOTO_EQUAL(statfile.st_size, 1 * 1024 * 1024, statfile.st_size, EXIT2); ret = close(fd); ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT2); @@ -167,6 +168,7 @@ static VOID *PthreadF02(void *arg) INT32 i = 0; INT32 j = 0; INT32 k = JFFS_SHORT_ARRAY_LENGTH; + INT32 jffsMaxCycles = 1; // 1 means 1 * 1024 * 1024 byte size CHAR filebuf[FILE_BUF_SIZE] = "abcdeabcde0123456789abcedfghij9876543210abcdeabcde0123456789abcedfghij9876543210abcdeabcde0123" "456789abcedfghij9876543210abcdeabcde0123456789abcedfghij9876543210abcdeabcde0123456789abcedfgh" @@ -213,7 +215,7 @@ static VOID *PthreadF02(void *arg) strcat_s(pathname2, JFFS_STANDARD_NAME_LENGTH, "/005.txt"); fd1 = open(pathname2, O_NONBLOCK | O_CREAT | O_RDWR | O_EXCL, HIGHEST_AUTHORITY); - ICUNIT_GOTO_NOT_EQUAL(fd, JFFS_IS_ERROR, fd, EXIT2); + ICUNIT_GOTO_NOT_EQUAL(fd1, JFFS_IS_ERROR, fd1, EXIT2); len = write(fd1, writebuf, strlen(writebuf)); ICUNIT_GOTO_EQUAL(len, strlen(writebuf), len, EXIT2); @@ -238,7 +240,7 @@ static VOID *PthreadF02(void *arg) off = lseek(fd, 0, SEEK_SET); ICUNIT_GOTO_EQUAL(off, JFFS_NO_ERROR, off, EXIT2); - for (i = 0; i < JFFS_MAX_CYCLES; i++) { + for (i = 0; i < jffsMaxCycles; i++) { ret = write(fd, bufW, strlen(bufW)); ICUNIT_GOTO_EQUAL(ret, BYTES_PER_MBYTE, ret, EXIT2); @@ -257,8 +259,8 @@ static VOID *PthreadF02(void *arg) ret = stat(pathname1, &statfile); ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT2); - // 5 * 1024 * 1024: filesize - ICUNIT_GOTO_EQUAL(statfile.st_size, 5 * 1024 * 1024, statfile.st_size, EXIT2); + // 1 * 1024 * 1024: filesize + ICUNIT_GOTO_EQUAL(statfile.st_size, 1 * 1024 * 1024, statfile.st_size, EXIT2); ret = close(fd); ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT2); @@ -293,6 +295,7 @@ static VOID *PthreadF03(void *arg) INT32 i = 0; INT32 j = 0; INT32 k = JFFS_SHORT_ARRAY_LENGTH; + INT32 jffsMaxCycles = 1; // 1 means 1 * 1024 * 1024 byte size CHAR filebuf[FILE_BUF_SIZE] = "abcdeabcde0123456789abcedfghij9876543210abcdeabcde0123456789abcedfghij9876543210abcdeabcde0123" "456789abcedfghij9876543210abcdeabcde0123456789abcedfghij9876543210abcdeabcde0123456789abcedfgh" @@ -339,7 +342,7 @@ static VOID *PthreadF03(void *arg) strcat_s(pathname2, JFFS_STANDARD_NAME_LENGTH, "/006.txt"); fd1 = open(pathname2, O_NONBLOCK | O_CREAT | O_RDWR | O_EXCL, HIGHEST_AUTHORITY); - ICUNIT_GOTO_NOT_EQUAL(fd, JFFS_IS_ERROR, fd, EXIT2); + ICUNIT_GOTO_NOT_EQUAL(fd1, JFFS_IS_ERROR, fd1, EXIT2); len = write(fd1, writebuf, strlen(writebuf)); ICUNIT_GOTO_EQUAL(len, strlen(writebuf), len, EXIT2); @@ -364,7 +367,7 @@ static VOID *PthreadF03(void *arg) off = lseek(fd, 0, SEEK_SET); ICUNIT_GOTO_EQUAL(off, JFFS_NO_ERROR, off, EXIT2); - for (i = 0; i < JFFS_MAX_CYCLES; i++) { + for (i = 0; i < jffsMaxCycles; i++) { ret = write(fd, bufW, strlen(bufW)); ICUNIT_GOTO_EQUAL(ret, BYTES_PER_MBYTE, ret, EXIT2); @@ -383,8 +386,8 @@ static VOID *PthreadF03(void *arg) ret = stat(pathname1, &statfile); ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT2); - // 5 * 1024 * 1024: filesize - ICUNIT_GOTO_EQUAL(statfile.st_size, 5 * 1024 * 1024, statfile.st_size, EXIT2); + // 1 * 1024 * 1024: filesize + ICUNIT_GOTO_EQUAL(statfile.st_size, 1 * 1024 * 1024, statfile.st_size, EXIT2); ret = close(fd); ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT2); diff --git a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_014.cpp b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_014.cpp index 6173228a..da8bed12 100644 --- a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_014.cpp +++ b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_014.cpp @@ -30,7 +30,7 @@ */ #include "It_vfs_jffs.h" -static INT32 g_testNum = 20; +static INT32 g_testNum = 2; static VOID *PthreadF01(void *arg) { diff --git a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_015.cpp b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_015.cpp index 0f963dfc..2c1b72f4 100644 --- a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_015.cpp +++ b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_015.cpp @@ -48,7 +48,7 @@ static VOID *PthreadF01(void *arg) "456789abcedfghij9876543210abcdeabcde0123456789abcedfghij9876543210abcdeabcde0123456789abcedfgh" "ij9876543210abcdeabcde0123456789abcedfghij9876543210lalalalalalalala"; CHAR *bufW = NULL; - INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB + INT32 bufWLen = 4 * BYTES_PER_KBYTE; // 4 KB flag = 0; bufW = (CHAR *)malloc(BYTES_PER_MBYTE + 1); @@ -224,7 +224,7 @@ static VOID *PthreadF02(void *arg) "456789abcedfghij9876543210abcdeabcde0123456789abcedfghij9876543210abcdeabcde0123456789abcedfgh" "ij9876543210abcdeabcde0123456789abcedfghij9876543210lalalalalalalala"; CHAR *bufW = NULL; - INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB + INT32 bufWLen = 4 * BYTES_PER_KBYTE; // 4 KB flag = 0; bufW = (CHAR *)malloc(BYTES_PER_MBYTE + 1); @@ -400,7 +400,7 @@ static VOID *PthreadF03(void *arg) "456789abcedfghij9876543210abcdeabcde0123456789abcedfghij9876543210abcdeabcde0123456789abcedfgh" "ij9876543210abcdeabcde0123456789abcedfghij9876543210lalalalalalalala"; CHAR *bufW = NULL; - INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB + INT32 bufWLen = 4 * BYTES_PER_KBYTE; // 4 KB flag = 0; bufW = (CHAR *)malloc(BYTES_PER_MBYTE + 1); diff --git a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_016.cpp b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_016.cpp index 33752c4e..fde6104e 100644 --- a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_016.cpp +++ b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_016.cpp @@ -49,7 +49,7 @@ static VOID *PthreadF01(void *arg) "456789abcedfghij9876543210abcdeabcde0123456789abcedfghij9876543210abcdeabcde0123456789abcedfgh" "ij9876543210abcdeabcde0123456789abcedfghij9876543210lalalalalalalala"; CHAR *bufW = NULL; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 16 * BYTES_PER_KBYTE; // 16 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); @@ -219,7 +219,7 @@ static VOID *PthreadF02(void *arg) DIR *dirbuf[100] = {NULL}; struct stat buf1 = { 0 }; struct stat buf2 = { 0 }; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 16 * BYTES_PER_KBYTE; // 16 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); @@ -390,7 +390,7 @@ static VOID *PthreadF03(void *arg) DIR *dirbuf[100] = {NULL}; struct stat buf1 = { 0 }; struct stat buf2 = { 0 }; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 16 * BYTES_PER_KBYTE; // 16 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); diff --git a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_017.cpp b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_017.cpp index 6600a7e2..63cad8e1 100644 --- a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_017.cpp +++ b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_017.cpp @@ -47,7 +47,7 @@ static VOID *PthreadF01(void *arg) DIR *dirbuf[100] = {NULL}; struct stat buf1 = { 0 }; struct stat buf2 = { 0 }; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 128 * BYTES_PER_KBYTE; // 128 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); @@ -150,7 +150,7 @@ static VOID *PthreadF02(void *arg) DIR *dirbuf[100] = {NULL}; struct stat buf1 = { 0 }; struct stat buf2 = { 0 }; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 128 * BYTES_PER_KBYTE; // 128 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); @@ -256,7 +256,7 @@ static VOID *PthreadF03(void *arg) DIR *dirbuf[100] = {NULL}; struct stat buf1 = { 0 }; struct stat buf2 = { 0 }; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 128 * BYTES_PER_KBYTE; // 128 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); diff --git a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_018.cpp b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_018.cpp index f4047664..6c097601 100644 --- a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_018.cpp +++ b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_018.cpp @@ -49,7 +49,7 @@ static VOID *PthreadF01(void *arg) "456789abcedfghij9876543210abcdeabcde0123456789abcedfghij9876543210abcdeabcde0123456789abcedfgh" "ij9876543210abcdeabcde0123456789abcedfghij9876543210lalalalalalalala"; CHAR *bufW = NULL; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); @@ -217,7 +217,7 @@ static VOID *PthreadF02(void *arg) "456789abcedfghij9876543210abcdeabcde0123456789abcedfghij9876543210abcdeabcde0123456789abcedfgh" "ij9876543210abcdeabcde0123456789abcedfghij9876543210lalalalalalalala"; CHAR *bufW = NULL; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); @@ -388,7 +388,7 @@ static VOID *PthreadF03(void *arg) "456789abcedfghij9876543210abcdeabcde0123456789abcedfghij9876543210abcdeabcde0123456789abcedfgh" "ij9876543210abcdeabcde0123456789abcedfghij9876543210lalalalalalalala"; CHAR *bufW = NULL; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); diff --git a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_019.cpp b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_019.cpp index cdfb448f..cd24c4cf 100644 --- a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_019.cpp +++ b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_019.cpp @@ -45,7 +45,7 @@ static VOID *PthreadF01(void *arg) CHAR writebuf[20] = "0123456789"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); @@ -153,7 +153,7 @@ static VOID *PthreadF02(void *arg) CHAR writebuf[20] = "0123456789"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); @@ -262,7 +262,7 @@ static VOID *PthreadF03(void *arg) CHAR writebuf[20] = "0123456789"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); diff --git a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_020.cpp b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_020.cpp index ff23eca5..079ada44 100644 --- a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_020.cpp +++ b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_020.cpp @@ -45,7 +45,7 @@ static VOID *PthreadF01(void *arg) CHAR writebuf[20] = "0123456789"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); @@ -153,7 +153,7 @@ static VOID *PthreadF02(void *arg) CHAR writebuf[20] = "0000"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); @@ -260,7 +260,7 @@ static VOID *PthreadF03(void *arg) CHAR writebuf[20] = "0000"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); diff --git a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_021.cpp b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_021.cpp index 4a1f5323..ef2ffbb7 100644 --- a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_021.cpp +++ b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_021.cpp @@ -44,7 +44,7 @@ static VOID *PthreadF01(void *arg) CHAR writebuf[20] = "0123456789"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); @@ -151,7 +151,7 @@ static VOID *PthreadF02(void *arg) CHAR writebuf[20] = "0000"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); @@ -257,7 +257,7 @@ static VOID *PthreadF03(void *arg) CHAR writebuf[20] = "0000"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); diff --git a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_022.cpp b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_022.cpp index 6d003662..59e7a066 100644 --- a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_022.cpp +++ b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_022.cpp @@ -44,7 +44,7 @@ static VOID *PthreadF01(void *arg) CHAR writebuf[20] = "0123456789"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); @@ -151,7 +151,7 @@ static VOID *PthreadF02(void *arg) CHAR writebuf[20] = "0000"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); @@ -260,7 +260,7 @@ static VOID *PthreadF03(void *arg) CHAR writebuf[20] = "0123456789"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); diff --git a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_023.cpp b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_023.cpp index 77dd872e..962a5d3c 100644 --- a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_023.cpp +++ b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_023.cpp @@ -44,7 +44,7 @@ static VOID *PthreadF01(void *arg) CHAR writebuf[20] = "0123456789"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); @@ -153,7 +153,7 @@ static VOID *PthreadF02(void *arg) CHAR writebuf[20] = "0000"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); @@ -261,7 +261,7 @@ static VOID *PthreadF03(void *arg) CHAR writebuf[20] = "0000"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); diff --git a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_024.cpp b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_024.cpp index 9ad59b44..c08fb7cb 100644 --- a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_024.cpp +++ b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_024.cpp @@ -45,7 +45,7 @@ static VOID *PthreadF01(void *arg) CHAR writebuf[20] = "0123456789"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); @@ -153,7 +153,7 @@ static VOID *PthreadF02(void *arg) CHAR writebuf[20] = "0000"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); @@ -260,7 +260,7 @@ static VOID *PthreadF03(void *arg) CHAR writebuf[20] = "0000"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); diff --git a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_025.cpp b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_025.cpp index 735e5276..047d1e90 100644 --- a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_025.cpp +++ b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_025.cpp @@ -44,7 +44,7 @@ static VOID *PthreadF01(void *arg) "456789abcedfghij9876543210abcdeabcde0123456789abcedfghij9876543210abcdeabcde0123456789abcedfgh" "ij9876543210abcdeabcde0123456789abcedfghij9876543210lalalalalalalala"; CHAR *bufW = NULL; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB bufW = (CHAR *)malloc(bufWLen + 1); ICUNIT_ASSERT_NOT_EQUAL_NULL(bufW, NULL, NULL); @@ -107,7 +107,7 @@ static VOID *PthreadF02(void *arg) "456789abcedfghij9876543210abcdeabcde0123456789abcedfghij9876543210abcdeabcde0123456789abcedfgh" "ij9876543210abcdeabcde0123456789abcedfghij9876543210lalalalalalalala"; CHAR *bufW = NULL; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB bufW = (CHAR *)malloc(bufWLen + 1); ICUNIT_ASSERT_NOT_EQUAL_NULL(bufW, NULL, NULL); @@ -170,7 +170,7 @@ static VOID *PthreadF03(void *arg) "456789abcedfghij9876543210abcdeabcde0123456789abcedfghij9876543210abcdeabcde0123456789abcedfgh" "ij9876543210abcdeabcde0123456789abcedfghij9876543210lalalalalalalala"; CHAR *bufW = NULL; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB bufW = (CHAR *)malloc(bufWLen + 1); ICUNIT_ASSERT_NOT_EQUAL_NULL(bufW, NULL, NULL); diff --git a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_036.cpp b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_036.cpp index a23040fd..13e106f0 100644 --- a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_036.cpp +++ b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_036.cpp @@ -43,7 +43,7 @@ static VOID *PthreadF01(void *arg) "456789abcedfghij9876543210abcdeabcde0123456789abcedfghij9876543210abcdeabcde0123456789abcedfgh" "ij9876543210abcdeabcde0123456789abcedfghij9876543210lalalalalalalala"; CHAR *bufW = NULL; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); @@ -147,7 +147,7 @@ static VOID *PthreadF02(void *arg) "456789abcedfghij9876543210abcdeabcde0123456789abcedfghij9876543210abcdeabcde0123456789abcedfgh" "ij9876543210abcdeabcde0123456789abcedfghij9876543210lalalalalalalala"; CHAR *bufW = NULL; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); @@ -251,7 +251,7 @@ static VOID *PthreadF03(void *arg) "456789abcedfghij9876543210abcdeabcde0123456789abcedfghij9876543210abcdeabcde0123456789abcedfgh" "ij9876543210abcdeabcde0123456789abcedfghij9876543210lalalalalalalala"; CHAR *bufW = NULL; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); diff --git a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_038.cpp b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_038.cpp index 93ed9ff7..55fb8abe 100644 --- a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_038.cpp +++ b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_038.cpp @@ -43,7 +43,7 @@ static VOID *PthreadF01(void *arg) "456789abcedfghij9876543210abcdeabcde0123456789abcedfghij9876543210abcdeabcde0123456789abcedfgh" "ij9876543210abcdeabcde0123456789abcedfghij9876543210lalalalalalalala"; CHAR *bufW = NULL; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); @@ -148,7 +148,7 @@ static VOID *PthreadF02(void *arg) "456789abcedfghij9876543210abcdeabcde0123456789abcedfghij9876543210abcdeabcde0123456789abcedfgh" "ij9876543210abcdeabcde0123456789abcedfghij9876543210lalalalalalalala"; CHAR *bufW = NULL; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); @@ -253,7 +253,7 @@ static VOID *PthreadF03(void *arg) "456789abcedfghij9876543210abcdeabcde0123456789abcedfghij9876543210abcdeabcde0123456789abcedfgh" "ij9876543210abcdeabcde0123456789abcedfghij9876543210lalalalalalalala"; CHAR *bufW = NULL; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); diff --git a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_039.cpp b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_039.cpp index 1137fe71..9d3ce6ce 100644 --- a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_039.cpp +++ b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_039.cpp @@ -44,7 +44,7 @@ static VOID *PthreadF01(void *arg) CHAR writebuf[20] = "0123456789"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); @@ -156,7 +156,7 @@ static VOID *PthreadF02(void *arg) CHAR writebuf[20] = "0123456789"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); @@ -267,7 +267,7 @@ static VOID *PthreadF03(void *arg) CHAR writebuf[20] = "0123456789"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); diff --git a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_040.cpp b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_040.cpp index 5709c906..d1eaae8d 100644 --- a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_040.cpp +++ b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_040.cpp @@ -44,7 +44,7 @@ static VOID *PthreadF01(void *arg) CHAR writebuf[20] = "0123456789"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); @@ -156,7 +156,7 @@ static VOID *PthreadF02(void *arg) CHAR writebuf[20] = "0123456789"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); @@ -267,7 +267,7 @@ static VOID *PthreadF03(void *arg) CHAR writebuf[20] = "0123456789"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); diff --git a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_041.cpp b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_041.cpp index 95b1a84d..516ac388 100644 --- a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_041.cpp +++ b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_041.cpp @@ -44,7 +44,7 @@ static VOID *PthreadF01(void *arg) CHAR writebuf[20] = "0123456789"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); @@ -156,7 +156,7 @@ static VOID *PthreadF02(void *arg) CHAR writebuf[20] = "0123456789"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); @@ -267,7 +267,7 @@ static VOID *PthreadF03(void *arg) CHAR writebuf[20] = "0123456789"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); diff --git a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_042.cpp b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_042.cpp index 73a96e72..5786640d 100644 --- a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_042.cpp +++ b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_042.cpp @@ -45,7 +45,7 @@ static VOID *PthreadF01(void *arg) CHAR writebuf[20] = "0123456789"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); @@ -158,7 +158,7 @@ static VOID *PthreadF02(void *arg) CHAR writebuf[20] = "0123456789"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); @@ -270,7 +270,7 @@ static VOID *PthreadF03(void *arg) CHAR writebuf[20] = "0123456789"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); diff --git a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_043.cpp b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_043.cpp index d8297b09..b5d8dcf8 100644 --- a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_043.cpp +++ b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_043.cpp @@ -45,7 +45,7 @@ static VOID *PthreadF01(void *arg) CHAR writebuf[20] = "0123456789"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); @@ -158,7 +158,7 @@ static VOID *PthreadF02(void *arg) CHAR writebuf[20] = "0123456789"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); @@ -270,7 +270,7 @@ static VOID *PthreadF03(void *arg) CHAR writebuf[20] = "0123456789"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); diff --git a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_044.cpp b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_044.cpp index 6330ae3d..543b261a 100644 --- a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_044.cpp +++ b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_044.cpp @@ -45,7 +45,7 @@ static VOID *PthreadF01(void *arg) CHAR writebuf[20] = "0123456789"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); @@ -158,7 +158,7 @@ static VOID *PthreadF02(void *arg) CHAR writebuf[20] = "0123456789"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); @@ -270,7 +270,7 @@ static VOID *PthreadF03(void *arg) CHAR writebuf[20] = "0123456789"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); diff --git a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_045.cpp b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_045.cpp index 7ab2bf69..0ebe9c36 100644 --- a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_045.cpp +++ b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_045.cpp @@ -45,7 +45,7 @@ static VOID *PthreadF01(void *arg) CHAR writebuf[20] = "0123456789"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); @@ -158,7 +158,7 @@ static VOID *PthreadF02(void *arg) CHAR writebuf[20] = "0123456789"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); @@ -270,7 +270,7 @@ static VOID *PthreadF03(void *arg) CHAR writebuf[20] = "0123456789"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); diff --git a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_046.cpp b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_046.cpp index 0ee85f36..a4269f45 100644 --- a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_046.cpp +++ b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_046.cpp @@ -45,7 +45,7 @@ static VOID *PthreadF01(void *arg) CHAR writebuf[20] = "0123456789"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); @@ -158,7 +158,7 @@ static VOID *PthreadF02(void *arg) CHAR writebuf[20] = "0123456789"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); @@ -270,7 +270,7 @@ static VOID *PthreadF03(void *arg) CHAR writebuf[20] = "0123456789"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); diff --git a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_047.cpp b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_047.cpp index 9cb76484..b17c81f5 100644 --- a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_047.cpp +++ b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_047.cpp @@ -45,7 +45,7 @@ static VOID *PthreadF01(void *arg) CHAR writebuf[20] = "0123456789"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); @@ -158,7 +158,7 @@ static VOID *PthreadF02(void *arg) CHAR writebuf[20] = "0123456789"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); @@ -270,7 +270,7 @@ static VOID *PthreadF03(void *arg) CHAR writebuf[20] = "0123456789"; CHAR *bufW = NULL; struct stat statbuf; - INT32 bufWLen = BYTES_PER_MBYTE; + INT32 bufWLen = 256 * BYTES_PER_KBYTE; // 256 KB flag = 0; bufW = (CHAR *)malloc(bufWLen + 1); diff --git a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_052.cpp b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_052.cpp index a4529fae..fe64c537 100644 --- a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_052.cpp +++ b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_052.cpp @@ -71,8 +71,6 @@ static VOID *MutiJffs05202(void *arg) strcat_s(pathname, JFFS_STANDARD_NAME_LENGTH, "/test_52"); - ICUNIT_GOTO_EQUAL(g_TestCnt, 0, g_TestCnt, EXIT); - // file size: 1024, write size: 1024 ret = JffsMultiWrite(pathname, 1024, 1024, O_RDWR | O_CREAT, JFFS_WR_TYPE_TEST); ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT); diff --git a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_053.cpp b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_053.cpp index 57639165..454c190c 100644 --- a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_053.cpp +++ b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_053.cpp @@ -68,7 +68,6 @@ static VOID *MutiJffs05302(void *arg) dprintf(" start muti_jffs_053_02 1 \n"); strcat_s(pathname, JFFS_STANDARD_NAME_LENGTH, "/test_53"); - ICUNIT_GOTO_EQUAL(g_TestCnt, 0, g_TestCnt, EXIT); fd = open(pathname, O_RDONLY, HIGHEST_AUTHORITY); ICUNIT_GOTO_NOT_EQUAL(fd, JFFS_IS_ERROR, fd, EXIT); diff --git a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_054.cpp b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_054.cpp index b6edd489..0ca30aa1 100644 --- a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_054.cpp +++ b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_054.cpp @@ -69,7 +69,6 @@ static VOID *MutiJffs05402(void *arg) dprintf(" start muti_jffs_054_02 1 \n"); strcat_s(pathname, JFFS_STANDARD_NAME_LENGTH, "/test_54"); - ICUNIT_GOTO_EQUAL(g_TestCnt, 0, g_TestCnt, EXIT); fd = open(pathname, O_WRONLY | O_CREAT, HIGHEST_AUTHORITY); ICUNIT_GOTO_NOT_EQUAL(fd, JFFS_IS_ERROR, fd, EXIT); diff --git a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_055.cpp b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_055.cpp index 083a137a..3c26506f 100644 --- a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_055.cpp +++ b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_055.cpp @@ -68,7 +68,6 @@ static VOID *MutiJffs05502(void *arg) dprintf(" start muti_jffs_055_02 1 \n"); strcat_s(pathname, JFFS_STANDARD_NAME_LENGTH, "/test_55"); - ICUNIT_GOTO_EQUAL(g_TestCnt, 0, g_TestCnt, EXIT); fd = open(pathname, O_WRONLY | O_CREAT, HIGHEST_AUTHORITY); ICUNIT_GOTO_NOT_EQUAL(fd, JFFS_IS_ERROR, fd, EXIT); diff --git a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_056.cpp b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_056.cpp index 69bc0f79..7a3de5d9 100644 --- a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_056.cpp +++ b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_056.cpp @@ -69,7 +69,6 @@ static VOID *MutiJffs05602(void *arg) strcat_s(pathname, JFFS_STANDARD_NAME_LENGTH, "/test_56"); strcat_s(pathname1, JFFS_STANDARD_NAME_LENGTH, "/test_56_rename"); - ICUNIT_GOTO_EQUAL(g_TestCnt, 0, g_TestCnt, EXIT); rename(pathname, pathname1); diff --git a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_057.cpp b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_057.cpp index eee55b4c..479eeb7b 100644 --- a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_057.cpp +++ b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_057.cpp @@ -66,7 +66,6 @@ static VOID *MutiJffs05702(void *arg) dprintf(" start muti_jffs_057_02 1 \n"); strcat_s(pathname, JFFS_STANDARD_NAME_LENGTH, "/test_57"); - ICUNIT_GOTO_EQUAL(g_TestCnt, 0, g_TestCnt, EXIT); umount(pathname); mount(JFFS_DEV_PATH0, JFFS_MAIN_DIR0, JFFS_FILESYS_TYPE, 0, NULL); diff --git a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_058.cpp b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_058.cpp index c7b92b9f..ffdc0c11 100644 --- a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_058.cpp +++ b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_058.cpp @@ -66,7 +66,6 @@ static VOID *MutiJffs05802(void *arg) CHAR pathname[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME0 }; dprintf(" start muti_jffs_058_02 1 \n"); strcat_s(pathname, JFFS_STANDARD_NAME_LENGTH, "/test_58"); - ICUNIT_GOTO_EQUAL(g_TestCnt, 0, g_TestCnt, EXIT); // file size: 1024, write size: 16 ret = JffsMultiWrite(pathname, 1024, 16, O_RDWR | O_CREAT, JFFS_WR_TYPE_TEST); diff --git a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_059.cpp b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_059.cpp index bfc980c8..909e76f2 100644 --- a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_059.cpp +++ b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_059.cpp @@ -70,7 +70,6 @@ static VOID *MutiJffs05902(void *arg) dprintf(" start muti_jffs_059_02 1 \n"); strcat_s(pathname, JFFS_STANDARD_NAME_LENGTH, "/test_59"); - ICUNIT_GOTO_EQUAL(g_TestCnt, 0, g_TestCnt, EXIT); fd = open(pathname, O_WRONLY | O_CREAT, HIGHEST_AUTHORITY); ICUNIT_GOTO_NOT_EQUAL(fd, JFFS_IS_ERROR, fd, EXIT); diff --git a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_060.cpp b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_060.cpp index b6649e5e..7e23e03f 100644 --- a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_060.cpp +++ b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_060.cpp @@ -70,7 +70,6 @@ static VOID *MutiJffs06002(void *arg) dprintf(" start muti_jffs_060_02 1 \n"); strcat_s(pathname, JFFS_STANDARD_NAME_LENGTH, "/test_60"); - ICUNIT_GOTO_EQUAL(g_TestCnt, 0, g_TestCnt, EXIT); fd = open(pathname, O_RDONLY | O_CREAT, HIGHEST_AUTHORITY); ICUNIT_GOTO_NOT_EQUAL(fd, JFFS_IS_ERROR, fd, EXIT); diff --git a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_061.cpp b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_061.cpp index 453ff4b2..e9147dc8 100644 --- a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_061.cpp +++ b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_061.cpp @@ -70,7 +70,6 @@ static VOID *MutiJffs06102(void *arg) dprintf(" start muti_jffs_061_02 1 \n"); strcat_s(pathname, JFFS_STANDARD_NAME_LENGTH, "/test_61"); - ICUNIT_GOTO_EQUAL(g_TestCnt, 0, g_TestCnt, EXIT); fd = open(pathname, O_RDONLY | O_CREAT, HIGHEST_AUTHORITY); ICUNIT_GOTO_NOT_EQUAL(fd, JFFS_IS_ERROR, fd, EXIT); diff --git a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_062.cpp b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_062.cpp index 0a213ffa..2bc77731 100644 --- a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_062.cpp +++ b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_062.cpp @@ -71,7 +71,6 @@ static VOID *MutiJffs06202(void *arg) dprintf(" start muti_jffs_062_02 1 \n"); strcat_s(pathname, JFFS_STANDARD_NAME_LENGTH, "/test_62"); strcat_s(pathname1, JFFS_STANDARD_NAME_LENGTH, "/test_62_rename"); - ICUNIT_GOTO_EQUAL(g_TestCnt, 0, g_TestCnt, EXIT); rename(pathname, pathname1); diff --git a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_063.cpp b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_063.cpp index 92955888..e192c193 100644 --- a/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_063.cpp +++ b/testsuites/unittest/fs/jffs/pressure/It_vfs_jffs_multipthread_063.cpp @@ -67,7 +67,6 @@ static VOID *MutiJffs06302(void *arg) dprintf(" start muti_jffs_063_02 1 \n"); strcat_s(pathname, JFFS_STANDARD_NAME_LENGTH, "/test_63"); - ICUNIT_GOTO_EQUAL(g_TestCnt, 0, g_TestCnt, EXIT); umount(pathname); diff --git a/testsuites/unittest/fs/jffs/vfs_jffs_test.cpp b/testsuites/unittest/fs/jffs/vfs_jffs_test.cpp index 531fed81..ccd3ab4d 100644 --- a/testsuites/unittest/fs/jffs/vfs_jffs_test.cpp +++ b/testsuites/unittest/fs/jffs/vfs_jffs_test.cpp @@ -983,9 +983,19 @@ INT32 JffsStatfsPrintf(struct statfs buf) using namespace testing::ext; namespace OHOS { +#if defined(LOSCFG_USER_TEST_PRESSURE) +pthread_mutexattr_t mutex; +#endif class VfsJffsTest : public testing::Test { public: - static void SetUpTestCase(void) {} + static void SetUpTestCase(void) + { +#if defined(LOSCFG_USER_TEST_PRESSURE) + pthread_mutexattr_settype(&mutex, PTHREAD_MUTEX_NORMAL); + pthread_mutex_init(&g_jffs2GlobalLock1, &mutex); + pthread_mutex_init(&g_jffs2GlobalLock2, &mutex); +#endif + } static void TearDownTestCase(void) {} }; #if defined(LOSCFG_USER_TEST_FULL) @@ -7001,10 +7011,6 @@ HWTEST_F(VfsJffsTest, ItFsJffs535, TestSize.Level0) #endif #if defined(LOSCFG_USER_TEST_PRESSURE) -pthreadMutexattrT mutex; -PthreadMutexattrSettype(&mutex, PTHREAD_MUTEX_NORMAL); -PthreadMutexInit(&g_jffs2GlobalLock1, &mutex); -PthreadMutexInit(&g_jffs2GlobalLock2, &mutex); /* * * @tc.name: ItFsJffsPRESSURE_001 * @tc.desc: function for VfsJffsTest @@ -8481,17 +8487,6 @@ HWTEST_F(VfsJffsTest, ItFsJffsPerformance006, TestSize.Level0) ItFsJffsPerformance006(); } -/* * - * @tc.name: ItFsJffsPERFORMANCE_007 - * @tc.desc: function for VfsJffsTest - * @tc.type: FUNC - * @tc.require: AR000EEMQ9 - */ -HWTEST_F(VfsJffsTest, ItFsJffsPerformance007, TestSize.Level0) -{ - ItFsJffsPerformance007(); -} - /* * * @tc.name: ItFsJffsPERFORMANCE_008 * @tc.desc: function for VfsJffsTest From 23fd4e55a3a737454374c41561c0e4b3a4e39d85 Mon Sep 17 00:00:00 2001 From: kevin Date: Thu, 1 Jul 2021 20:24:46 +0800 Subject: [PATCH 08/43] add vibrator liteos defined Signed-off-by: kevin Change-Id: I0a73f0de3c25e427362fe9d96547c4d847448dda --- tools/build/config/debug/hispark_taurus_clang.config | 2 ++ tools/build/config/debug/hispark_taurus_clang_tee.config | 2 ++ tools/build/config/hispark_taurus_clang_release.config | 2 ++ tools/build/config/hispark_taurus_clang_release_tee.config | 2 ++ 4 files changed, 8 insertions(+) diff --git a/tools/build/config/debug/hispark_taurus_clang.config b/tools/build/config/debug/hispark_taurus_clang.config index b82c6764..ccc6dfda 100644 --- a/tools/build/config/debug/hispark_taurus_clang.config +++ b/tools/build/config/debug/hispark_taurus_clang.config @@ -40,6 +40,8 @@ LOSCFG_DRIVERS_HDF_INPUT=y LOSCFG_DRIVERS_HDF_TP_5P5_GT911=y LOSCFG_DRIVERS_HDF_SENSOR=y LOSCFG_DRIVERS_HDF_STORAGE=y +LOSCFG_DRIVERS_HDF_VIBRATOR=y +LOSCFG_DRIVERS_HDF_VIBRATOR_LINEAR=y LOSCFG_DRIVERS_SD=y LOSCFG_DRIVERS_EMMC=y LOSCFG_DRIVERS_HIEVENT=y diff --git a/tools/build/config/debug/hispark_taurus_clang_tee.config b/tools/build/config/debug/hispark_taurus_clang_tee.config index b61bc4e2..45276b37 100644 --- a/tools/build/config/debug/hispark_taurus_clang_tee.config +++ b/tools/build/config/debug/hispark_taurus_clang_tee.config @@ -40,6 +40,8 @@ LOSCFG_DRIVERS_HDF_INPUT=y LOSCFG_DRIVERS_HDF_TP_5P5_GT911=y LOSCFG_DRIVERS_HDF_SENSOR=y LOSCFG_DRIVERS_HDF_STORAGE=y +LOSCFG_DRIVERS_HDF_VIBRATOR=y +LOSCFG_DRIVERS_HDF_VIBRATOR_LINEAR=y LOSCFG_DRIVERS_SD=y LOSCFG_DRIVERS_EMMC=y LOSCFG_DRIVERS_TZDRIVER=y diff --git a/tools/build/config/hispark_taurus_clang_release.config b/tools/build/config/hispark_taurus_clang_release.config index 3076dd4f..43b1143f 100644 --- a/tools/build/config/hispark_taurus_clang_release.config +++ b/tools/build/config/hispark_taurus_clang_release.config @@ -37,6 +37,8 @@ LOSCFG_DRIVERS_HDF_INPUT=y LOSCFG_DRIVERS_HDF_TP_5P5_GT911=y LOSCFG_DRIVERS_HDF_SENSOR=y LOSCFG_DRIVERS_HDF_STORAGE=y +LOSCFG_DRIVERS_HDF_VIBRATOR=y +LOSCFG_DRIVERS_HDF_VIBRATOR_LINEAR=y LOSCFG_DRIVERS_SD=y LOSCFG_DRIVERS_EMMC=y LOSCFG_DRIVERS_HIEVENT=y diff --git a/tools/build/config/hispark_taurus_clang_release_tee.config b/tools/build/config/hispark_taurus_clang_release_tee.config index dc2a5de8..f5600194 100644 --- a/tools/build/config/hispark_taurus_clang_release_tee.config +++ b/tools/build/config/hispark_taurus_clang_release_tee.config @@ -38,6 +38,8 @@ LOSCFG_DRIVERS_HDF_INPUT=y LOSCFG_DRIVERS_HDF_TP_5P5_GT911=y LOSCFG_DRIVERS_HDF_SENSOR=y LOSCFG_DRIVERS_HDF_STORAGE=y +LOSCFG_DRIVERS_HDF_VIBRATOR=y +LOSCFG_DRIVERS_HDF_VIBRATOR_LINEAR=y LOSCFG_DRIVERS_SD=y LOSCFG_DRIVERS_EMMC=y LOSCFG_DRIVERS_TZDRIVER=y From e567a10d021c3e0fe02d6911dbe8687255c67ffa Mon Sep 17 00:00:00 2001 From: Kiita Date: Tue, 15 Jun 2021 21:14:49 +0800 Subject: [PATCH 09/43] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9Etoybox=20reboot?= =?UTF-8?q?=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【背景】liteos_a测试套需要reboot命令 【修改方案】 在third_party/toybox/porting新增reboot.c文件,并作自定义修改。 新增reboot命令的支持说明。 re #I3YQ7S Signed-off-by: yansira Change-Id: I686a535adbad78935eee04fc283a837a4a7f13f6 --- apps/toybox/liteos_a_custom.config | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/toybox/liteos_a_custom.config b/apps/toybox/liteos_a_custom.config index 2de92c6d..03dbae41 100644 --- a/apps/toybox/liteos_a_custom.config +++ b/apps/toybox/liteos_a_custom.config @@ -128,7 +128,6 @@ CONFIG_MDEV_CONF=y # CONFIG_READAHEAD is not set # CONFIG_READLINK is not set # CONFIG_REALPATH is not set -# CONFIG_REBOOT is not set # CONFIG_RESET is not set # CONFIG_REV is not set # CONFIG_RMMOD is not set From b1b4ddcc7decc7f21f753246bf22e60530855ccf Mon Sep 17 00:00:00 2001 From: kevin Date: Thu, 1 Jul 2021 20:24:46 +0800 Subject: [PATCH 10/43] feat:add hdf vibrator liteos definition Change-Id: I0a73f0de3c25e427362fe9d96547c4d847448dda Signed-off-by: kevin --- tools/build/config/debug/hispark_taurus_clang.config | 2 ++ tools/build/config/debug/hispark_taurus_clang_tee.config | 2 ++ tools/build/config/hispark_taurus_clang_release.config | 2 ++ tools/build/config/hispark_taurus_clang_release_tee.config | 2 ++ 4 files changed, 8 insertions(+) diff --git a/tools/build/config/debug/hispark_taurus_clang.config b/tools/build/config/debug/hispark_taurus_clang.config index b82c6764..ccc6dfda 100644 --- a/tools/build/config/debug/hispark_taurus_clang.config +++ b/tools/build/config/debug/hispark_taurus_clang.config @@ -40,6 +40,8 @@ LOSCFG_DRIVERS_HDF_INPUT=y LOSCFG_DRIVERS_HDF_TP_5P5_GT911=y LOSCFG_DRIVERS_HDF_SENSOR=y LOSCFG_DRIVERS_HDF_STORAGE=y +LOSCFG_DRIVERS_HDF_VIBRATOR=y +LOSCFG_DRIVERS_HDF_VIBRATOR_LINEAR=y LOSCFG_DRIVERS_SD=y LOSCFG_DRIVERS_EMMC=y LOSCFG_DRIVERS_HIEVENT=y diff --git a/tools/build/config/debug/hispark_taurus_clang_tee.config b/tools/build/config/debug/hispark_taurus_clang_tee.config index b61bc4e2..45276b37 100644 --- a/tools/build/config/debug/hispark_taurus_clang_tee.config +++ b/tools/build/config/debug/hispark_taurus_clang_tee.config @@ -40,6 +40,8 @@ LOSCFG_DRIVERS_HDF_INPUT=y LOSCFG_DRIVERS_HDF_TP_5P5_GT911=y LOSCFG_DRIVERS_HDF_SENSOR=y LOSCFG_DRIVERS_HDF_STORAGE=y +LOSCFG_DRIVERS_HDF_VIBRATOR=y +LOSCFG_DRIVERS_HDF_VIBRATOR_LINEAR=y LOSCFG_DRIVERS_SD=y LOSCFG_DRIVERS_EMMC=y LOSCFG_DRIVERS_TZDRIVER=y diff --git a/tools/build/config/hispark_taurus_clang_release.config b/tools/build/config/hispark_taurus_clang_release.config index 3076dd4f..43b1143f 100644 --- a/tools/build/config/hispark_taurus_clang_release.config +++ b/tools/build/config/hispark_taurus_clang_release.config @@ -37,6 +37,8 @@ LOSCFG_DRIVERS_HDF_INPUT=y LOSCFG_DRIVERS_HDF_TP_5P5_GT911=y LOSCFG_DRIVERS_HDF_SENSOR=y LOSCFG_DRIVERS_HDF_STORAGE=y +LOSCFG_DRIVERS_HDF_VIBRATOR=y +LOSCFG_DRIVERS_HDF_VIBRATOR_LINEAR=y LOSCFG_DRIVERS_SD=y LOSCFG_DRIVERS_EMMC=y LOSCFG_DRIVERS_HIEVENT=y diff --git a/tools/build/config/hispark_taurus_clang_release_tee.config b/tools/build/config/hispark_taurus_clang_release_tee.config index dc2a5de8..f5600194 100644 --- a/tools/build/config/hispark_taurus_clang_release_tee.config +++ b/tools/build/config/hispark_taurus_clang_release_tee.config @@ -38,6 +38,8 @@ LOSCFG_DRIVERS_HDF_INPUT=y LOSCFG_DRIVERS_HDF_TP_5P5_GT911=y LOSCFG_DRIVERS_HDF_SENSOR=y LOSCFG_DRIVERS_HDF_STORAGE=y +LOSCFG_DRIVERS_HDF_VIBRATOR=y +LOSCFG_DRIVERS_HDF_VIBRATOR_LINEAR=y LOSCFG_DRIVERS_SD=y LOSCFG_DRIVERS_EMMC=y LOSCFG_DRIVERS_TZDRIVER=y From 56a95b9ec903f815f9199ac65ca318e00a83b2ed Mon Sep 17 00:00:00 2001 From: chenjing Date: Mon, 5 Jul 2021 16:03:16 +0800 Subject: [PATCH 11/43] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=86=85?= =?UTF-8?q?=E6=A0=B8access=20chmod=20chown=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1、修复内核的access chmod chown功能; 2、此三个接口的syscall直接调用内核态接口执行操作。 close #I3Z5L6 Signed-off-by: chenjing Change-Id: I301f00fb341252b697b04b9970db86f0e7f978df --- fs/vfs/operation/fs_other.c | 60 +++++++++++++++++++++++++++++++------ syscall/fs_syscall.c | 44 +++------------------------ 2 files changed, 55 insertions(+), 49 deletions(-) diff --git a/fs/vfs/operation/fs_other.c b/fs/vfs/operation/fs_other.c index 791accb9..bb5b0e55 100644 --- a/fs/vfs/operation/fs_other.c +++ b/fs/vfs/operation/fs_other.c @@ -35,7 +35,9 @@ #include "dirent.h" #include "unistd.h" #include "sys/select.h" +#include "sys/mount.h" #include "sys/stat.h" +#include "sys/statfs.h" #include "sys/prctl.h" #include "fs/fd_table.h" #include "fs/file.h" @@ -256,30 +258,70 @@ char *getcwd(char *buf, size_t n) int chmod(const char *path, mode_t mode) { - int result; - struct stat buf; + struct IATTR attr = {0}; + attr.attr_chg_mode = mode; + attr.attr_chg_valid = CHG_MODE; /* change mode */ + int ret; - result = stat(path, &buf); - if (result != ENOERR) { + ret = chattr(path, &attr); + if (ret < 0) { + return VFS_ERROR; + } + + return OK; +} + +int chown(const char *pathname, uid_t owner, gid_t group) +{ + struct IATTR attr = {0}; + attr.attr_chg_valid = 0; + int ret; + + if (owner != (uid_t)-1) { + attr.attr_chg_uid = owner; + attr.attr_chg_valid |= CHG_UID; + } + if (group != (gid_t)-1) { + attr.attr_chg_gid = group; + attr.attr_chg_valid |= CHG_GID; + } + ret = chattr(pathname, &attr); + if (ret < 0) { return VFS_ERROR; } - /* no access/permission control for files now, just return OK if stat is okay*/ return OK; } int access(const char *path, int amode) { - int result; + int ret; struct stat buf; + struct statfs fsBuf; - result = stat(path, &buf); + ret = statfs(path, &fsBuf); + if (ret != 0) { + if (get_errno() != ENOSYS) { + return VFS_ERROR; + } + /* dev has no statfs ops, need devfs to handle this in feature */ + } - if (result != ENOERR) { + if ((fsBuf.f_flags & MS_RDONLY) && ((unsigned int)amode & W_OK)) { + set_errno(EROFS); + return VFS_ERROR; + } + + ret = stat(path, &buf); + if (ret != 0) { + return VFS_ERROR; + } + + if (VfsPermissionCheck(buf.st_uid, buf.st_gid, buf.st_mode, amode)) { + set_errno(EACCES); return VFS_ERROR; } - /* no access/permission control for files now, just return OK if stat is okay*/ return OK; } diff --git a/syscall/fs_syscall.c b/syscall/fs_syscall.c index 9bb01f3a..b424b05b 100644 --- a/syscall/fs_syscall.c +++ b/syscall/fs_syscall.c @@ -703,8 +703,6 @@ OUT: int SysAccess(const char *path, int amode) { int ret; - struct stat buf; - struct statfs fsBuf; char *pathRet = NULL; if (path != NULL) { @@ -714,30 +712,9 @@ int SysAccess(const char *path, int amode) } } - ret = statfs((path ? pathRet : NULL), &fsBuf); - if (ret != 0) { + ret = access(pathRet, amode); + if (ret < 0) { ret = -get_errno(); - if (ret != -ENOSYS) { - goto OUT; - } else { - /* dev has no statfs ops, need devfs to handle this in feature */ - ret = LOS_OK; - } - } - - if ((fsBuf.f_flags & MS_RDONLY) && ((unsigned int)amode & W_OK)) { - ret = -EROFS; - goto OUT; - } - - ret = stat((path ? pathRet : NULL), &buf); - if (ret != 0) { - ret = -get_errno(); - goto OUT; - } - - if (VfsPermissionCheck(buf.st_uid, buf.st_gid, buf.st_mode, amode)) { - ret = -EACCES; } OUT: @@ -2149,9 +2126,6 @@ OUT: int SysChmod(const char *pathname, mode_t mode) { - struct IATTR attr = {0}; - attr.attr_chg_mode = mode; - attr.attr_chg_valid = CHG_MODE; /* change mode */ int ret; char *pathRet = NULL; @@ -2162,7 +2136,7 @@ int SysChmod(const char *pathname, mode_t mode) } } - ret = chattr((pathname ? pathRet : NULL), &attr); + ret = chmod(pathRet, mode); if (ret < 0) { ret = -get_errno(); } @@ -2176,8 +2150,6 @@ OUT: int SysChown(const char *pathname, uid_t owner, gid_t group) { - struct IATTR attr = {0}; - attr.attr_chg_valid = 0; int ret; char *pathRet = NULL; @@ -2188,15 +2160,7 @@ int SysChown(const char *pathname, uid_t owner, gid_t group) } } - if (owner != (uid_t)-1) { - attr.attr_chg_uid = owner; - attr.attr_chg_valid |= CHG_UID; - } - if (group != (gid_t)-1) { - attr.attr_chg_gid = group; - attr.attr_chg_valid |= CHG_GID; - } - ret = chattr((pathname ? pathRet : NULL), &attr); + ret = chown(pathRet, owner, group); if (ret < 0) { ret = -get_errno(); } From 425975e4811023e31a520979c20ea2562224d9d0 Mon Sep 17 00:00:00 2001 From: qidechun Date: Tue, 6 Jul 2021 07:49:59 +0800 Subject: [PATCH 12/43] feat: add blackbox for liteos_a MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1、在内核增加BlackBox核心框架,对外提供模块回调接口注册和故障处理接口。 2、增加默认的系统模块适配层,处理通用内核态和用户态故障日志抓取和保存。 Close #I3NN7V Signed-off-by: qidechun --- Kconfig | 4 +- arch/arm/arm/src/los_exc.c | 14 + kernel/base/misc/task_shellcmd.c | 6 + kernel/common/blackbox/Kconfig | 11 + kernel/common/blackbox/Makefile | 14 + kernel/common/blackbox/los_blackbox.h | 95 ++++ kernel/common/blackbox/los_blackbox_common.c | 101 ++++ kernel/common/blackbox/los_blackbox_common.h | 65 +++ kernel/common/blackbox/los_blackbox_core.c | 454 ++++++++++++++++++ .../common/blackbox/los_blackbox_detector.c | 63 +++ .../common/blackbox/los_blackbox_detector.h | 55 +++ .../blackbox/los_blackbox_system_adapter.c | 247 ++++++++++ .../blackbox/los_blackbox_system_adapter.h | 55 +++ kernel/common/los_excinfo.c | 59 +++ kernel/common/los_excinfo_pri.h | 3 + tools/build/mk/liteos_tables_ldflags.mk | 4 +- tools/build/mk/los_config.mk | 9 +- 17 files changed, 1256 insertions(+), 3 deletions(-) create mode 100644 kernel/common/blackbox/Kconfig create mode 100644 kernel/common/blackbox/Makefile create mode 100644 kernel/common/blackbox/los_blackbox.h create mode 100644 kernel/common/blackbox/los_blackbox_common.c create mode 100644 kernel/common/blackbox/los_blackbox_common.h create mode 100644 kernel/common/blackbox/los_blackbox_core.c create mode 100644 kernel/common/blackbox/los_blackbox_detector.c create mode 100644 kernel/common/blackbox/los_blackbox_detector.h create mode 100644 kernel/common/blackbox/los_blackbox_system_adapter.c create mode 100644 kernel/common/blackbox/los_blackbox_system_adapter.h diff --git a/Kconfig b/Kconfig index 8bce9860..491abbe2 100644 --- a/Kconfig +++ b/Kconfig @@ -61,6 +61,8 @@ source "../../kernel/liteos_a/arch/Kconfig" source "../../kernel/liteos_a/kernel/common/Kconfig" ######################### config options of patchfs ##################### source "../../kernel/liteos_a/kernel/common/patchfs/Kconfig" +######################### config options of blackbox ##################### +source "../../kernel/liteos_a/kernel/common/blackbox/Kconfig" config QUICK_START bool "Enable QUICK_START" @@ -175,7 +177,7 @@ config PLATFORM_DVFS config SAVE_EXCINFO bool "Enable Saving Exception Information" - default n + default y if BLACKBOX help Answer Y to enable LiteOS support saving exception information to storage medium. diff --git a/arch/arm/arm/src/los_exc.c b/arch/arm/arm/src/los_exc.c index d944caaf..06bbdb39 100644 --- a/arch/arm/arm/src/los_exc.c +++ b/arch/arm/arm/src/los_exc.c @@ -62,6 +62,9 @@ #ifdef LOSCFG_FS_VFS #include "console.h" #endif +#ifdef LOSCFG_BLACKBOX +#include "los_blackbox.h" +#endif #define INVALID_CPUID 0xFFFF @@ -589,6 +592,9 @@ STATIC VOID OsUserExcHandle(ExcContext *excBufAddr) /* Exception handling All operations should be kept prior to that operation */ OsExcRestore(); /* kill user exc process */ +#ifdef LOSCFG_BLACKBOX + BBoxNotifyError("USER_CRASH", MODULE_SYSTEM, "Crash in user", 0); +#endif LOS_Exit(OS_PRO_EXIT_OK); } @@ -1058,6 +1064,9 @@ LITE_OS_SEC_TEXT VOID STATIC OsExcPriorDisposal(ExcContext *excBufAddr) LITE_OS_SEC_TEXT_INIT STATIC VOID OsPrintExcHead(UINT32 far) { +#ifdef LOSCFG_BLACKBOX + SetExcInfoIndex(0); +#endif #ifdef LOSCFG_KERNEL_VM /* You are not allowed to add any other print information before this exception information */ if (g_excFromUserMode[ArchCurrCpuid()] == TRUE) { @@ -1125,7 +1134,9 @@ LITE_OS_SEC_TEXT_INIT VOID OsExcHandleEntry(UINT32 excType, ExcContext *excBufAd if (g_curNestCount[ArchCurrCpuid()] == 1) { #ifdef LOSCFG_SAVE_EXCINFO if (func != NULL) { +#ifndef LOSCFG_BLACKBOX SetExcInfoIndex(0); +#endif OsSysStateSave(&intCount, &lockCount); OsRecordExcInfoTime(); OsSysStateRestore(intCount, lockCount); @@ -1154,6 +1165,9 @@ LITE_OS_SEC_TEXT_INIT VOID OsExcHandleEntry(UINT32 excType, ExcContext *excBufAd } #endif +#ifdef LOSCFG_BLACKBOX + BBoxNotifyError(EVENT_PANIC, MODULE_SYSTEM, "Crash in kernel", 1); +#endif while (1) {} } diff --git a/kernel/base/misc/task_shellcmd.c b/kernel/base/misc/task_shellcmd.c index 05623a56..9b0d678e 100644 --- a/kernel/base/misc/task_shellcmd.c +++ b/kernel/base/misc/task_shellcmd.c @@ -85,12 +85,18 @@ STATIC UINT32 *taskWaterLine = NULL; #define OS_TASK_ALL_INFO_LEN (g_taskMaxNum * (sizeof(LosTaskCB) + sizeof(UINT32))) #ifdef LOSCFG_FS_VFS +#ifdef LOSCFG_BLACKBOX +#define SaveExcInfo(arg, ...) WriteExcInfoToBuf(arg, ##__VA_ARGS__) +#else +#define SaveExcInfo(arg, ...) +#endif #define PROCESS_INFO_SHOW(seqBuf, arg...) do { \ if (seqBuf != NULL) { \ (void)LosBufPrintf((struct SeqBuf *)seqBuf, ##arg); \ } else { \ PRINTK(arg); \ } \ + SaveExcInfo(arg); \ } while (0) #else #define PROCESS_INFO_SHOW(seqBuf, arg...) PRINTK(arg) diff --git a/kernel/common/blackbox/Kconfig b/kernel/common/blackbox/Kconfig new file mode 100644 index 00000000..0c1e4f07 --- /dev/null +++ b/kernel/common/blackbox/Kconfig @@ -0,0 +1,11 @@ +config BLACKBOX + bool "Enable BlackBox" + default y + help + Answer Y to enable LiteOS support blackbox + +config LOG_ROOT_PATH + string + default "/storage/data/log" if BLACKBOX + help + define the default log path of blackbox \ No newline at end of file diff --git a/kernel/common/blackbox/Makefile b/kernel/common/blackbox/Makefile new file mode 100644 index 00000000..e67f8794 --- /dev/null +++ b/kernel/common/blackbox/Makefile @@ -0,0 +1,14 @@ +include $(LITEOSTOPDIR)/config.mk + +MODULE_NAME := $(notdir $(shell pwd)) + +LOCAL_SRCS := $(wildcard *.c) + +LOCAL_INCLUDE := \ + -I $(LITEOSTOPDIR)/kernel/common \ + -I $(LITEOSTOPDIR)/kernel/common/blackbox \ + -I $(LITEOSTOPDIR)/syscall \ + +LOCAL_FLAGS := $(LOCAL_INCLUDE) $(LITEOS_GCOV_OPTS) + +include $(MODULE) diff --git a/kernel/common/blackbox/los_blackbox.h b/kernel/common/blackbox/los_blackbox.h new file mode 100644 index 00000000..b60460ca --- /dev/null +++ b/kernel/common/blackbox/los_blackbox.h @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef LOS_BLACKBOX_H +#define LOS_BLACKBOX_H + +#ifdef __cplusplus +#if __cplusplus +extern "C" { +#endif /* __cplusplus */ +#endif /* __cplusplus */ + +#ifndef __user +#define __user +#endif + +#include "stdarg.h" +#include "los_typedef.h" + +#define PATH_MAX_LEN 256 +#define EVENT_MAX_LEN 32 +#define MODULE_MAX_LEN 32 +#define ERROR_DESC_MAX_LEN 512 +#ifndef LOSCFG_LOG_ROOT_PATH +#define LOSCFG_LOG_ROOT_PATH "/storage/data/log" +#endif +#define KERNEL_FAULT_LOG_PATH LOSCFG_LOG_ROOT_PATH "/kernel_fault.log" +#define USER_FAULT_LOG_PATH LOSCFG_LOG_ROOT_PATH "/user_fault.log" + +#define MODULE_SYSTEM "SYSTEM" +#define EVENT_SYSREBOOT "SYSREBOOT" +#define EVENT_LONGPRESS "LONGPRESS" +#define EVENT_COMBINATIONKEY "COMBINATIONKEY" +#define EVENT_SUBSYSREBOOT "SUBSYSREBOOT" +#define EVENT_POWEROFF "POWEROFF" +#define EVENT_PANIC "PANIC" +#define EVENT_SYS_WATCHDOG "SYSWATCHDOG" +#define EVENT_HUNGTASK "HUNGTASK" +#define EVENT_BOOTFAIL "BOOTFAIL" + +struct ErrorInfo { + char event[EVENT_MAX_LEN]; + char module[MODULE_MAX_LEN]; + char errorDesc[ERROR_DESC_MAX_LEN]; +}; + +struct ModuleOps { + char module[MODULE_MAX_LEN]; + void (*Dump)(const char *logDir, struct ErrorInfo *info); + void (*Reset)(struct ErrorInfo *info); + int (*GetLastLogInfo)(struct ErrorInfo *info); + int (*SaveLastLog)(const char *logDir, struct ErrorInfo *info); +}; + +int BBoxRegisterModuleOps(struct ModuleOps *ops); +int BBoxNotifyError(const char event[EVENT_MAX_LEN], + const char module[MODULE_MAX_LEN], + const char errorDesc[ERROR_DESC_MAX_LEN], + int needSysReset); +int OsBBoxDriverInit(void); + +#ifdef __cplusplus +#if __cplusplus +} +#endif /* __cplusplus */ +#endif /* __cplusplus */ + +#endif \ No newline at end of file diff --git a/kernel/common/blackbox/los_blackbox_common.c b/kernel/common/blackbox/los_blackbox_common.c new file mode 100644 index 00000000..074f7e7d --- /dev/null +++ b/kernel/common/blackbox/los_blackbox_common.c @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* ------------ includes ------------ */ +#include "los_blackbox_common.h" +#ifdef LOSCFG_LIB_LIBC +#include "stdlib.h" +#include "unistd.h" +#endif +#include "fs/fs.h" +#include "securec.h" +#include "los_memory.h" + +/* ------------ local macroes ------------ */ +/* ------------ local prototypes ------------ */ +/* ------------ local function declarations ------------ */ +/* ------------ global function declarations ------------ */ +/* ------------ local variables ------------ */ +/* ------------ function definitions ------------ */ +int FullWriteFile(const char *filePath, const char *buf, size_t bufSize, int isAppend) +{ + int fd; + int totalToWrite = (int)bufSize; + int totalWrite = 0; + + if (filePath == NULL || buf == NULL || bufSize == 0) { + BBOX_PRINT_ERR("filePath: %p, buf: %p, bufSize: %lu!\n", filePath, buf, bufSize); + return -1; + } + + fd = open(filePath, O_CREAT | O_RDWR | (isAppend ? O_APPEND : O_TRUNC), 0644); + if (fd < 0) { + BBOX_PRINT_ERR("Create file [%s] failed, fd: %d!\n", filePath, fd); + return -1; + } + while (totalToWrite > 0) { + int writeThisTime = write(fd, buf, totalToWrite); + if (writeThisTime < 0) { + BBOX_PRINT_ERR("Failed to write file [%s]!\n", filePath); + (void)close(fd); + return -1; + } + buf += writeThisTime; + totalToWrite -= writeThisTime; + totalWrite += writeThisTime; + } + (void)close(fd); + + return (totalWrite == (int)bufSize) ? 0 : -1; +} + +int SaveBasicErrorInfo(const char *filePath, struct ErrorInfo *info) +{ + char *buf; + + if (filePath == NULL || info == NULL) { + BBOX_PRINT_ERR("filePath: %p, event: %p!\n", filePath, info); + return -1; + } + + buf = LOS_MemAlloc(m_aucSysMem1, ERROR_INFO_MAX_LEN); + if (buf == NULL) { + BBOX_PRINT_ERR("LOS_MemAlloc failed!\n"); + return -1; + } + (void)memset_s(buf, ERROR_INFO_MAX_LEN, 0, ERROR_INFO_MAX_LEN); + (void)snprintf_s(buf, ERROR_INFO_MAX_LEN, ERROR_INFO_MAX_LEN - 1, + ERROR_INFO_HEADER ERROR_INFO_HEADER_FORMAT, info->event, info->module, info->errorDesc); + *(buf + ERROR_INFO_MAX_LEN - 1) = '\0'; + (void)FullWriteFile(filePath, buf, strlen(buf), 0); + (void)LOS_MemFree(m_aucSysMem1, buf); + + return 0; +} \ No newline at end of file diff --git a/kernel/common/blackbox/los_blackbox_common.h b/kernel/common/blackbox/los_blackbox_common.h new file mode 100644 index 00000000..b6e76e9d --- /dev/null +++ b/kernel/common/blackbox/los_blackbox_common.h @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef LOS_BLACKBOX_COMMON_H +#define LOS_BLACKBOX_COMMON_H + +#ifdef __cplusplus +#if __cplusplus +extern "C" { +#endif /* __cplusplus */ +#endif /* __cplusplus */ + +#ifndef __user +#define __user +#endif + +#include "los_blackbox.h" +#include "los_printf.h" +#include "los_typedef.h" + +#define ERROR_INFO_HEADER "#### error info ####\n" +#define ERROR_INFO_HEADER_FORMAT "event: %s\nmodule: %s\nerrorDesc: %s\n" +#define ERROR_INFO_MAX_LEN 768 +#define Min(a, b) (((a) > (b)) ? (b) : (a)) +#define BBOX_PRINT_ERR(format, ...) PRINTK("bbox: func: %s, line: %d, Err: " \ + format, __func__, __LINE__, ##__VA_ARGS__) +#define BBOX_PRINT_INFO(format, ...) PRINTK("bbox: Info: " format, ##__VA_ARGS__) + +int FullWriteFile(const char *filePath, const char *buf, size_t bufSize, int isAppend); +int SaveBasicErrorInfo(const char *filePath, struct ErrorInfo *info); + +#ifdef __cplusplus +#if __cplusplus +} +#endif /* __cplusplus */ +#endif /* __cplusplus */ + +#endif \ No newline at end of file diff --git a/kernel/common/blackbox/los_blackbox_core.c b/kernel/common/blackbox/los_blackbox_core.c new file mode 100644 index 00000000..64199683 --- /dev/null +++ b/kernel/common/blackbox/los_blackbox_core.c @@ -0,0 +1,454 @@ +/* + * Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* ------------ includes ------------ */ +#include "los_blackbox.h" +#include "los_blackbox_common.h" +#include "los_blackbox_detector.h" +#ifdef LOSCFG_LIB_LIBC +#include "stdlib.h" +#include "unistd.h" +#endif +#include "los_base.h" +#include "los_config.h" +#include "los_excinfo_pri.h" +#include "los_hw.h" +#include "los_init.h" +#include "los_memory.h" +#include "los_sem.h" +#include "los_syscall.h" +#include "securec.h" +#include "sys/reboot.h" + +/* ------------ local macroes ------------ */ +#define LOG_WAIT_TIMES 10 +#define LOG_PART_WAIT_TIME 1000 + +/* ------------ local prototypes ------------ */ +typedef struct BBoxOps { + LOS_DL_LIST opsList; + struct ModuleOps ops; +} BBoxOps; + +/* ------------ local function declarations ------------ */ +/* ------------ global function declarations ------------ */ +/* ------------ local variables ------------ */ +static UINT32 g_opsListSem = 0; +static UINT32 g_tempErrInfoSem = 0; +static LOS_DL_LIST_HEAD(g_opsList); +struct ErrorInfo *g_tempErrInfo; + +/* ------------ function definitions ------------ */ +static void FormatErrorInfo(struct ErrorInfo *info, + const char event[EVENT_MAX_LEN], + const char module[MODULE_MAX_LEN], + const char errorDesc[ERROR_DESC_MAX_LEN]) +{ + if (info == NULL || event == NULL || module == NULL || errorDesc == NULL) { + BBOX_PRINT_ERR("info: %p, event: %p, module: %p, errorDesc: %p!\n", info, event, module, errorDesc); + return; + } + + (void)memset_s(info, sizeof(*info), 0, sizeof(*info)); + (void)strncpy_s(info->event, sizeof(info->event), event, Min(strlen(event), sizeof(info->event) - 1)); + info->event[sizeof(info->event) - 1] = '\0'; + (void)strncpy_s(info->module, sizeof(info->module), module, Min(strlen(module), sizeof(info->module) - 1)); + info->module[sizeof(info->module) - 1] = '\0'; + (void)strncpy_s(info->errorDesc, sizeof(info->errorDesc), errorDesc, + Min(strlen(errorDesc), sizeof(info->errorDesc) - 1)); + info->errorDesc[sizeof(info->errorDesc) - 1] = '\0'; +} + +#ifdef LOSCFG_FS_VFS +static bool IsLogPartReady(void) +{ + return access(LOSCFG_LOG_ROOT_PATH, 0) == 0; +} + +static void WaitForLogPart(void) +{ + BBOX_PRINT_INFO("wait for log part [%s] begin!\n", LOSCFG_LOG_ROOT_PATH); + while (!IsLogPartReady()) { + LOS_Msleep(LOG_PART_WAIT_TIME); + } + BBOX_PRINT_INFO("wait for log part [%s] end!\n", LOSCFG_LOG_ROOT_PATH); +} +#else +static bool IsLogPartReady(void) +{ + return TRUE; +} + +static void WaitForLogPart(void) +{ + int i = 0; + + BBOX_PRINT_INFO("wait for log part [%s] begin!\n", LOSCFG_LOG_ROOT_PATH); + while (i++ < LOG_WAIT_TIMES) { + LOS_Msleep(LOG_PART_WAIT_TIME); + } + BBOX_PRINT_INFO("wait for log part [%s] end!\n", LOSCFG_LOG_ROOT_PATH); +} +#endif + +static bool FindModuleOps(struct ErrorInfo *info, BBoxOps **ops) +{ + bool found = false; + + if (info == NULL || ops == NULL) { + BBOX_PRINT_ERR("info: %p, ops: %p!\n", info, ops); + return found; + } + + LOS_DL_LIST_FOR_EACH_ENTRY(*ops, &g_opsList, BBoxOps, opsList) { + if (*ops != NULL && strcmp((*ops)->ops.module, info->module) == 0) { + found = true; + break; + } + } + if (!found) { + BBOX_PRINT_ERR("[%s] hasn't been registered!\n", info->module); + } + + return found; +} + +static void InvokeModuleOps(struct ErrorInfo *info, BBoxOps *ops) +{ + if (info == NULL || ops == NULL) { + BBOX_PRINT_ERR("info: %p, ops: %p!\n", info, ops); + return; + } + + if (ops->ops.Dump != NULL) { + BBOX_PRINT_INFO("[%s] starts dumping log!\n", ops->ops.module); + ops->ops.Dump(LOSCFG_LOG_ROOT_PATH, info); + BBOX_PRINT_INFO("[%s] ends dumping log!\n", ops->ops.module); + } + if (ops->ops.Reset != NULL) { + BBOX_PRINT_INFO("[%s] starts resetting!\n", ops->ops.module); + ops->ops.Reset(info); + BBOX_PRINT_INFO("[%s] ends resetting!\n", ops->ops.module); + } +} + +static void SaveLastLog(const char *logDir) +{ + struct ErrorInfo *info; + BBoxOps *ops; + + info = LOS_MemAlloc(m_aucSysMem1, sizeof(*info)); + if (info == NULL) { + BBOX_PRINT_ERR("LOS_MemAlloc failed!\n"); + return; + } + + if (LOS_SemPend(g_opsListSem, LOS_WAIT_FOREVER) != LOS_OK) { + BBOX_PRINT_ERR("Request g_opsListSem failed!\n"); + (void)LOS_MemFree(m_aucSysMem1, info); + return; + } + + LOS_DL_LIST_FOR_EACH_ENTRY(ops, &g_opsList, BBoxOps, opsList) { + if (ops == NULL) { + BBOX_PRINT_ERR("ops: NULL, please check it!\n"); + continue; + } + if (ops->ops.GetLastLogInfo != NULL && ops->ops.SaveLastLog != NULL) { + (void)memset_s(info, sizeof(*info), 0, sizeof(*info)); + if (ops->ops.GetLastLogInfo(info) != 0) { + BBOX_PRINT_ERR("[%s] failed to get log info!\n", ops->ops.module); + continue; + } + BBOX_PRINT_INFO("[%s] starts saving log!\n", ops->ops.module); + if (ops->ops.SaveLastLog(logDir, info) != 0) { + BBOX_PRINT_ERR("[%s] failed to save log!\n", ops->ops.module); + } else { + BBOX_PRINT_INFO("[%s] ends saving log!\n", ops->ops.module); + BBOX_PRINT_INFO("[%s] starts uploading event [%s]\n", info->module, info->event); +#ifdef LOSCFG_FS_VFS + (void)UploadEventByFile(KERNEL_FAULT_LOG_PATH); +#else + BBOX_PRINT_INFO("LOSCFG_FS_VFS isn't defined!\n"); +#endif + BBOX_PRINT_INFO("[%s] ends uploading event [%s]\n", info->module, info->event); + } + } else { + BBOX_PRINT_ERR("module [%s], GetLastLogInfo: %p, SaveLastLog: %p!\n", + ops->ops.module, ops->ops.GetLastLogInfo, ops->ops.SaveLastLog); + } + } + (void)LOS_SemPost(g_opsListSem); + (void)LOS_MemFree(m_aucSysMem1, info); +} + +static void SaveLogWithoutReset(struct ErrorInfo *info) +{ + BBoxOps *ops; + + if (info == NULL) { + BBOX_PRINT_ERR("info: %p!\n", info); + return; + } + + if (LOS_SemPend(g_opsListSem, LOS_WAIT_FOREVER) != LOS_OK) { + BBOX_PRINT_ERR("Request g_opsListSem failed!\n"); + return; + } + if (!FindModuleOps(info, &ops)) { + (void)LOS_SemPost(g_opsListSem); + return; + } + if (ops->ops.Dump == NULL && ops->ops.Reset == NULL) { + (void)LOS_SemPost(g_opsListSem); + if (SaveBasicErrorInfo(USER_FAULT_LOG_PATH, info) == 0) { + BBOX_PRINT_INFO("[%s] starts uploading event [%s]\n", info->module, info->event); +#ifdef LOSCFG_FS_VFS + (void)UploadEventByFile(USER_FAULT_LOG_PATH); +#else + BBOX_PRINT_INFO("LOSCFG_FS_VFS isn't defined!\n"); +#endif + BBOX_PRINT_INFO("[%s] ends uploading event [%s]\n", info->module, info->event); + } + return; + } + InvokeModuleOps(info, ops); + (void)LOS_SemPost(g_opsListSem); +} + +static void SaveTempErrorLog(void) +{ + if (LOS_SemPend(g_tempErrInfoSem, LOS_WAIT_FOREVER) != LOS_OK) { + BBOX_PRINT_ERR("Request g_tempErrInfoSem failed!\n"); + return; + } + if (g_tempErrInfo == NULL) { + BBOX_PRINT_ERR("g_tempErrInfo: %p!\n", g_tempErrInfo); + (void)LOS_SemPost(g_tempErrInfoSem); + return; + } + if (strlen(g_tempErrInfo->event) != 0) { + SaveLogWithoutReset(g_tempErrInfo); + } + (void)LOS_MemFree(m_aucSysMem1, g_tempErrInfo); + g_tempErrInfo = NULL; + (void)LOS_SemPost(g_tempErrInfoSem); +} + +static void SaveLogWithReset(struct ErrorInfo *info) +{ + int ret; + BBoxOps *ops; + + if (info == NULL) { + BBOX_PRINT_ERR("info: %p!\n", info); + return; + } + + if (!FindModuleOps(info, &ops)) { + return; + } + InvokeModuleOps(info, ops); + ret = SysReboot(0, 0, RB_AUTOBOOT); + BBOX_PRINT_INFO("SysReboot, ret: %d\n", ret); +} + +static void SaveTempErrorInfo(const char event[EVENT_MAX_LEN], + const char module[MODULE_MAX_LEN], + const char errorDesc[ERROR_DESC_MAX_LEN]) +{ + if (event == NULL || module == NULL || errorDesc == NULL) { + BBOX_PRINT_ERR("event: %p, module: %p, errorDesc: %p!\n", event, module, errorDesc); + return; + } + if (LOS_SemPend(g_tempErrInfoSem, LOS_WAIT_FOREVER) != LOS_OK) { + BBOX_PRINT_ERR("Request g_tempErrInfoSem failed!\n"); + return; + } + FormatErrorInfo(g_tempErrInfo, event, module, errorDesc); + (void)LOS_SemPost(g_tempErrInfoSem); +} + +static int SaveErrorLog(UINTPTR uwParam1, UINTPTR uwParam2, UINTPTR uwParam3, UINTPTR uwParam4) +{ + const char *logDir = (const char *)uwParam1; + (void)uwParam2; + (void)uwParam3; + (void)uwParam4; + +#ifdef LOSCFG_FS_VFS + WaitForLogPart(); +#endif + SaveLastLog(logDir); + SaveTempErrorLog(); + + return 0; +} + +#ifdef LOSCFG_BLACKBOX_DEBUG +static void PrintModuleOps(void) +{ + struct BBoxOps *ops; + + BBOX_PRINT_INFO("The following modules have been registered!\n"); + LOS_DL_LIST_FOR_EACH_ENTRY(ops, &g_opsList, BBoxOps, opsList) { + if (ops == NULL) { + continue; + } + BBOX_PRINT_INFO("module: %s, Dump: %p, Reset: %p, GetLastLogInfo: %p, SaveLastLog: %p\n", + ops->ops.module, ops->ops.Dump, ops->ops.Reset, ops->ops.GetLastLogInfo, ops->ops.SaveLastLog); + } +} +#endif + +int BBoxRegisterModuleOps(struct ModuleOps *ops) +{ + BBoxOps *newOps; + BBoxOps *temp; + + if (ops == NULL) { + BBOX_PRINT_ERR("ops: %p!\n", ops); + return -1; + } + + newOps = LOS_MemAlloc(m_aucSysMem1, sizeof(*newOps)); + if (newOps == NULL) { + BBOX_PRINT_ERR("LOS_MemAlloc failed!\n"); + return -1; + } + (void)memset_s(newOps, sizeof(*newOps), 0, sizeof(*newOps)); + (void)memcpy_s(&newOps->ops, sizeof(newOps->ops), ops, sizeof(*ops)); + if (LOS_SemPend(g_opsListSem, LOS_WAIT_FOREVER) != LOS_OK) { + BBOX_PRINT_ERR("Request g_opsListSem failed!\n"); + (void)LOS_MemFree(m_aucSysMem1, newOps); + return -1; + } + if (LOS_ListEmpty(&g_opsList)) { + goto __out; + } + + LOS_DL_LIST_FOR_EACH_ENTRY(temp, &g_opsList, BBoxOps, opsList) { + if (temp == NULL) { + continue; + } + if (strcmp(temp->ops.module, ops->module) == 0) { + BBOX_PRINT_ERR("module [%s] has been registered!\n", ops->module); + (void)LOS_SemPost(g_opsListSem); + (void)LOS_MemFree(m_aucSysMem1, newOps); + return -1; + } + } + +__out: + LOS_ListTailInsert(&g_opsList, &newOps->opsList); + (void)LOS_SemPost(g_opsListSem); + BBOX_PRINT_INFO("module [%s] is registered successfully!\n", ops->module); +#ifdef LOSCFG_BLACKBOX_DEBUG + PrintModuleOps(); +#endif + + return 0; +} + +int BBoxNotifyError(const char event[EVENT_MAX_LEN], + const char module[MODULE_MAX_LEN], + const char errorDesc[ERROR_DESC_MAX_LEN], + int needSysReset) +{ + struct ErrorInfo *info; + + if (event == NULL || module == NULL || errorDesc == NULL) { + BBOX_PRINT_ERR("event: %p, module: %p, errorDesc: %p!\n", event, module, errorDesc); + return -1; + } + info = LOS_MemAlloc(m_aucSysMem1, sizeof(*info)); + if (info == NULL) { + BBOX_PRINT_ERR("LOS_MemAlloc failed!\n"); + return -1; + } + FormatErrorInfo(info, event, module, errorDesc); + if (needSysReset == 0) { + if (!IsLogPartReady()) { + SaveTempErrorInfo(event, module, errorDesc); + } else { + SaveLogWithoutReset(info); + } + } else { + SaveLogWithReset(info); + } + (void)LOS_MemFree(m_aucSysMem1, info); + + return 0; +} + +int OsBBoxDriverInit(void) +{ + UINT32 taskID; + TSK_INIT_PARAM_S taskParam; + + if (LOS_BinarySemCreate(1, &g_opsListSem) != LOS_OK) { + BBOX_PRINT_ERR("Create g_opsListSem failed!\n"); + return -1; + } + if (LOS_BinarySemCreate(1, &g_tempErrInfoSem) != LOS_OK) { + BBOX_PRINT_ERR("Create g_tempErrInfoSem failed!\n"); + goto __err; + } + LOS_ListInit(&g_opsList); + g_tempErrInfo = LOS_MemAlloc(m_aucSysMem1, sizeof(*g_tempErrInfo)); + if (g_tempErrInfo == NULL) { + BBOX_PRINT_ERR("LOS_MemAlloc failed!\n"); + goto __err; + } + (void)memset_s(g_tempErrInfo, sizeof(*g_tempErrInfo), 0, sizeof(*g_tempErrInfo)); + (void)memset_s(&taskParam, sizeof(taskParam), 0, sizeof(taskParam)); + taskParam.auwArgs[0] = (UINTPTR)LOSCFG_LOG_ROOT_PATH; + taskParam.pfnTaskEntry = (TSK_ENTRY_FUNC)SaveErrorLog; + taskParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; + taskParam.pcName = "SaveErrorLog"; + taskParam.usTaskPrio = LOSCFG_BASE_CORE_TSK_DEFAULT_PRIO; + taskParam.uwResved = LOS_TASK_STATUS_DETACHED; +#ifdef LOSCFG_KERNEL_SMP + taskParam.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); +#endif + (void)LOS_TaskCreate(&taskID, &taskParam); + return 0; + +__err: + if (g_opsListSem != 0) { + (void)LOS_SemDelete(g_opsListSem); + } + if (g_tempErrInfoSem != 0) { + (void)LOS_SemDelete(g_tempErrInfoSem); + } + + return -1; +} +LOS_MODULE_INIT(OsBBoxDriverInit, LOS_INIT_LEVEL_ARCH); \ No newline at end of file diff --git a/kernel/common/blackbox/los_blackbox_detector.c b/kernel/common/blackbox/los_blackbox_detector.c new file mode 100644 index 00000000..5d91ef9d --- /dev/null +++ b/kernel/common/blackbox/los_blackbox_detector.c @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* ------------ includes ------------ */ +#include "los_blackbox_detector.h" +#include "los_blackbox_common.h" +#ifdef LOSCFG_LIB_LIBC +#include "stdlib.h" +#include "unistd.h" +#endif + +/* ------------ local macroes ------------ */ +/* ------------ local prototypes ------------ */ +/* ------------ local function declarations ------------ */ +/* ------------ global function declarations ------------ */ +/* ------------ local variables ------------ */ +/* ------------ function definitions ------------ */ +int UploadEventByFile(const char *filePath) +{ + if (filePath == NULL) { + BBOX_PRINT_ERR("filePath: %p\n", filePath); + return -1; + } + + return 0; +} + +int UploadEventByStream(const char *buf, size_t bufSize) +{ + if (buf == NULL || bufSize == 0) { + BBOX_PRINT_ERR("buf: %p, bufSize: %u\n", buf, (UINT32)bufSize); + return -1; + } + + return 0; +} \ No newline at end of file diff --git a/kernel/common/blackbox/los_blackbox_detector.h b/kernel/common/blackbox/los_blackbox_detector.h new file mode 100644 index 00000000..a424f7a6 --- /dev/null +++ b/kernel/common/blackbox/los_blackbox_detector.h @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef LOS_BLACKBOX_DETECTOR_H +#define LOS_BLACKBOX_DETECTOR_H + +#ifdef __cplusplus +#if __cplusplus +extern "C" { +#endif /* __cplusplus */ +#endif /* __cplusplus */ + +#ifndef __user +#define __user +#endif + +#include "los_typedef.h" + +int UploadEventByFile(const char *filePath); +int UploadEventByStream(const char *buf, size_t bufSize); + +#ifdef __cplusplus +#if __cplusplus +} +#endif /* __cplusplus */ +#endif /* __cplusplus */ + +#endif \ No newline at end of file diff --git a/kernel/common/blackbox/los_blackbox_system_adapter.c b/kernel/common/blackbox/los_blackbox_system_adapter.c new file mode 100644 index 00000000..11a85907 --- /dev/null +++ b/kernel/common/blackbox/los_blackbox_system_adapter.c @@ -0,0 +1,247 @@ +/* + * Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* ------------ includes ------------ */ +#include "los_blackbox_system_adapter.h" +#include "los_blackbox_common.h" +#include "los_blackbox_detector.h" +#ifdef LOSCFG_LIB_LIBC +#include "stdlib.h" +#include "unistd.h" +#endif +#include "los_base.h" +#include "los_config.h" +#include "los_excinfo_pri.h" +#include "los_hw.h" +#include "los_init.h" +#include "los_memory.h" +#include "los_vm_phys.h" +#include "fs/fs.h" +#include "securec.h" + +/* ------------ local macroes ------------ */ +#define MEM_OVERLAP_COUNT 50 +#define LOG_FLAG "GOODLOG" +#define FAULT_LOG_SIZE 0x4000 /* 16KB */ + +/* ------------ local prototypes ------------ */ +struct FaultLogInfo { + char flag[8]; /* 8 is the length of the flag */ + int len; /* length of the fault log saved by the module excinfo */ + struct ErrorInfo info; +}; + +/* ------------ local function declarations ------------ */ +/* ------------ global function declarations ------------ */ +/* ------------ local variables ------------ */ +static char *g_logBuffer = NULL; + +/* ------------ function definitions ------------ */ +static void SaveFaultLog(const char *filePath, const char *dataBuf, size_t bufSize, struct ErrorInfo *info) +{ + (void)SaveBasicErrorInfo(filePath, info); + (void)FullWriteFile(filePath, dataBuf, bufSize, 1); +} + +static void WriteExcFile(UINT32 startAddr, UINT32 space, UINT32 rwFlag, char *buf) +{ + (void)startAddr; + (void)space; + (void)rwFlag; + (void)buf; +} + +static void RegisterExcInfoHook(void) +{ + if (g_logBuffer != NULL) { + LOS_ExcInfoRegHook(0, FAULT_LOG_SIZE - sizeof(struct FaultLogInfo), + g_logBuffer + sizeof(struct FaultLogInfo), WriteExcFile); + } else { + BBOX_PRINT_ERR("Alloc mem failed!\n"); + } +} + +static INT32 AllocLogBuffer(void) +{ + INT32 i; + size_t nPages = ROUNDUP(FAULT_LOG_SIZE, PAGE_SIZE) >> PAGE_SHIFT; + void *tempBuffer[MEM_OVERLAP_COUNT]; + + for (i = 0; i < MEM_OVERLAP_COUNT; i++) { + g_logBuffer = LOS_PhysPagesAllocContiguous(nPages); + tempBuffer[i] = g_logBuffer; + } + for (i = 0; i < MEM_OVERLAP_COUNT - 1; i++) { + LOS_PhysPagesFreeContiguous(tempBuffer[i], nPages); + } + + return (g_logBuffer != NULL) ? 0 : -1; +} + +static void Dump(const char *logDir, struct ErrorInfo *info) +{ + struct FaultLogInfo *pInfo; + + if (logDir == NULL || info == NULL) { + BBOX_PRINT_ERR("logDir: %p, info: %p!\n", logDir, info); + return; + } + if (g_logBuffer == NULL) { + BBOX_PRINT_ERR("g_logBuffer: %p!\n", g_logBuffer); + return; + } + + if (strcmp(info->event, EVENT_PANIC) == 0) { + pInfo = (struct FaultLogInfo *)g_logBuffer; + (void)memset_s(pInfo, sizeof(*pInfo), 0, sizeof(*pInfo)); + pInfo->len = GetExcInfoLen(); + (void)memcpy_s(&pInfo->flag, sizeof(pInfo->flag), LOG_FLAG, strlen(LOG_FLAG)); + (void)memcpy_s(&pInfo->info, sizeof(pInfo->info), info, sizeof(*info)); + DCacheFlushRange((UINTPTR)g_logBuffer, (UINTPTR)(g_logBuffer + FAULT_LOG_SIZE)); + } else { + SaveFaultLog(USER_FAULT_LOG_PATH, g_logBuffer + sizeof(struct FaultLogInfo), + Min(FAULT_LOG_SIZE - sizeof(struct FaultLogInfo), GetExcInfoLen()), info); + } +} + +static void Reset(struct ErrorInfo *info) +{ + if (info == NULL) { + BBOX_PRINT_ERR("info: %p!\n", info); + return; + } + + if (strcmp(info->event, EVENT_PANIC) != 0) { + BBOX_PRINT_INFO("[%s] starts uploading event [%s]\n", info->module, info->event); + (void)UploadEventByFile(USER_FAULT_LOG_PATH); + BBOX_PRINT_INFO("[%s] ends uploading event [%s]\n", info->module, info->event); + } +} + +static int GetLastLogInfo(struct ErrorInfo *info) +{ + struct FaultLogInfo *pInfo; + + if (info == NULL) { + BBOX_PRINT_ERR("info: %p!\n", info); + return -1; + } + if (g_logBuffer == NULL) { + BBOX_PRINT_ERR("Alloc physical page failed!\n"); + return -1; + } + + pInfo = (struct FaultLogInfo *)g_logBuffer; + if (memcmp(pInfo->flag, LOG_FLAG, strlen(LOG_FLAG)) == 0) { + (void)memcpy_s(info, sizeof(*info), &pInfo->info, sizeof(pInfo->info)); + return 0; + } + + return -1; +} + +static int SaveLastLog(const char *logDir, struct ErrorInfo *info) +{ +#ifdef LOSCFG_FS_VFS + struct FaultLogInfo *pInfo; + + if (logDir == NULL || info == NULL) { + BBOX_PRINT_ERR("logDir: %p, info: %p!\n", logDir, info); + return -1; + } + if (g_logBuffer == NULL) { + BBOX_PRINT_ERR("Alloc physical page failed!\n"); + return -1; + } + + pInfo = (struct FaultLogInfo *)g_logBuffer; + if (memcmp(pInfo->flag, LOG_FLAG, strlen(LOG_FLAG)) == 0) { + SaveFaultLog(KERNEL_FAULT_LOG_PATH, g_logBuffer + sizeof(*pInfo), + Min(FAULT_LOG_SIZE - sizeof(*pInfo), pInfo->len), info); + } +#endif + (void)memset_s(g_logBuffer, FAULT_LOG_SIZE, 0, FAULT_LOG_SIZE); + BBOX_PRINT_INFO("[%s] starts uploading event [%s]\n", info->module, info->event); + (void)UploadEventByFile(KERNEL_FAULT_LOG_PATH); + BBOX_PRINT_INFO("[%s] ends uploading event [%s]\n", info->module, info->event); + + return 0; +} + +#ifdef LOSCFG_BLACKBOX_TEST +static void BBoxTest(void) +{ + struct ModuleOps ops = { + .module = "MODULE_TEST", + .Dump = NULL, + .Reset = NULL, + .GetLastLogInfo = NULL, + .SaveLastLog = NULL, + }; + + if (BBoxRegisterModuleOps(&ops) != 0) { + BBOX_PRINT_ERR("BBoxRegisterModuleOps failed!\n"); + return; + } + BBoxNotifyError("EVENT_TEST1", "MODULE_TEST", "Test BBoxNotifyError111", 0); +} +#endif + +int OsBBoxSystemAdapterInit(void) +{ + struct ModuleOps ops = { + .module = MODULE_SYSTEM, + .Dump = Dump, + .Reset = Reset, + .GetLastLogInfo = GetLastLogInfo, + .SaveLastLog = SaveLastLog, + }; + + /* allocate buffer for kmsg */ + if (AllocLogBuffer() == 0) { + BBOX_PRINT_INFO("g_logBuffer: %p for blackbox!\n", g_logBuffer); + RegisterExcInfoHook(); + if (BBoxRegisterModuleOps(&ops) != 0) { + BBOX_PRINT_ERR("BBoxRegisterModuleOps failed!\n"); + LOS_PhysPagesFreeContiguous(g_logBuffer, ROUNDUP(FAULT_LOG_SIZE, PAGE_SIZE) >> PAGE_SHIFT); + g_logBuffer = NULL; + return -1; + } + } else { + BBOX_PRINT_ERR("AllocLogBuffer failed!\n"); + } + +#ifdef LOSCFG_BLACKBOX_TEST + BBoxTest(); +#endif + + return 0; +} +LOS_MODULE_INIT(OsBBoxSystemAdapterInit, LOS_INIT_LEVEL_ARCH); \ No newline at end of file diff --git a/kernel/common/blackbox/los_blackbox_system_adapter.h b/kernel/common/blackbox/los_blackbox_system_adapter.h new file mode 100644 index 00000000..e4fbf2cc --- /dev/null +++ b/kernel/common/blackbox/los_blackbox_system_adapter.h @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef LOS_BLACKBOX_SYSTEM_ADAPTER_H +#define LOS_BLACKBOX_SYSTEM_ADAPTER_H + +#ifdef __cplusplus +#if __cplusplus +extern "C" { +#endif /* __cplusplus */ +#endif /* __cplusplus */ + +#ifndef __user +#define __user +#endif + +#include "los_blackbox.h" +#include "los_blackbox_common.h" + +int OsBBoxSystemAdapterInit(void); + +#ifdef __cplusplus +#if __cplusplus +} +#endif /* __cplusplus */ +#endif /* __cplusplus */ + +#endif \ No newline at end of file diff --git a/kernel/common/los_excinfo.c b/kernel/common/los_excinfo.c index b18ee23b..f605c186 100644 --- a/kernel/common/los_excinfo.c +++ b/kernel/common/los_excinfo.c @@ -34,13 +34,29 @@ #ifdef LOSCFG_SHELL #include "shcmd.h" #endif +#ifdef LOSCFG_BLACKBOX +#include "fs/fs.h" +#include "fs/fs_operation.h" +#endif + +#ifdef LOSCFG_BLACKBOX +#define TEMP_EXC_INFO_SIZE 0x400 +#endif #ifdef LOSCFG_SAVE_EXCINFO STATIC log_read_write_fn g_excInfoRW = NULL; /* the hook of read-writing exception information */ STATIC CHAR *g_excInfoBuf = NULL; /* pointer to the buffer for storing the exception information */ +#ifdef LOSCFG_BLACKBOX +STATIC UINT32 g_excInfoIndex = 0; /* the index of the buffer for storing the exception information */ +#else STATIC UINT32 g_excInfoIndex = 0xFFFFFFFF; /* the index of the buffer for storing the exception information */ +#endif STATIC UINT32 g_recordAddr = 0; /* the address of storing the exception information */ STATIC UINT32 g_recordSpace = 0; /* the size of storing the exception information */ +#ifdef LOSCFG_BLACKBOX +STATIC UINT32 g_excLogLen = 0; /* the length of the exception information */ +STATIC CHAR *g_tempExcInfoBuf = NULL; /* pointer to the buffer for storing the temp exception information */ +#endif VOID SetExcInfoRW(log_read_write_fn func) { @@ -65,6 +81,11 @@ CHAR *GetExcInfoBuf(VOID) VOID SetExcInfoIndex(UINT32 index) { g_excInfoIndex = index; +#ifdef LOSCFG_BLACKBOX + if (g_excInfoIndex == 0) { + g_excLogLen = 0; + } +#endif } UINT32 GetExcInfoIndex(VOID) @@ -72,6 +93,13 @@ UINT32 GetExcInfoIndex(VOID) return g_excInfoIndex; } +#ifdef LOSCFG_BLACKBOX +UINT32 GetExcInfoLen(VOID) +{ + return g_excLogLen; +} +#endif + VOID SetRecordAddr(UINT32 addr) { g_recordAddr = addr; @@ -92,8 +120,35 @@ UINT32 GetRecordSpace(VOID) return g_recordSpace; } +#ifdef LOSCFG_BLACKBOX +STATIC VOID SaveExcInfoUnsafe(CHAR *buf, INT32 size) +{ + for (INT32 i = 0; i < size; i++) { + *(g_excInfoBuf + g_excInfoIndex) = *(buf + i); + g_excInfoIndex++; + if (g_excLogLen < g_recordSpace) { + g_excLogLen++; + } + if (g_excInfoIndex >= g_recordSpace) { + g_excInfoIndex = 0; + } + } +} +#endif + VOID WriteExcBufVa(const CHAR *format, va_list arglist) { +#ifdef LOSCFG_BLACKBOX + if (g_tempExcInfoBuf != NULL) { + (VOID)memset_s(g_tempExcInfoBuf, TEMP_EXC_INFO_SIZE, 0, TEMP_EXC_INFO_SIZE); + INT32 ret = vsnprintf_s(g_tempExcInfoBuf, TEMP_EXC_INFO_SIZE, TEMP_EXC_INFO_SIZE - 1, format, arglist); + if (ret == -1) { + PRINT_ERR("g_tempExcInfoBuf is not enough or vsnprintf_s is error.\n"); + return; + } + SaveExcInfoUnsafe(g_tempExcInfoBuf, ret); + } +#else errno_t ret; if (g_recordSpace > g_excInfoIndex) { @@ -105,6 +160,7 @@ VOID WriteExcBufVa(const CHAR *format, va_list arglist) } g_excInfoIndex += ret; } +#endif } VOID WriteExcInfoToBuf(const CHAR *format, ...) @@ -131,6 +187,9 @@ VOID LOS_ExcInfoRegHook(UINT32 startAddr, UINT32 space, CHAR *buf, log_read_writ #ifdef LOSCFG_FS_VFS los_vfs_init(); #endif +#ifdef LOSCFG_BLACKBOX + g_tempExcInfoBuf = LOS_VMalloc(TEMP_EXC_INFO_SIZE); +#endif } /* Be called in the exception. */ diff --git a/kernel/common/los_excinfo_pri.h b/kernel/common/los_excinfo_pri.h index ba68d5f4..a30597d1 100644 --- a/kernel/common/los_excinfo_pri.h +++ b/kernel/common/los_excinfo_pri.h @@ -47,6 +47,9 @@ extern VOID SetExcInfoBuf(CHAR *buf); extern CHAR *GetExcInfoBuf(VOID); extern VOID SetExcInfoIndex(UINT32 index); extern UINT32 GetExcInfoIndex(VOID); +#ifdef LOSCFG_BLACKBOX +extern UINT32 GetExcInfoLen(VOID); +#endif extern VOID SetRecordAddr(UINT32 addr); extern UINT32 GetRecordAddr(VOID); extern VOID SetRecordSpace(UINT32 space); diff --git a/tools/build/mk/liteos_tables_ldflags.mk b/tools/build/mk/liteos_tables_ldflags.mk index dd670571..af5aa945 100644 --- a/tools/build/mk/liteos_tables_ldflags.mk +++ b/tools/build/mk/liteos_tables_ldflags.mk @@ -135,7 +135,9 @@ LITEOS_TABLES_KERNEL_INIT_LDFLAGS := \ -uOsCpupGuardCreator \ -uOsMpInit \ -uOsResourceFreeTaskCreate \ - -uOsSystemInit + -uOsSystemInit \ + -uOsBBoxSystemAdapterInit \ + -uOsBBoxDriverInit LITEOS_TABLES_DRIVER_LDFLAGS := \ -ui2c_init \ diff --git a/tools/build/mk/los_config.mk b/tools/build/mk/los_config.mk index 9c3923bd..ad304b7f 100644 --- a/tools/build/mk/los_config.mk +++ b/tools/build/mk/los_config.mk @@ -441,6 +441,12 @@ ifeq ($(LOSCFG_BASE_CORE_HILOG), y) LITEOS_HILOG_INCLUDE += -I $(LITEOSTOPDIR)/../../base/hiviewdfx/hilog_lite/interfaces/native/kits/hilog LITEOS_CMACRO += -DLOSCFG_BASE_CORE_HILOG endif +ifeq ($(LOSCFG_BLACKBOX), y) + LITEOS_BASELIB += -lblackbox + LIB_SUBDIRS += $(LITEOSTOPDIR)/kernel/common/blackbox + LITEOS_BLACKBOX_INCLUDE += -I $(LITEOSTOPDIR)/kernel/common/blackbox + LITEOS_CMACRO += -DLOSCFG_BLACKBOX +endif ############################## Dfx Option End ####################################### ############################# Tools && Debug Option Begin ############################## @@ -637,7 +643,8 @@ LITEOS_DRIVERS_INCLUDE := $(LITEOS_CELLWISE_INCLUDE) $(LITEOS_GPIO_INCLUDE $(LITEOS_DRIVERS_HDF_INCLUDE) $(LITEOS_TZDRIVER_INCLUDE) \ $(LITEOS_HIEVENT_INCLUDE) $(LITEOS_DEV_MEM_INCLUDE) \ $(LITEOS_DEV_QUICKSTART_INCLUDE) -LITEOS_DFX_INCLUDE := $(LITEOS_HILOG_INCLUDE) +LITEOS_DFX_INCLUDE := $(LITEOS_HILOG_INCLUDE) \ + $(LITEOS_BLACKBOX_INCLUDE) LITEOS_SECURITY_INCLUDE := $(LITEOS_SECURITY_CAP_INC) $(LITEOS_SECURITY_VID_INC) LOSCFG_TOOLS_DEBUG_INCLUDE := $(LITEOS_SHELL_INCLUDE) $(LITEOS_UART_INCLUDE) \ From ac8c2c6d5b9ede0e46b48212f0b3447605a613c4 Mon Sep 17 00:00:00 2001 From: Caoruihong Date: Wed, 7 Jul 2021 00:03:12 +0800 Subject: [PATCH 13/43] fix: minimal compile fix compile errors in minimal compilation Signed-off-by: Caoruihong Change-Id: I48f4f7b27c684e2c747c1949776c5c4f9e383dec --- apps/module.mk | 2 ++ arch/arm/arm/src/los_exc.c | 2 +- fs/proc/os_adapt/kernel_trace_proc.c | 2 +- kernel/base/core/los_task.c | 2 ++ kernel/base/include/los_task_pri.h | 2 ++ kernel/base/ipc/los_signal.c | 2 ++ kernel/base/vm/los_vm_filemap.c | 2 ++ syscall/los_syscall.h | 2 ++ .../mini_qemu_liteos_a_clang.config} | 1 + .../mini_qemu_liteos_a_clang_release.config | 15 +++++++++++++++ tools/build/mk/los_config.mk | 2 ++ 11 files changed, 32 insertions(+), 2 deletions(-) rename tools/build/config/{qemu_arm_virt_mini.config => debug/mini_qemu_liteos_a_clang.config} (94%) create mode 100644 tools/build/config/mini_qemu_liteos_a_clang_release.config diff --git a/apps/module.mk b/apps/module.mk index e2d014d6..b3df0fc2 100644 --- a/apps/module.mk +++ b/apps/module.mk @@ -45,6 +45,8 @@ endif #only enable for qemu now ifeq ($(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7), y) +ifeq ($(LOSCFG_SHELL), y) APP_SUBDIRS += mksh APP_SUBDIRS += toybox endif +endif diff --git a/arch/arm/arm/src/los_exc.c b/arch/arm/arm/src/los_exc.c index 06bbdb39..5c1b10a7 100644 --- a/arch/arm/arm/src/los_exc.c +++ b/arch/arm/arm/src/los_exc.c @@ -1182,7 +1182,7 @@ __attribute__((noinline)) VOID LOS_Panic(const CHAR *fmt, ...) } /* stack protector */ -UINT32 __stack_chk_guard = 0xd00a0dff; +USED UINT32 __stack_chk_guard = 0xd00a0dff; VOID __stack_chk_fail(VOID) { diff --git a/fs/proc/os_adapt/kernel_trace_proc.c b/fs/proc/os_adapt/kernel_trace_proc.c index dbb77853..16445b81 100644 --- a/fs/proc/os_adapt/kernel_trace_proc.c +++ b/fs/proc/os_adapt/kernel_trace_proc.c @@ -32,9 +32,9 @@ #include #include #include "proc_fs.h" -#include "los_trace.h" #ifdef LOSCFG_KERNEL_TRACE +#include "los_trace.h" static int KernelTraceProcFill(struct SeqBuf *m, void *v) { (void)v; diff --git a/kernel/base/core/los_task.c b/kernel/base/core/los_task.c index 0eadc9db..f7b3b1a9 100644 --- a/kernel/base/core/los_task.c +++ b/kernel/base/core/los_task.c @@ -1413,6 +1413,7 @@ STATIC VOID OsExitGroupActiveTaskKilled(LosProcessCB *processCB, LosTaskCB *task LOS_MpSchedule(taskCB->currCpu); } else #endif +#ifdef LOSCFG_KERNEL_VM { ret = OsTaskKillUnsafe(taskCB->taskID, SIGKILL); if (ret != LOS_OK) { @@ -1420,6 +1421,7 @@ STATIC VOID OsExitGroupActiveTaskKilled(LosProcessCB *processCB, LosTaskCB *task taskCB->processID, OsCurrTaskGet()->taskID, taskCB->taskID, ret); } } +#endif if (!(taskCB->taskStatus & OS_TASK_FLAG_PTHREAD_JOIN)) { taskCB->taskStatus |= OS_TASK_FLAG_PTHREAD_JOIN; diff --git a/kernel/base/include/los_task_pri.h b/kernel/base/include/los_task_pri.h index b19f74e8..e2e33c02 100644 --- a/kernel/base/include/los_task_pri.h +++ b/kernel/base/include/los_task_pri.h @@ -45,7 +45,9 @@ #include "los_cpup_pri.h" #endif +#ifdef LOSCFG_KERNEL_TRACE #include "los_trace.h" +#endif #ifdef __cplusplus #if __cplusplus diff --git a/kernel/base/ipc/los_signal.c b/kernel/base/ipc/los_signal.c index 06fee687..5366e56e 100644 --- a/kernel/base/ipc/los_signal.c +++ b/kernel/base/ipc/los_signal.c @@ -101,11 +101,13 @@ STATIC UINT32 OsPendingTaskWake(LosTaskCB *taskCB, INT32 signo) case OS_TASK_WAIT_SIGNAL: OsSigWaitTaskWake(taskCB, signo); break; +#ifdef LOSCFG_KERNEL_LITEIPC case OS_TASK_WAIT_LITEIPC: taskCB->ipcStatus &= ~IPC_THREAD_STATUS_PEND; OsTaskWakeClearPendMask(taskCB); OsSchedTaskWake(taskCB); break; +#endif case OS_TASK_WAIT_FUTEX: OsFutexNodeDeleteFromFutexHash(&taskCB->futex, TRUE, NULL, NULL); OsTaskWakeClearPendMask(taskCB); diff --git a/kernel/base/vm/los_vm_filemap.c b/kernel/base/vm/los_vm_filemap.c index 9a6ec2ce..c248d3de 100644 --- a/kernel/base/vm/los_vm_filemap.c +++ b/kernel/base/vm/los_vm_filemap.c @@ -41,7 +41,9 @@ #include "los_vm_fault.h" #include "los_process_pri.h" #include "los_vm_lock.h" +#ifdef LOSCFG_FS_VFS #include "vnode.h" +#endif #ifndef UNUSED #define UNUSED(x) (VOID)x diff --git a/syscall/los_syscall.h b/syscall/los_syscall.h index 14995d43..37429b88 100644 --- a/syscall/los_syscall.h +++ b/syscall/los_syscall.h @@ -62,7 +62,9 @@ #endif #include #include "sys/resource.h" +#ifdef LOSCFG_FS_VFS #include "vnode.h" +#endif /* process */ extern unsigned int SysGetGroupId(void); diff --git a/tools/build/config/qemu_arm_virt_mini.config b/tools/build/config/debug/mini_qemu_liteos_a_clang.config similarity index 94% rename from tools/build/config/qemu_arm_virt_mini.config rename to tools/build/config/debug/mini_qemu_liteos_a_clang.config index 1300f151..6670fbb1 100644 --- a/tools/build/config/qemu_arm_virt_mini.config +++ b/tools/build/config/debug/mini_qemu_liteos_a_clang.config @@ -2,6 +2,7 @@ LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7=y LOSCFG_BOARD_CONFIG_PATH="device/qemu/arm_virt/liteos_a/config/board" # LOSCFG_HRTIMER_ENABLE is not set # LOSCFG_IRQ_USE_STANDALONE_STACK is not set +# LOSCFG_BLACKBOX is not set # LOSCFG_KERNEL_MMU is not set # LOSCFG_KERNEL_EXTKERNEL is not set # LOSCFG_BASE_CORE_HILOG is not set diff --git a/tools/build/config/mini_qemu_liteos_a_clang_release.config b/tools/build/config/mini_qemu_liteos_a_clang_release.config new file mode 100644 index 00000000..6670fbb1 --- /dev/null +++ b/tools/build/config/mini_qemu_liteos_a_clang_release.config @@ -0,0 +1,15 @@ +LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7=y +LOSCFG_BOARD_CONFIG_PATH="device/qemu/arm_virt/liteos_a/config/board" +# LOSCFG_HRTIMER_ENABLE is not set +# LOSCFG_IRQ_USE_STANDALONE_STACK is not set +# LOSCFG_BLACKBOX is not set +# LOSCFG_KERNEL_MMU is not set +# LOSCFG_KERNEL_EXTKERNEL is not set +# LOSCFG_BASE_CORE_HILOG is not set +# LOSCFG_LIB_ZLIB is not set +# LOSCFG_FS_VFS is not set +# LOSCFG_NET_LWIP_SACK is not set +# LOSCFG_PLATFORM_ADAPT is not set +# LOSCFG_ENABLE_MAGICKEY is not set +# LOSCFG_DRIVERS is not set +# LOSCFG_SECURITY is not set diff --git a/tools/build/mk/los_config.mk b/tools/build/mk/los_config.mk index ad304b7f..93f4e3b2 100644 --- a/tools/build/mk/los_config.mk +++ b/tools/build/mk/los_config.mk @@ -198,9 +198,11 @@ ifeq ($(LOSCFG_KERNEL_VDSO), y) LITEOS_VDSO_INCLUDE += -I $(LITEOSTOPDIR)/kernel/extended/vdso/include endif +ifeq ($(LOSCFG_KERNEL_TRACE), y) LITEOS_BASELIB += -ltrace LIB_SUBDIRS += kernel/extended/trace LITEOS_TRACE_INCLUDE += -I $(LITEOSTOPDIR)/kernel/extended/trace +endif ifeq ($(LOSCFG_KERNEL_LITEIPC), y) LITEOS_BASELIB += -lliteipc From 55e5e29005111110aa6ce69ec7c2de418fd8cf4f Mon Sep 17 00:00:00 2001 From: Denny Date: Wed, 7 Jul 2021 10:29:43 +0800 Subject: [PATCH 14/43] =?UTF-8?q?=E5=9B=9E=E9=80=80=20'Pull=20Request=20!4?= =?UTF-8?q?01=20:=20=E3=80=90DFX=E5=AD=90=E7=B3=BB=E7=BB=9F=E3=80=91?= =?UTF-8?q?=E3=80=90BBoxDetector=E3=80=91LiteOS=5FA=E6=AD=BB=E6=9C=BA?= =?UTF-8?q?=E9=87=8D=E5=90=AF=E7=BB=B4=E6=B5=8B=E6=A1=86=E6=9E=B6'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Kconfig | 4 +- arch/arm/arm/src/los_exc.c | 14 - kernel/base/misc/task_shellcmd.c | 6 - kernel/common/blackbox/Kconfig | 11 - kernel/common/blackbox/Makefile | 14 - kernel/common/blackbox/los_blackbox.h | 95 ---- kernel/common/blackbox/los_blackbox_common.c | 101 ---- kernel/common/blackbox/los_blackbox_common.h | 65 --- kernel/common/blackbox/los_blackbox_core.c | 454 ------------------ .../common/blackbox/los_blackbox_detector.c | 63 --- .../common/blackbox/los_blackbox_detector.h | 55 --- .../blackbox/los_blackbox_system_adapter.c | 247 ---------- .../blackbox/los_blackbox_system_adapter.h | 55 --- kernel/common/los_excinfo.c | 59 --- kernel/common/los_excinfo_pri.h | 3 - tools/build/mk/liteos_tables_ldflags.mk | 4 +- tools/build/mk/los_config.mk | 9 +- 17 files changed, 3 insertions(+), 1256 deletions(-) delete mode 100644 kernel/common/blackbox/Kconfig delete mode 100644 kernel/common/blackbox/Makefile delete mode 100644 kernel/common/blackbox/los_blackbox.h delete mode 100644 kernel/common/blackbox/los_blackbox_common.c delete mode 100644 kernel/common/blackbox/los_blackbox_common.h delete mode 100644 kernel/common/blackbox/los_blackbox_core.c delete mode 100644 kernel/common/blackbox/los_blackbox_detector.c delete mode 100644 kernel/common/blackbox/los_blackbox_detector.h delete mode 100644 kernel/common/blackbox/los_blackbox_system_adapter.c delete mode 100644 kernel/common/blackbox/los_blackbox_system_adapter.h diff --git a/Kconfig b/Kconfig index 491abbe2..8bce9860 100644 --- a/Kconfig +++ b/Kconfig @@ -61,8 +61,6 @@ source "../../kernel/liteos_a/arch/Kconfig" source "../../kernel/liteos_a/kernel/common/Kconfig" ######################### config options of patchfs ##################### source "../../kernel/liteos_a/kernel/common/patchfs/Kconfig" -######################### config options of blackbox ##################### -source "../../kernel/liteos_a/kernel/common/blackbox/Kconfig" config QUICK_START bool "Enable QUICK_START" @@ -177,7 +175,7 @@ config PLATFORM_DVFS config SAVE_EXCINFO bool "Enable Saving Exception Information" - default y if BLACKBOX + default n help Answer Y to enable LiteOS support saving exception information to storage medium. diff --git a/arch/arm/arm/src/los_exc.c b/arch/arm/arm/src/los_exc.c index 06bbdb39..d944caaf 100644 --- a/arch/arm/arm/src/los_exc.c +++ b/arch/arm/arm/src/los_exc.c @@ -62,9 +62,6 @@ #ifdef LOSCFG_FS_VFS #include "console.h" #endif -#ifdef LOSCFG_BLACKBOX -#include "los_blackbox.h" -#endif #define INVALID_CPUID 0xFFFF @@ -592,9 +589,6 @@ STATIC VOID OsUserExcHandle(ExcContext *excBufAddr) /* Exception handling All operations should be kept prior to that operation */ OsExcRestore(); /* kill user exc process */ -#ifdef LOSCFG_BLACKBOX - BBoxNotifyError("USER_CRASH", MODULE_SYSTEM, "Crash in user", 0); -#endif LOS_Exit(OS_PRO_EXIT_OK); } @@ -1064,9 +1058,6 @@ LITE_OS_SEC_TEXT VOID STATIC OsExcPriorDisposal(ExcContext *excBufAddr) LITE_OS_SEC_TEXT_INIT STATIC VOID OsPrintExcHead(UINT32 far) { -#ifdef LOSCFG_BLACKBOX - SetExcInfoIndex(0); -#endif #ifdef LOSCFG_KERNEL_VM /* You are not allowed to add any other print information before this exception information */ if (g_excFromUserMode[ArchCurrCpuid()] == TRUE) { @@ -1134,9 +1125,7 @@ LITE_OS_SEC_TEXT_INIT VOID OsExcHandleEntry(UINT32 excType, ExcContext *excBufAd if (g_curNestCount[ArchCurrCpuid()] == 1) { #ifdef LOSCFG_SAVE_EXCINFO if (func != NULL) { -#ifndef LOSCFG_BLACKBOX SetExcInfoIndex(0); -#endif OsSysStateSave(&intCount, &lockCount); OsRecordExcInfoTime(); OsSysStateRestore(intCount, lockCount); @@ -1165,9 +1154,6 @@ LITE_OS_SEC_TEXT_INIT VOID OsExcHandleEntry(UINT32 excType, ExcContext *excBufAd } #endif -#ifdef LOSCFG_BLACKBOX - BBoxNotifyError(EVENT_PANIC, MODULE_SYSTEM, "Crash in kernel", 1); -#endif while (1) {} } diff --git a/kernel/base/misc/task_shellcmd.c b/kernel/base/misc/task_shellcmd.c index 9b0d678e..05623a56 100644 --- a/kernel/base/misc/task_shellcmd.c +++ b/kernel/base/misc/task_shellcmd.c @@ -85,18 +85,12 @@ STATIC UINT32 *taskWaterLine = NULL; #define OS_TASK_ALL_INFO_LEN (g_taskMaxNum * (sizeof(LosTaskCB) + sizeof(UINT32))) #ifdef LOSCFG_FS_VFS -#ifdef LOSCFG_BLACKBOX -#define SaveExcInfo(arg, ...) WriteExcInfoToBuf(arg, ##__VA_ARGS__) -#else -#define SaveExcInfo(arg, ...) -#endif #define PROCESS_INFO_SHOW(seqBuf, arg...) do { \ if (seqBuf != NULL) { \ (void)LosBufPrintf((struct SeqBuf *)seqBuf, ##arg); \ } else { \ PRINTK(arg); \ } \ - SaveExcInfo(arg); \ } while (0) #else #define PROCESS_INFO_SHOW(seqBuf, arg...) PRINTK(arg) diff --git a/kernel/common/blackbox/Kconfig b/kernel/common/blackbox/Kconfig deleted file mode 100644 index 0c1e4f07..00000000 --- a/kernel/common/blackbox/Kconfig +++ /dev/null @@ -1,11 +0,0 @@ -config BLACKBOX - bool "Enable BlackBox" - default y - help - Answer Y to enable LiteOS support blackbox - -config LOG_ROOT_PATH - string - default "/storage/data/log" if BLACKBOX - help - define the default log path of blackbox \ No newline at end of file diff --git a/kernel/common/blackbox/Makefile b/kernel/common/blackbox/Makefile deleted file mode 100644 index e67f8794..00000000 --- a/kernel/common/blackbox/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -include $(LITEOSTOPDIR)/config.mk - -MODULE_NAME := $(notdir $(shell pwd)) - -LOCAL_SRCS := $(wildcard *.c) - -LOCAL_INCLUDE := \ - -I $(LITEOSTOPDIR)/kernel/common \ - -I $(LITEOSTOPDIR)/kernel/common/blackbox \ - -I $(LITEOSTOPDIR)/syscall \ - -LOCAL_FLAGS := $(LOCAL_INCLUDE) $(LITEOS_GCOV_OPTS) - -include $(MODULE) diff --git a/kernel/common/blackbox/los_blackbox.h b/kernel/common/blackbox/los_blackbox.h deleted file mode 100644 index b60460ca..00000000 --- a/kernel/common/blackbox/los_blackbox.h +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * 3. Neither the name of the copyright holder nor the names of its contributors may be used - * to endorse or promote products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef LOS_BLACKBOX_H -#define LOS_BLACKBOX_H - -#ifdef __cplusplus -#if __cplusplus -extern "C" { -#endif /* __cplusplus */ -#endif /* __cplusplus */ - -#ifndef __user -#define __user -#endif - -#include "stdarg.h" -#include "los_typedef.h" - -#define PATH_MAX_LEN 256 -#define EVENT_MAX_LEN 32 -#define MODULE_MAX_LEN 32 -#define ERROR_DESC_MAX_LEN 512 -#ifndef LOSCFG_LOG_ROOT_PATH -#define LOSCFG_LOG_ROOT_PATH "/storage/data/log" -#endif -#define KERNEL_FAULT_LOG_PATH LOSCFG_LOG_ROOT_PATH "/kernel_fault.log" -#define USER_FAULT_LOG_PATH LOSCFG_LOG_ROOT_PATH "/user_fault.log" - -#define MODULE_SYSTEM "SYSTEM" -#define EVENT_SYSREBOOT "SYSREBOOT" -#define EVENT_LONGPRESS "LONGPRESS" -#define EVENT_COMBINATIONKEY "COMBINATIONKEY" -#define EVENT_SUBSYSREBOOT "SUBSYSREBOOT" -#define EVENT_POWEROFF "POWEROFF" -#define EVENT_PANIC "PANIC" -#define EVENT_SYS_WATCHDOG "SYSWATCHDOG" -#define EVENT_HUNGTASK "HUNGTASK" -#define EVENT_BOOTFAIL "BOOTFAIL" - -struct ErrorInfo { - char event[EVENT_MAX_LEN]; - char module[MODULE_MAX_LEN]; - char errorDesc[ERROR_DESC_MAX_LEN]; -}; - -struct ModuleOps { - char module[MODULE_MAX_LEN]; - void (*Dump)(const char *logDir, struct ErrorInfo *info); - void (*Reset)(struct ErrorInfo *info); - int (*GetLastLogInfo)(struct ErrorInfo *info); - int (*SaveLastLog)(const char *logDir, struct ErrorInfo *info); -}; - -int BBoxRegisterModuleOps(struct ModuleOps *ops); -int BBoxNotifyError(const char event[EVENT_MAX_LEN], - const char module[MODULE_MAX_LEN], - const char errorDesc[ERROR_DESC_MAX_LEN], - int needSysReset); -int OsBBoxDriverInit(void); - -#ifdef __cplusplus -#if __cplusplus -} -#endif /* __cplusplus */ -#endif /* __cplusplus */ - -#endif \ No newline at end of file diff --git a/kernel/common/blackbox/los_blackbox_common.c b/kernel/common/blackbox/los_blackbox_common.c deleted file mode 100644 index 074f7e7d..00000000 --- a/kernel/common/blackbox/los_blackbox_common.c +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * 3. Neither the name of the copyright holder nor the names of its contributors may be used - * to endorse or promote products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* ------------ includes ------------ */ -#include "los_blackbox_common.h" -#ifdef LOSCFG_LIB_LIBC -#include "stdlib.h" -#include "unistd.h" -#endif -#include "fs/fs.h" -#include "securec.h" -#include "los_memory.h" - -/* ------------ local macroes ------------ */ -/* ------------ local prototypes ------------ */ -/* ------------ local function declarations ------------ */ -/* ------------ global function declarations ------------ */ -/* ------------ local variables ------------ */ -/* ------------ function definitions ------------ */ -int FullWriteFile(const char *filePath, const char *buf, size_t bufSize, int isAppend) -{ - int fd; - int totalToWrite = (int)bufSize; - int totalWrite = 0; - - if (filePath == NULL || buf == NULL || bufSize == 0) { - BBOX_PRINT_ERR("filePath: %p, buf: %p, bufSize: %lu!\n", filePath, buf, bufSize); - return -1; - } - - fd = open(filePath, O_CREAT | O_RDWR | (isAppend ? O_APPEND : O_TRUNC), 0644); - if (fd < 0) { - BBOX_PRINT_ERR("Create file [%s] failed, fd: %d!\n", filePath, fd); - return -1; - } - while (totalToWrite > 0) { - int writeThisTime = write(fd, buf, totalToWrite); - if (writeThisTime < 0) { - BBOX_PRINT_ERR("Failed to write file [%s]!\n", filePath); - (void)close(fd); - return -1; - } - buf += writeThisTime; - totalToWrite -= writeThisTime; - totalWrite += writeThisTime; - } - (void)close(fd); - - return (totalWrite == (int)bufSize) ? 0 : -1; -} - -int SaveBasicErrorInfo(const char *filePath, struct ErrorInfo *info) -{ - char *buf; - - if (filePath == NULL || info == NULL) { - BBOX_PRINT_ERR("filePath: %p, event: %p!\n", filePath, info); - return -1; - } - - buf = LOS_MemAlloc(m_aucSysMem1, ERROR_INFO_MAX_LEN); - if (buf == NULL) { - BBOX_PRINT_ERR("LOS_MemAlloc failed!\n"); - return -1; - } - (void)memset_s(buf, ERROR_INFO_MAX_LEN, 0, ERROR_INFO_MAX_LEN); - (void)snprintf_s(buf, ERROR_INFO_MAX_LEN, ERROR_INFO_MAX_LEN - 1, - ERROR_INFO_HEADER ERROR_INFO_HEADER_FORMAT, info->event, info->module, info->errorDesc); - *(buf + ERROR_INFO_MAX_LEN - 1) = '\0'; - (void)FullWriteFile(filePath, buf, strlen(buf), 0); - (void)LOS_MemFree(m_aucSysMem1, buf); - - return 0; -} \ No newline at end of file diff --git a/kernel/common/blackbox/los_blackbox_common.h b/kernel/common/blackbox/los_blackbox_common.h deleted file mode 100644 index b6e76e9d..00000000 --- a/kernel/common/blackbox/los_blackbox_common.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * 3. Neither the name of the copyright holder nor the names of its contributors may be used - * to endorse or promote products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef LOS_BLACKBOX_COMMON_H -#define LOS_BLACKBOX_COMMON_H - -#ifdef __cplusplus -#if __cplusplus -extern "C" { -#endif /* __cplusplus */ -#endif /* __cplusplus */ - -#ifndef __user -#define __user -#endif - -#include "los_blackbox.h" -#include "los_printf.h" -#include "los_typedef.h" - -#define ERROR_INFO_HEADER "#### error info ####\n" -#define ERROR_INFO_HEADER_FORMAT "event: %s\nmodule: %s\nerrorDesc: %s\n" -#define ERROR_INFO_MAX_LEN 768 -#define Min(a, b) (((a) > (b)) ? (b) : (a)) -#define BBOX_PRINT_ERR(format, ...) PRINTK("bbox: func: %s, line: %d, Err: " \ - format, __func__, __LINE__, ##__VA_ARGS__) -#define BBOX_PRINT_INFO(format, ...) PRINTK("bbox: Info: " format, ##__VA_ARGS__) - -int FullWriteFile(const char *filePath, const char *buf, size_t bufSize, int isAppend); -int SaveBasicErrorInfo(const char *filePath, struct ErrorInfo *info); - -#ifdef __cplusplus -#if __cplusplus -} -#endif /* __cplusplus */ -#endif /* __cplusplus */ - -#endif \ No newline at end of file diff --git a/kernel/common/blackbox/los_blackbox_core.c b/kernel/common/blackbox/los_blackbox_core.c deleted file mode 100644 index 64199683..00000000 --- a/kernel/common/blackbox/los_blackbox_core.c +++ /dev/null @@ -1,454 +0,0 @@ -/* - * Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * 3. Neither the name of the copyright holder nor the names of its contributors may be used - * to endorse or promote products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* ------------ includes ------------ */ -#include "los_blackbox.h" -#include "los_blackbox_common.h" -#include "los_blackbox_detector.h" -#ifdef LOSCFG_LIB_LIBC -#include "stdlib.h" -#include "unistd.h" -#endif -#include "los_base.h" -#include "los_config.h" -#include "los_excinfo_pri.h" -#include "los_hw.h" -#include "los_init.h" -#include "los_memory.h" -#include "los_sem.h" -#include "los_syscall.h" -#include "securec.h" -#include "sys/reboot.h" - -/* ------------ local macroes ------------ */ -#define LOG_WAIT_TIMES 10 -#define LOG_PART_WAIT_TIME 1000 - -/* ------------ local prototypes ------------ */ -typedef struct BBoxOps { - LOS_DL_LIST opsList; - struct ModuleOps ops; -} BBoxOps; - -/* ------------ local function declarations ------------ */ -/* ------------ global function declarations ------------ */ -/* ------------ local variables ------------ */ -static UINT32 g_opsListSem = 0; -static UINT32 g_tempErrInfoSem = 0; -static LOS_DL_LIST_HEAD(g_opsList); -struct ErrorInfo *g_tempErrInfo; - -/* ------------ function definitions ------------ */ -static void FormatErrorInfo(struct ErrorInfo *info, - const char event[EVENT_MAX_LEN], - const char module[MODULE_MAX_LEN], - const char errorDesc[ERROR_DESC_MAX_LEN]) -{ - if (info == NULL || event == NULL || module == NULL || errorDesc == NULL) { - BBOX_PRINT_ERR("info: %p, event: %p, module: %p, errorDesc: %p!\n", info, event, module, errorDesc); - return; - } - - (void)memset_s(info, sizeof(*info), 0, sizeof(*info)); - (void)strncpy_s(info->event, sizeof(info->event), event, Min(strlen(event), sizeof(info->event) - 1)); - info->event[sizeof(info->event) - 1] = '\0'; - (void)strncpy_s(info->module, sizeof(info->module), module, Min(strlen(module), sizeof(info->module) - 1)); - info->module[sizeof(info->module) - 1] = '\0'; - (void)strncpy_s(info->errorDesc, sizeof(info->errorDesc), errorDesc, - Min(strlen(errorDesc), sizeof(info->errorDesc) - 1)); - info->errorDesc[sizeof(info->errorDesc) - 1] = '\0'; -} - -#ifdef LOSCFG_FS_VFS -static bool IsLogPartReady(void) -{ - return access(LOSCFG_LOG_ROOT_PATH, 0) == 0; -} - -static void WaitForLogPart(void) -{ - BBOX_PRINT_INFO("wait for log part [%s] begin!\n", LOSCFG_LOG_ROOT_PATH); - while (!IsLogPartReady()) { - LOS_Msleep(LOG_PART_WAIT_TIME); - } - BBOX_PRINT_INFO("wait for log part [%s] end!\n", LOSCFG_LOG_ROOT_PATH); -} -#else -static bool IsLogPartReady(void) -{ - return TRUE; -} - -static void WaitForLogPart(void) -{ - int i = 0; - - BBOX_PRINT_INFO("wait for log part [%s] begin!\n", LOSCFG_LOG_ROOT_PATH); - while (i++ < LOG_WAIT_TIMES) { - LOS_Msleep(LOG_PART_WAIT_TIME); - } - BBOX_PRINT_INFO("wait for log part [%s] end!\n", LOSCFG_LOG_ROOT_PATH); -} -#endif - -static bool FindModuleOps(struct ErrorInfo *info, BBoxOps **ops) -{ - bool found = false; - - if (info == NULL || ops == NULL) { - BBOX_PRINT_ERR("info: %p, ops: %p!\n", info, ops); - return found; - } - - LOS_DL_LIST_FOR_EACH_ENTRY(*ops, &g_opsList, BBoxOps, opsList) { - if (*ops != NULL && strcmp((*ops)->ops.module, info->module) == 0) { - found = true; - break; - } - } - if (!found) { - BBOX_PRINT_ERR("[%s] hasn't been registered!\n", info->module); - } - - return found; -} - -static void InvokeModuleOps(struct ErrorInfo *info, BBoxOps *ops) -{ - if (info == NULL || ops == NULL) { - BBOX_PRINT_ERR("info: %p, ops: %p!\n", info, ops); - return; - } - - if (ops->ops.Dump != NULL) { - BBOX_PRINT_INFO("[%s] starts dumping log!\n", ops->ops.module); - ops->ops.Dump(LOSCFG_LOG_ROOT_PATH, info); - BBOX_PRINT_INFO("[%s] ends dumping log!\n", ops->ops.module); - } - if (ops->ops.Reset != NULL) { - BBOX_PRINT_INFO("[%s] starts resetting!\n", ops->ops.module); - ops->ops.Reset(info); - BBOX_PRINT_INFO("[%s] ends resetting!\n", ops->ops.module); - } -} - -static void SaveLastLog(const char *logDir) -{ - struct ErrorInfo *info; - BBoxOps *ops; - - info = LOS_MemAlloc(m_aucSysMem1, sizeof(*info)); - if (info == NULL) { - BBOX_PRINT_ERR("LOS_MemAlloc failed!\n"); - return; - } - - if (LOS_SemPend(g_opsListSem, LOS_WAIT_FOREVER) != LOS_OK) { - BBOX_PRINT_ERR("Request g_opsListSem failed!\n"); - (void)LOS_MemFree(m_aucSysMem1, info); - return; - } - - LOS_DL_LIST_FOR_EACH_ENTRY(ops, &g_opsList, BBoxOps, opsList) { - if (ops == NULL) { - BBOX_PRINT_ERR("ops: NULL, please check it!\n"); - continue; - } - if (ops->ops.GetLastLogInfo != NULL && ops->ops.SaveLastLog != NULL) { - (void)memset_s(info, sizeof(*info), 0, sizeof(*info)); - if (ops->ops.GetLastLogInfo(info) != 0) { - BBOX_PRINT_ERR("[%s] failed to get log info!\n", ops->ops.module); - continue; - } - BBOX_PRINT_INFO("[%s] starts saving log!\n", ops->ops.module); - if (ops->ops.SaveLastLog(logDir, info) != 0) { - BBOX_PRINT_ERR("[%s] failed to save log!\n", ops->ops.module); - } else { - BBOX_PRINT_INFO("[%s] ends saving log!\n", ops->ops.module); - BBOX_PRINT_INFO("[%s] starts uploading event [%s]\n", info->module, info->event); -#ifdef LOSCFG_FS_VFS - (void)UploadEventByFile(KERNEL_FAULT_LOG_PATH); -#else - BBOX_PRINT_INFO("LOSCFG_FS_VFS isn't defined!\n"); -#endif - BBOX_PRINT_INFO("[%s] ends uploading event [%s]\n", info->module, info->event); - } - } else { - BBOX_PRINT_ERR("module [%s], GetLastLogInfo: %p, SaveLastLog: %p!\n", - ops->ops.module, ops->ops.GetLastLogInfo, ops->ops.SaveLastLog); - } - } - (void)LOS_SemPost(g_opsListSem); - (void)LOS_MemFree(m_aucSysMem1, info); -} - -static void SaveLogWithoutReset(struct ErrorInfo *info) -{ - BBoxOps *ops; - - if (info == NULL) { - BBOX_PRINT_ERR("info: %p!\n", info); - return; - } - - if (LOS_SemPend(g_opsListSem, LOS_WAIT_FOREVER) != LOS_OK) { - BBOX_PRINT_ERR("Request g_opsListSem failed!\n"); - return; - } - if (!FindModuleOps(info, &ops)) { - (void)LOS_SemPost(g_opsListSem); - return; - } - if (ops->ops.Dump == NULL && ops->ops.Reset == NULL) { - (void)LOS_SemPost(g_opsListSem); - if (SaveBasicErrorInfo(USER_FAULT_LOG_PATH, info) == 0) { - BBOX_PRINT_INFO("[%s] starts uploading event [%s]\n", info->module, info->event); -#ifdef LOSCFG_FS_VFS - (void)UploadEventByFile(USER_FAULT_LOG_PATH); -#else - BBOX_PRINT_INFO("LOSCFG_FS_VFS isn't defined!\n"); -#endif - BBOX_PRINT_INFO("[%s] ends uploading event [%s]\n", info->module, info->event); - } - return; - } - InvokeModuleOps(info, ops); - (void)LOS_SemPost(g_opsListSem); -} - -static void SaveTempErrorLog(void) -{ - if (LOS_SemPend(g_tempErrInfoSem, LOS_WAIT_FOREVER) != LOS_OK) { - BBOX_PRINT_ERR("Request g_tempErrInfoSem failed!\n"); - return; - } - if (g_tempErrInfo == NULL) { - BBOX_PRINT_ERR("g_tempErrInfo: %p!\n", g_tempErrInfo); - (void)LOS_SemPost(g_tempErrInfoSem); - return; - } - if (strlen(g_tempErrInfo->event) != 0) { - SaveLogWithoutReset(g_tempErrInfo); - } - (void)LOS_MemFree(m_aucSysMem1, g_tempErrInfo); - g_tempErrInfo = NULL; - (void)LOS_SemPost(g_tempErrInfoSem); -} - -static void SaveLogWithReset(struct ErrorInfo *info) -{ - int ret; - BBoxOps *ops; - - if (info == NULL) { - BBOX_PRINT_ERR("info: %p!\n", info); - return; - } - - if (!FindModuleOps(info, &ops)) { - return; - } - InvokeModuleOps(info, ops); - ret = SysReboot(0, 0, RB_AUTOBOOT); - BBOX_PRINT_INFO("SysReboot, ret: %d\n", ret); -} - -static void SaveTempErrorInfo(const char event[EVENT_MAX_LEN], - const char module[MODULE_MAX_LEN], - const char errorDesc[ERROR_DESC_MAX_LEN]) -{ - if (event == NULL || module == NULL || errorDesc == NULL) { - BBOX_PRINT_ERR("event: %p, module: %p, errorDesc: %p!\n", event, module, errorDesc); - return; - } - if (LOS_SemPend(g_tempErrInfoSem, LOS_WAIT_FOREVER) != LOS_OK) { - BBOX_PRINT_ERR("Request g_tempErrInfoSem failed!\n"); - return; - } - FormatErrorInfo(g_tempErrInfo, event, module, errorDesc); - (void)LOS_SemPost(g_tempErrInfoSem); -} - -static int SaveErrorLog(UINTPTR uwParam1, UINTPTR uwParam2, UINTPTR uwParam3, UINTPTR uwParam4) -{ - const char *logDir = (const char *)uwParam1; - (void)uwParam2; - (void)uwParam3; - (void)uwParam4; - -#ifdef LOSCFG_FS_VFS - WaitForLogPart(); -#endif - SaveLastLog(logDir); - SaveTempErrorLog(); - - return 0; -} - -#ifdef LOSCFG_BLACKBOX_DEBUG -static void PrintModuleOps(void) -{ - struct BBoxOps *ops; - - BBOX_PRINT_INFO("The following modules have been registered!\n"); - LOS_DL_LIST_FOR_EACH_ENTRY(ops, &g_opsList, BBoxOps, opsList) { - if (ops == NULL) { - continue; - } - BBOX_PRINT_INFO("module: %s, Dump: %p, Reset: %p, GetLastLogInfo: %p, SaveLastLog: %p\n", - ops->ops.module, ops->ops.Dump, ops->ops.Reset, ops->ops.GetLastLogInfo, ops->ops.SaveLastLog); - } -} -#endif - -int BBoxRegisterModuleOps(struct ModuleOps *ops) -{ - BBoxOps *newOps; - BBoxOps *temp; - - if (ops == NULL) { - BBOX_PRINT_ERR("ops: %p!\n", ops); - return -1; - } - - newOps = LOS_MemAlloc(m_aucSysMem1, sizeof(*newOps)); - if (newOps == NULL) { - BBOX_PRINT_ERR("LOS_MemAlloc failed!\n"); - return -1; - } - (void)memset_s(newOps, sizeof(*newOps), 0, sizeof(*newOps)); - (void)memcpy_s(&newOps->ops, sizeof(newOps->ops), ops, sizeof(*ops)); - if (LOS_SemPend(g_opsListSem, LOS_WAIT_FOREVER) != LOS_OK) { - BBOX_PRINT_ERR("Request g_opsListSem failed!\n"); - (void)LOS_MemFree(m_aucSysMem1, newOps); - return -1; - } - if (LOS_ListEmpty(&g_opsList)) { - goto __out; - } - - LOS_DL_LIST_FOR_EACH_ENTRY(temp, &g_opsList, BBoxOps, opsList) { - if (temp == NULL) { - continue; - } - if (strcmp(temp->ops.module, ops->module) == 0) { - BBOX_PRINT_ERR("module [%s] has been registered!\n", ops->module); - (void)LOS_SemPost(g_opsListSem); - (void)LOS_MemFree(m_aucSysMem1, newOps); - return -1; - } - } - -__out: - LOS_ListTailInsert(&g_opsList, &newOps->opsList); - (void)LOS_SemPost(g_opsListSem); - BBOX_PRINT_INFO("module [%s] is registered successfully!\n", ops->module); -#ifdef LOSCFG_BLACKBOX_DEBUG - PrintModuleOps(); -#endif - - return 0; -} - -int BBoxNotifyError(const char event[EVENT_MAX_LEN], - const char module[MODULE_MAX_LEN], - const char errorDesc[ERROR_DESC_MAX_LEN], - int needSysReset) -{ - struct ErrorInfo *info; - - if (event == NULL || module == NULL || errorDesc == NULL) { - BBOX_PRINT_ERR("event: %p, module: %p, errorDesc: %p!\n", event, module, errorDesc); - return -1; - } - info = LOS_MemAlloc(m_aucSysMem1, sizeof(*info)); - if (info == NULL) { - BBOX_PRINT_ERR("LOS_MemAlloc failed!\n"); - return -1; - } - FormatErrorInfo(info, event, module, errorDesc); - if (needSysReset == 0) { - if (!IsLogPartReady()) { - SaveTempErrorInfo(event, module, errorDesc); - } else { - SaveLogWithoutReset(info); - } - } else { - SaveLogWithReset(info); - } - (void)LOS_MemFree(m_aucSysMem1, info); - - return 0; -} - -int OsBBoxDriverInit(void) -{ - UINT32 taskID; - TSK_INIT_PARAM_S taskParam; - - if (LOS_BinarySemCreate(1, &g_opsListSem) != LOS_OK) { - BBOX_PRINT_ERR("Create g_opsListSem failed!\n"); - return -1; - } - if (LOS_BinarySemCreate(1, &g_tempErrInfoSem) != LOS_OK) { - BBOX_PRINT_ERR("Create g_tempErrInfoSem failed!\n"); - goto __err; - } - LOS_ListInit(&g_opsList); - g_tempErrInfo = LOS_MemAlloc(m_aucSysMem1, sizeof(*g_tempErrInfo)); - if (g_tempErrInfo == NULL) { - BBOX_PRINT_ERR("LOS_MemAlloc failed!\n"); - goto __err; - } - (void)memset_s(g_tempErrInfo, sizeof(*g_tempErrInfo), 0, sizeof(*g_tempErrInfo)); - (void)memset_s(&taskParam, sizeof(taskParam), 0, sizeof(taskParam)); - taskParam.auwArgs[0] = (UINTPTR)LOSCFG_LOG_ROOT_PATH; - taskParam.pfnTaskEntry = (TSK_ENTRY_FUNC)SaveErrorLog; - taskParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; - taskParam.pcName = "SaveErrorLog"; - taskParam.usTaskPrio = LOSCFG_BASE_CORE_TSK_DEFAULT_PRIO; - taskParam.uwResved = LOS_TASK_STATUS_DETACHED; -#ifdef LOSCFG_KERNEL_SMP - taskParam.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); -#endif - (void)LOS_TaskCreate(&taskID, &taskParam); - return 0; - -__err: - if (g_opsListSem != 0) { - (void)LOS_SemDelete(g_opsListSem); - } - if (g_tempErrInfoSem != 0) { - (void)LOS_SemDelete(g_tempErrInfoSem); - } - - return -1; -} -LOS_MODULE_INIT(OsBBoxDriverInit, LOS_INIT_LEVEL_ARCH); \ No newline at end of file diff --git a/kernel/common/blackbox/los_blackbox_detector.c b/kernel/common/blackbox/los_blackbox_detector.c deleted file mode 100644 index 5d91ef9d..00000000 --- a/kernel/common/blackbox/los_blackbox_detector.c +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * 3. Neither the name of the copyright holder nor the names of its contributors may be used - * to endorse or promote products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* ------------ includes ------------ */ -#include "los_blackbox_detector.h" -#include "los_blackbox_common.h" -#ifdef LOSCFG_LIB_LIBC -#include "stdlib.h" -#include "unistd.h" -#endif - -/* ------------ local macroes ------------ */ -/* ------------ local prototypes ------------ */ -/* ------------ local function declarations ------------ */ -/* ------------ global function declarations ------------ */ -/* ------------ local variables ------------ */ -/* ------------ function definitions ------------ */ -int UploadEventByFile(const char *filePath) -{ - if (filePath == NULL) { - BBOX_PRINT_ERR("filePath: %p\n", filePath); - return -1; - } - - return 0; -} - -int UploadEventByStream(const char *buf, size_t bufSize) -{ - if (buf == NULL || bufSize == 0) { - BBOX_PRINT_ERR("buf: %p, bufSize: %u\n", buf, (UINT32)bufSize); - return -1; - } - - return 0; -} \ No newline at end of file diff --git a/kernel/common/blackbox/los_blackbox_detector.h b/kernel/common/blackbox/los_blackbox_detector.h deleted file mode 100644 index a424f7a6..00000000 --- a/kernel/common/blackbox/los_blackbox_detector.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * 3. Neither the name of the copyright holder nor the names of its contributors may be used - * to endorse or promote products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef LOS_BLACKBOX_DETECTOR_H -#define LOS_BLACKBOX_DETECTOR_H - -#ifdef __cplusplus -#if __cplusplus -extern "C" { -#endif /* __cplusplus */ -#endif /* __cplusplus */ - -#ifndef __user -#define __user -#endif - -#include "los_typedef.h" - -int UploadEventByFile(const char *filePath); -int UploadEventByStream(const char *buf, size_t bufSize); - -#ifdef __cplusplus -#if __cplusplus -} -#endif /* __cplusplus */ -#endif /* __cplusplus */ - -#endif \ No newline at end of file diff --git a/kernel/common/blackbox/los_blackbox_system_adapter.c b/kernel/common/blackbox/los_blackbox_system_adapter.c deleted file mode 100644 index 11a85907..00000000 --- a/kernel/common/blackbox/los_blackbox_system_adapter.c +++ /dev/null @@ -1,247 +0,0 @@ -/* - * Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * 3. Neither the name of the copyright holder nor the names of its contributors may be used - * to endorse or promote products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* ------------ includes ------------ */ -#include "los_blackbox_system_adapter.h" -#include "los_blackbox_common.h" -#include "los_blackbox_detector.h" -#ifdef LOSCFG_LIB_LIBC -#include "stdlib.h" -#include "unistd.h" -#endif -#include "los_base.h" -#include "los_config.h" -#include "los_excinfo_pri.h" -#include "los_hw.h" -#include "los_init.h" -#include "los_memory.h" -#include "los_vm_phys.h" -#include "fs/fs.h" -#include "securec.h" - -/* ------------ local macroes ------------ */ -#define MEM_OVERLAP_COUNT 50 -#define LOG_FLAG "GOODLOG" -#define FAULT_LOG_SIZE 0x4000 /* 16KB */ - -/* ------------ local prototypes ------------ */ -struct FaultLogInfo { - char flag[8]; /* 8 is the length of the flag */ - int len; /* length of the fault log saved by the module excinfo */ - struct ErrorInfo info; -}; - -/* ------------ local function declarations ------------ */ -/* ------------ global function declarations ------------ */ -/* ------------ local variables ------------ */ -static char *g_logBuffer = NULL; - -/* ------------ function definitions ------------ */ -static void SaveFaultLog(const char *filePath, const char *dataBuf, size_t bufSize, struct ErrorInfo *info) -{ - (void)SaveBasicErrorInfo(filePath, info); - (void)FullWriteFile(filePath, dataBuf, bufSize, 1); -} - -static void WriteExcFile(UINT32 startAddr, UINT32 space, UINT32 rwFlag, char *buf) -{ - (void)startAddr; - (void)space; - (void)rwFlag; - (void)buf; -} - -static void RegisterExcInfoHook(void) -{ - if (g_logBuffer != NULL) { - LOS_ExcInfoRegHook(0, FAULT_LOG_SIZE - sizeof(struct FaultLogInfo), - g_logBuffer + sizeof(struct FaultLogInfo), WriteExcFile); - } else { - BBOX_PRINT_ERR("Alloc mem failed!\n"); - } -} - -static INT32 AllocLogBuffer(void) -{ - INT32 i; - size_t nPages = ROUNDUP(FAULT_LOG_SIZE, PAGE_SIZE) >> PAGE_SHIFT; - void *tempBuffer[MEM_OVERLAP_COUNT]; - - for (i = 0; i < MEM_OVERLAP_COUNT; i++) { - g_logBuffer = LOS_PhysPagesAllocContiguous(nPages); - tempBuffer[i] = g_logBuffer; - } - for (i = 0; i < MEM_OVERLAP_COUNT - 1; i++) { - LOS_PhysPagesFreeContiguous(tempBuffer[i], nPages); - } - - return (g_logBuffer != NULL) ? 0 : -1; -} - -static void Dump(const char *logDir, struct ErrorInfo *info) -{ - struct FaultLogInfo *pInfo; - - if (logDir == NULL || info == NULL) { - BBOX_PRINT_ERR("logDir: %p, info: %p!\n", logDir, info); - return; - } - if (g_logBuffer == NULL) { - BBOX_PRINT_ERR("g_logBuffer: %p!\n", g_logBuffer); - return; - } - - if (strcmp(info->event, EVENT_PANIC) == 0) { - pInfo = (struct FaultLogInfo *)g_logBuffer; - (void)memset_s(pInfo, sizeof(*pInfo), 0, sizeof(*pInfo)); - pInfo->len = GetExcInfoLen(); - (void)memcpy_s(&pInfo->flag, sizeof(pInfo->flag), LOG_FLAG, strlen(LOG_FLAG)); - (void)memcpy_s(&pInfo->info, sizeof(pInfo->info), info, sizeof(*info)); - DCacheFlushRange((UINTPTR)g_logBuffer, (UINTPTR)(g_logBuffer + FAULT_LOG_SIZE)); - } else { - SaveFaultLog(USER_FAULT_LOG_PATH, g_logBuffer + sizeof(struct FaultLogInfo), - Min(FAULT_LOG_SIZE - sizeof(struct FaultLogInfo), GetExcInfoLen()), info); - } -} - -static void Reset(struct ErrorInfo *info) -{ - if (info == NULL) { - BBOX_PRINT_ERR("info: %p!\n", info); - return; - } - - if (strcmp(info->event, EVENT_PANIC) != 0) { - BBOX_PRINT_INFO("[%s] starts uploading event [%s]\n", info->module, info->event); - (void)UploadEventByFile(USER_FAULT_LOG_PATH); - BBOX_PRINT_INFO("[%s] ends uploading event [%s]\n", info->module, info->event); - } -} - -static int GetLastLogInfo(struct ErrorInfo *info) -{ - struct FaultLogInfo *pInfo; - - if (info == NULL) { - BBOX_PRINT_ERR("info: %p!\n", info); - return -1; - } - if (g_logBuffer == NULL) { - BBOX_PRINT_ERR("Alloc physical page failed!\n"); - return -1; - } - - pInfo = (struct FaultLogInfo *)g_logBuffer; - if (memcmp(pInfo->flag, LOG_FLAG, strlen(LOG_FLAG)) == 0) { - (void)memcpy_s(info, sizeof(*info), &pInfo->info, sizeof(pInfo->info)); - return 0; - } - - return -1; -} - -static int SaveLastLog(const char *logDir, struct ErrorInfo *info) -{ -#ifdef LOSCFG_FS_VFS - struct FaultLogInfo *pInfo; - - if (logDir == NULL || info == NULL) { - BBOX_PRINT_ERR("logDir: %p, info: %p!\n", logDir, info); - return -1; - } - if (g_logBuffer == NULL) { - BBOX_PRINT_ERR("Alloc physical page failed!\n"); - return -1; - } - - pInfo = (struct FaultLogInfo *)g_logBuffer; - if (memcmp(pInfo->flag, LOG_FLAG, strlen(LOG_FLAG)) == 0) { - SaveFaultLog(KERNEL_FAULT_LOG_PATH, g_logBuffer + sizeof(*pInfo), - Min(FAULT_LOG_SIZE - sizeof(*pInfo), pInfo->len), info); - } -#endif - (void)memset_s(g_logBuffer, FAULT_LOG_SIZE, 0, FAULT_LOG_SIZE); - BBOX_PRINT_INFO("[%s] starts uploading event [%s]\n", info->module, info->event); - (void)UploadEventByFile(KERNEL_FAULT_LOG_PATH); - BBOX_PRINT_INFO("[%s] ends uploading event [%s]\n", info->module, info->event); - - return 0; -} - -#ifdef LOSCFG_BLACKBOX_TEST -static void BBoxTest(void) -{ - struct ModuleOps ops = { - .module = "MODULE_TEST", - .Dump = NULL, - .Reset = NULL, - .GetLastLogInfo = NULL, - .SaveLastLog = NULL, - }; - - if (BBoxRegisterModuleOps(&ops) != 0) { - BBOX_PRINT_ERR("BBoxRegisterModuleOps failed!\n"); - return; - } - BBoxNotifyError("EVENT_TEST1", "MODULE_TEST", "Test BBoxNotifyError111", 0); -} -#endif - -int OsBBoxSystemAdapterInit(void) -{ - struct ModuleOps ops = { - .module = MODULE_SYSTEM, - .Dump = Dump, - .Reset = Reset, - .GetLastLogInfo = GetLastLogInfo, - .SaveLastLog = SaveLastLog, - }; - - /* allocate buffer for kmsg */ - if (AllocLogBuffer() == 0) { - BBOX_PRINT_INFO("g_logBuffer: %p for blackbox!\n", g_logBuffer); - RegisterExcInfoHook(); - if (BBoxRegisterModuleOps(&ops) != 0) { - BBOX_PRINT_ERR("BBoxRegisterModuleOps failed!\n"); - LOS_PhysPagesFreeContiguous(g_logBuffer, ROUNDUP(FAULT_LOG_SIZE, PAGE_SIZE) >> PAGE_SHIFT); - g_logBuffer = NULL; - return -1; - } - } else { - BBOX_PRINT_ERR("AllocLogBuffer failed!\n"); - } - -#ifdef LOSCFG_BLACKBOX_TEST - BBoxTest(); -#endif - - return 0; -} -LOS_MODULE_INIT(OsBBoxSystemAdapterInit, LOS_INIT_LEVEL_ARCH); \ No newline at end of file diff --git a/kernel/common/blackbox/los_blackbox_system_adapter.h b/kernel/common/blackbox/los_blackbox_system_adapter.h deleted file mode 100644 index e4fbf2cc..00000000 --- a/kernel/common/blackbox/los_blackbox_system_adapter.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * 3. Neither the name of the copyright holder nor the names of its contributors may be used - * to endorse or promote products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef LOS_BLACKBOX_SYSTEM_ADAPTER_H -#define LOS_BLACKBOX_SYSTEM_ADAPTER_H - -#ifdef __cplusplus -#if __cplusplus -extern "C" { -#endif /* __cplusplus */ -#endif /* __cplusplus */ - -#ifndef __user -#define __user -#endif - -#include "los_blackbox.h" -#include "los_blackbox_common.h" - -int OsBBoxSystemAdapterInit(void); - -#ifdef __cplusplus -#if __cplusplus -} -#endif /* __cplusplus */ -#endif /* __cplusplus */ - -#endif \ No newline at end of file diff --git a/kernel/common/los_excinfo.c b/kernel/common/los_excinfo.c index f605c186..b18ee23b 100644 --- a/kernel/common/los_excinfo.c +++ b/kernel/common/los_excinfo.c @@ -34,29 +34,13 @@ #ifdef LOSCFG_SHELL #include "shcmd.h" #endif -#ifdef LOSCFG_BLACKBOX -#include "fs/fs.h" -#include "fs/fs_operation.h" -#endif - -#ifdef LOSCFG_BLACKBOX -#define TEMP_EXC_INFO_SIZE 0x400 -#endif #ifdef LOSCFG_SAVE_EXCINFO STATIC log_read_write_fn g_excInfoRW = NULL; /* the hook of read-writing exception information */ STATIC CHAR *g_excInfoBuf = NULL; /* pointer to the buffer for storing the exception information */ -#ifdef LOSCFG_BLACKBOX -STATIC UINT32 g_excInfoIndex = 0; /* the index of the buffer for storing the exception information */ -#else STATIC UINT32 g_excInfoIndex = 0xFFFFFFFF; /* the index of the buffer for storing the exception information */ -#endif STATIC UINT32 g_recordAddr = 0; /* the address of storing the exception information */ STATIC UINT32 g_recordSpace = 0; /* the size of storing the exception information */ -#ifdef LOSCFG_BLACKBOX -STATIC UINT32 g_excLogLen = 0; /* the length of the exception information */ -STATIC CHAR *g_tempExcInfoBuf = NULL; /* pointer to the buffer for storing the temp exception information */ -#endif VOID SetExcInfoRW(log_read_write_fn func) { @@ -81,11 +65,6 @@ CHAR *GetExcInfoBuf(VOID) VOID SetExcInfoIndex(UINT32 index) { g_excInfoIndex = index; -#ifdef LOSCFG_BLACKBOX - if (g_excInfoIndex == 0) { - g_excLogLen = 0; - } -#endif } UINT32 GetExcInfoIndex(VOID) @@ -93,13 +72,6 @@ UINT32 GetExcInfoIndex(VOID) return g_excInfoIndex; } -#ifdef LOSCFG_BLACKBOX -UINT32 GetExcInfoLen(VOID) -{ - return g_excLogLen; -} -#endif - VOID SetRecordAddr(UINT32 addr) { g_recordAddr = addr; @@ -120,35 +92,8 @@ UINT32 GetRecordSpace(VOID) return g_recordSpace; } -#ifdef LOSCFG_BLACKBOX -STATIC VOID SaveExcInfoUnsafe(CHAR *buf, INT32 size) -{ - for (INT32 i = 0; i < size; i++) { - *(g_excInfoBuf + g_excInfoIndex) = *(buf + i); - g_excInfoIndex++; - if (g_excLogLen < g_recordSpace) { - g_excLogLen++; - } - if (g_excInfoIndex >= g_recordSpace) { - g_excInfoIndex = 0; - } - } -} -#endif - VOID WriteExcBufVa(const CHAR *format, va_list arglist) { -#ifdef LOSCFG_BLACKBOX - if (g_tempExcInfoBuf != NULL) { - (VOID)memset_s(g_tempExcInfoBuf, TEMP_EXC_INFO_SIZE, 0, TEMP_EXC_INFO_SIZE); - INT32 ret = vsnprintf_s(g_tempExcInfoBuf, TEMP_EXC_INFO_SIZE, TEMP_EXC_INFO_SIZE - 1, format, arglist); - if (ret == -1) { - PRINT_ERR("g_tempExcInfoBuf is not enough or vsnprintf_s is error.\n"); - return; - } - SaveExcInfoUnsafe(g_tempExcInfoBuf, ret); - } -#else errno_t ret; if (g_recordSpace > g_excInfoIndex) { @@ -160,7 +105,6 @@ VOID WriteExcBufVa(const CHAR *format, va_list arglist) } g_excInfoIndex += ret; } -#endif } VOID WriteExcInfoToBuf(const CHAR *format, ...) @@ -187,9 +131,6 @@ VOID LOS_ExcInfoRegHook(UINT32 startAddr, UINT32 space, CHAR *buf, log_read_writ #ifdef LOSCFG_FS_VFS los_vfs_init(); #endif -#ifdef LOSCFG_BLACKBOX - g_tempExcInfoBuf = LOS_VMalloc(TEMP_EXC_INFO_SIZE); -#endif } /* Be called in the exception. */ diff --git a/kernel/common/los_excinfo_pri.h b/kernel/common/los_excinfo_pri.h index a30597d1..ba68d5f4 100644 --- a/kernel/common/los_excinfo_pri.h +++ b/kernel/common/los_excinfo_pri.h @@ -47,9 +47,6 @@ extern VOID SetExcInfoBuf(CHAR *buf); extern CHAR *GetExcInfoBuf(VOID); extern VOID SetExcInfoIndex(UINT32 index); extern UINT32 GetExcInfoIndex(VOID); -#ifdef LOSCFG_BLACKBOX -extern UINT32 GetExcInfoLen(VOID); -#endif extern VOID SetRecordAddr(UINT32 addr); extern UINT32 GetRecordAddr(VOID); extern VOID SetRecordSpace(UINT32 space); diff --git a/tools/build/mk/liteos_tables_ldflags.mk b/tools/build/mk/liteos_tables_ldflags.mk index af5aa945..dd670571 100644 --- a/tools/build/mk/liteos_tables_ldflags.mk +++ b/tools/build/mk/liteos_tables_ldflags.mk @@ -135,9 +135,7 @@ LITEOS_TABLES_KERNEL_INIT_LDFLAGS := \ -uOsCpupGuardCreator \ -uOsMpInit \ -uOsResourceFreeTaskCreate \ - -uOsSystemInit \ - -uOsBBoxSystemAdapterInit \ - -uOsBBoxDriverInit + -uOsSystemInit LITEOS_TABLES_DRIVER_LDFLAGS := \ -ui2c_init \ diff --git a/tools/build/mk/los_config.mk b/tools/build/mk/los_config.mk index ad304b7f..9c3923bd 100644 --- a/tools/build/mk/los_config.mk +++ b/tools/build/mk/los_config.mk @@ -441,12 +441,6 @@ ifeq ($(LOSCFG_BASE_CORE_HILOG), y) LITEOS_HILOG_INCLUDE += -I $(LITEOSTOPDIR)/../../base/hiviewdfx/hilog_lite/interfaces/native/kits/hilog LITEOS_CMACRO += -DLOSCFG_BASE_CORE_HILOG endif -ifeq ($(LOSCFG_BLACKBOX), y) - LITEOS_BASELIB += -lblackbox - LIB_SUBDIRS += $(LITEOSTOPDIR)/kernel/common/blackbox - LITEOS_BLACKBOX_INCLUDE += -I $(LITEOSTOPDIR)/kernel/common/blackbox - LITEOS_CMACRO += -DLOSCFG_BLACKBOX -endif ############################## Dfx Option End ####################################### ############################# Tools && Debug Option Begin ############################## @@ -643,8 +637,7 @@ LITEOS_DRIVERS_INCLUDE := $(LITEOS_CELLWISE_INCLUDE) $(LITEOS_GPIO_INCLUDE $(LITEOS_DRIVERS_HDF_INCLUDE) $(LITEOS_TZDRIVER_INCLUDE) \ $(LITEOS_HIEVENT_INCLUDE) $(LITEOS_DEV_MEM_INCLUDE) \ $(LITEOS_DEV_QUICKSTART_INCLUDE) -LITEOS_DFX_INCLUDE := $(LITEOS_HILOG_INCLUDE) \ - $(LITEOS_BLACKBOX_INCLUDE) +LITEOS_DFX_INCLUDE := $(LITEOS_HILOG_INCLUDE) LITEOS_SECURITY_INCLUDE := $(LITEOS_SECURITY_CAP_INC) $(LITEOS_SECURITY_VID_INC) LOSCFG_TOOLS_DEBUG_INCLUDE := $(LITEOS_SHELL_INCLUDE) $(LITEOS_UART_INCLUDE) \ From d8263b1e91d76706d52df321ef642c1c8297e8e4 Mon Sep 17 00:00:00 2001 From: Guangyao Ma Date: Wed, 7 Jul 2021 16:24:54 +0800 Subject: [PATCH 15/43] fix: mksh compile bug fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 编译框架整改,需要所有交叉编译指定sysroot以及arch相关的编译选项,用来在编译链 接过程中在指定的sysroot路径下,寻找符合arch要求的依赖库。往往,sysroot选项和 arch选项需要同时出现在编译链接选项中。 close #I3ZMR7 Signed-off-by: Guangyao Ma Change-Id: If2249721e0e35615b95f5525e57241aae910c212 --- apps/config.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/config.mk b/apps/config.mk index 21410057..417446cb 100644 --- a/apps/config.mk +++ b/apps/config.mk @@ -44,7 +44,7 @@ CFLAGS := -std=c99 -fno-exceptions $(BASE_OPTS) $(LITEOS_COPTS_OPTMIZE) CXXFLAGS := -std=c++11 -fexceptions -fpermissive -frtti $(BASE_OPTS) $(LITEOS_COPTS_OPTMIZE) LDCFLAGS := -lc ifeq ($(LOSCFG_COMPILER_CLANG_LLVM), y) -LLVM_SYSROOT := --sysroot=$(SYSROOT_PATH) +LLVM_SYSROOT := --sysroot=$(SYSROOT_PATH) $(ARCH_CFLAGS) LDCXXFLGS := -lc++ -lc++abi -lc else BASE_OPTS += -Wl,-z,relro,-z,now From 878469468647a19f704e7ee2af696b0ba8ab775a Mon Sep 17 00:00:00 2001 From: Caoruihong Date: Wed, 7 Jul 2021 20:20:09 +0800 Subject: [PATCH 16/43] feat: using kconfiglib instead of kconfig kconfiglib support the kconfig macro language, we need this feature to handle product related Kconfig configuration. Signed-off-by: Caoruihong Change-Id: I6bb521e93aab6c67b8bc3ac664b64f5e52089a45 --- .gitignore | 6 ++-- BUILD.gn | 4 ++- Kconfig | 52 ++++++++++++++++++----------------- Makefile | 38 ++++++++++--------------- bsd/dev/usb/Kconfig | 2 +- build.sh | 9 ++++-- net/Kconfig | 2 +- tools/build/mk/los_config.mk | 4 +-- tools/menuconfig/conf | Bin 119040 -> 0 bytes tools/menuconfig/mconf | Bin 164472 -> 0 bytes 10 files changed, 58 insertions(+), 59 deletions(-) delete mode 100755 tools/menuconfig/conf delete mode 100755 tools/menuconfig/mconf diff --git a/.gitignore b/.gitignore index fc87f6d3..23b64f81 100644 --- a/.gitignore +++ b/.gitignore @@ -16,9 +16,9 @@ cscope* tags # Menuconfig temp files -/include/config -/include/generated -.config* +/config.h +.config +.config.old # Build temp files /platform/board.ld diff --git a/BUILD.gn b/BUILD.gn index 696f2219..af86842e 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -80,5 +80,7 @@ build_ext_component("make") { outdir = rebase_path(get_path_info(".", "out_dir")) sysroot_path = rebase_path(ohos_current_sysroot) arch_cflags = string_join(" ", target_arch_cflags) - command = "./build.sh ${board_name} ${ohos_build_compiler} ${root_build_dir} ${ohos_build_type} ${tee_enable} \"${device_company}\" \"${product_path}\" $outdir \"${ohos_version}\" ${sysroot_path} \"${arch_cflags}\"" + command = "./build.sh ${board_name} ${ohos_build_compiler} ${root_build_dir} ${ohos_build_type} ${tee_enable}" + command += " \"${device_company}\" \"${product_path}\" $outdir \"${ohos_version}\" ${sysroot_path} \"${arch_cflags}\"" + command += " \"${device_path}\"" } diff --git a/Kconfig b/Kconfig index 8bce9860..d8cbaa97 100644 --- a/Kconfig +++ b/Kconfig @@ -52,15 +52,15 @@ endmenu menu "Platform" ######################### config options of bsp ##################### -source "../../kernel/liteos_a/platform/Kconfig" +source "platform/Kconfig" ######################### config options of cpu arch ################ -source "../../kernel/liteos_a/arch/Kconfig" +source "arch/Kconfig" ######################### config options of rootfs ##################### -source "../../kernel/liteos_a/kernel/common/Kconfig" +source "kernel/common/Kconfig" ######################### config options of patchfs ##################### -source "../../kernel/liteos_a/kernel/common/patchfs/Kconfig" +source "kernel/common/patchfs/Kconfig" config QUICK_START bool "Enable QUICK_START" @@ -71,27 +71,24 @@ config QUICK_START endmenu ######################### config options of kernel ##################### -source "../../kernel/liteos_a/kernel/Kconfig" +source "kernel/Kconfig" ######################### config options of lib ######################## -source "../../kernel/liteos_a/lib/Kconfig" +source "lib/Kconfig" ######################### config options of compatibility ############## menu "Compat" -source "../../kernel/liteos_a/compat/posix/Kconfig" -source "../../kernel/liteos_a/bsd/Kconfig" +source "compat/posix/Kconfig" +source "bsd/Kconfig" endmenu -######################### config options of framework ################## -#source "../../frameworks/m2mcomm/Kconfig" - ######################## config options of filesystem ################## menu "FileSystem" -source "../../kernel/liteos_a/fs/vfs/Kconfig" -source "../../kernel/liteos_a/fs/fat/Kconfig" -source "../../kernel/liteos_a/fs/ramfs/Kconfig" -source "../../kernel/liteos_a/fs/romfs/Kconfig" -source "../../kernel/liteos_a/fs/nfs/Kconfig" -source "../../kernel/liteos_a/fs/proc/Kconfig" -source "../../kernel/liteos_a/fs/jffs2/Kconfig" +source "fs/vfs/Kconfig" +source "fs/fat/Kconfig" +source "fs/ramfs/Kconfig" +source "fs/romfs/Kconfig" +source "fs/nfs/Kconfig" +source "fs/proc/Kconfig" +source "fs/jffs2/Kconfig" config ENABLE_READ_BUFFER bool "Enable read buffer Option" default n @@ -117,7 +114,7 @@ config MAX_PATH_CACHE_SIZE endmenu ######################## config options of net ############################ -source "../../kernel/liteos_a/net/Kconfig" +source "net/Kconfig" ######################## config options of debug ######################## menu "Debug" @@ -219,14 +216,14 @@ config DEBUG_SEMAPHORE help Answer Y to enable debug semaphore. -source "../../kernel/liteos_a/shell/Kconfig" +source "shell/Kconfig" config NET_LWIP_SACK_TFTP bool "Enable Tftp" default y depends on SHELL && NET_LWIP_SACK && DEBUG_VERSION help Answer Y to enable LiteOS support tftp cmd and tftp tool. -source "../../kernel/liteos_a/net/telnet/Kconfig" +source "net/telnet/Kconfig" config SCHED_DEBUG bool "Enable sched debug Feature" default n @@ -265,7 +262,7 @@ config MEM_LEAKCHECK help Answer Y to enable record the LR of Function call stack of Mem operation, it can check the mem leak through the infomations of mem node. config BASE_MEM_NODE_INTEGRITY_CHECK - bool "Enable integrity check or not " + bool "Enable integrity check or not" default n depends on DEBUG_VERSION && MEM_DEBUG config MEM_WATERLINE @@ -290,20 +287,25 @@ config DRIVERS help Answer Y to enable LiteOS support driver. -source "../../kernel/liteos_a/bsd/dev/usb/Kconfig" +source "bsd/dev/usb/Kconfig" source "../../drivers/adapter/khdf/liteos/Kconfig" +# Device driver Kconfig import +osource "$(DEVICE_PATH)/Kconfig" +osource "$(DEVICE_PATH)/config/Kconfig" + source "drivers/char/mem/Kconfig" source "drivers/char/quickstart/Kconfig" source "drivers/char/random/Kconfig" -source "../../drivers/liteos/tzdriver/Kconfig" source "drivers/char/video/Kconfig" + +source "../../drivers/liteos/tzdriver/Kconfig" source "../../drivers/liteos/hievent/Kconfig" endmenu menu "Security" -source "../../kernel/liteos_a/security/Kconfig" +source "security/Kconfig" endmenu menu "Test" diff --git a/Makefile b/Makefile index 5653d002..ff3bf7c9 100644 --- a/Makefile +++ b/Makefile @@ -47,22 +47,17 @@ ROOTFS = rootfs LITEOS_TARGET = liteos LITEOS_LIBS_TARGET = libs_target -LITEOS_MENUCONFIG_H = $(LITEOSTOPDIR)/include/generated/autoconf.h LITEOS_PLATFORM_BASE = $(LITEOSTOPDIR)/platform export CONFIG_=LOSCFG_ -MENUCONFIG_PATH = $(LITEOSTOPDIR)/tools/menuconfig -KCONFIG_FILE_PATH = $(LITEOSTOPDIR)/Kconfig - -ifeq ($(OS), Linux) -MENUCONFIG_MCONF := $(MENUCONFIG_PATH)/mconf -MENUCONFIG_CONF := $(MENUCONFIG_PATH)/conf -else -MENUCONFIG_MCONF := $(MENUCONFIG_PATH)/kconfig-mconf.exe -MENUCONFIG_CONF := $(MENUCONFIG_PATH)/kconfig-conf.exe +ifeq ($(PRODUCT_PATH),) +export PRODUCT_PATH=$(LITEOSTOPDIR)/../../device/hisilicon/drivers endif -$(shell env CONFIG_=$(CONFIG_) $(MENUCONFIG_CONF) -s --olddefconfig $(KCONFIG_FILE_PATH)) +ifeq ($(shell which menuconfig),) +$(shell pip install --user kconfiglib >/dev/null) +endif +$(shell env CONFIG_=$(CONFIG_) PRODUCT_PATH=$(PRODUCT_PATH) olddefconfig >/dev/null) -include $(LITEOSTOPDIR)/tools/build/config.mk @@ -148,17 +143,12 @@ $(LITEOS_LIBS_TARGET): $(__LIBS) sysroot $(HIDE)echo "=============== make lib done ===============" ##### make menuconfig ##### -menuconfig:$(MENUCONFIG_MCONF) - $< $(KCONFIG_FILE_PATH) - -genconfig:$(MENUCONFIG_CONF) - $(HIDE)mkdir -p include/config include/generated - $< --olddefconfig $(KCONFIG_FILE_PATH) - $< --silentoldconfig $(KCONFIG_FILE_PATH) +menuconfig: + $(HIDE)menuconfig ##### menuconfig end ####### $(LITEOS_MENUCONFIG_H): .config - $(HIDE)$(MAKE) genconfig + $(HIDE)genconfig $(LITEOS_TARGET): $(__LIBS) sysroot $(HIDE)touch $(LOSCFG_ENTRY_SRC) @@ -223,11 +213,11 @@ update_all_config: $(HIDE)shopt -s globstar && for f in tools/build/config/**/*.config ; \ do \ echo updating $$f; \ - test -f $$f && cp $$f .config && $(MENUCONFIG_CONF) -s --olddefconfig $(KCONFIG_FILE_PATH) && $(MENUCONFIG_CONF) --savedefconfig $$f $(KCONFIG_FILE_PATH); \ + test -f $$f && cp $$f .config && olddefconfig && savedefconfig --out $$f; \ done -%.config: - $(HIDE)test -f tools/build/config/$@ && cp tools/build/config/$@ .config && $(MENUCONFIG_MCONF) $(KCONFIG_FILE_PATH) && $(MENUCONFIG_CONF) --savedefconfig tools/build/config/$@ $(KCONFIG_FILE_PATH) +update_config: + $(HIDE)test -f "$(CONFIG)" && cp "$(CONFIG)" .config && menuconfig && savedefconfig --out "$(CONFIG)" -.PHONY: all lib clean cleanall $(LITEOS_TARGET) debug release help update_all_config -.PHONY: prepare sysroot cleanrootfs $(ROOTFS) $(ROOTFSDIR) $(APPS) menuconfig genconfig $(LITEOS_LIBS_TARGET) $(__LIBS) $(OUT) +.PHONY: all lib clean cleanall $(LITEOS_TARGET) debug release help update_all_config update_config +.PHONY: prepare sysroot cleanrootfs $(ROOTFS) $(ROOTFSDIR) $(APPS) menuconfig $(LITEOS_LIBS_TARGET) $(__LIBS) $(OUT) diff --git a/bsd/dev/usb/Kconfig b/bsd/dev/usb/Kconfig index 2bdac15f..6d365d5e 100644 --- a/bsd/dev/usb/Kconfig +++ b/bsd/dev/usb/Kconfig @@ -15,7 +15,7 @@ config DRIVERS_USB_HOST_DRIVER choice depends on DRIVERS_USB_HOST_DRIVER prompt "USB HCD" - default y + default DRIVERS_USB_HOST_EHCI help Enable EHCI for USB 2.0. Enable XHCI for USB 3.0 diff --git a/build.sh b/build.sh index be60ebf0..70ffc687 100755 --- a/build.sh +++ b/build.sh @@ -41,6 +41,7 @@ outdir=${8} ohos_version=${9} sysroot_path=${10} arch_cflags=${11} +device_path=${12} echo "${board_name}" "${device_company}" echo "sh param:" "$@" @@ -95,6 +96,10 @@ if [ "x" != "x${arch_cflags}" ]; then export ARCH_CFLAGS="${arch_cflags}" fi +export OUTDIR="${outdir}" +export PRODUCT_PATH="${product_path}" +export DEVICE_PATH="${device_path}" + main && \ -make clean OUTDIR="${outdir}" PRODUCT_PATH="${product_path}" && \ -make -j rootfs VERSION="${ohos_version}" OUTDIR="${outdir}" PRODUCT_PATH="${product_path}" +make clean && \ +make -j rootfs VERSION="${ohos_version}" diff --git a/net/Kconfig b/net/Kconfig index 36a9e16b..ca7f8458 100644 --- a/net/Kconfig +++ b/net/Kconfig @@ -17,7 +17,7 @@ config NET_LWIP_SACK choice depends on NET_LWIP_SACK prompt "Lwipsack" - default y + default NET_LWIP_SACK_2_1 help Enable Lwipsack for 2.x diff --git a/tools/build/mk/los_config.mk b/tools/build/mk/los_config.mk index c508de67..cbefe9c7 100644 --- a/tools/build/mk/los_config.mk +++ b/tools/build/mk/los_config.mk @@ -121,7 +121,7 @@ CXX_PATH = $(LITEOSTOPDIR)/lib/cxxstl JFFS_PATH = $(LITEOSTOPDIR)/fs/jffs2 LITEOS_SCRIPTPATH ?= $(LITEOSTOPDIR)/tools/scripts LITEOS_LIB_BIGODIR = $(OUT)/lib/obj -LITEOS_MENUCONFIG_H = $(LITEOSTOPDIR)/include/generated/autoconf.h +LITEOS_MENUCONFIG_H = $(LITEOSTOPDIR)/config.h LOSCFG_ENTRY_SRC = $(LITEOSTOPDIR)/kernel/common/los_config.c ### include variable @@ -668,7 +668,7 @@ LITEOS_COPTS_EXTRA_INTERWORK := $(LITEOS_COPTS_EXTRA) endif # kernel configuration macros -LITEOS_CMACRO += -imacros $(LITEOS_MENUCONFIG_H) +LITEOS_CMACRO += -imacros "$(LITEOS_MENUCONFIG_H)" ifneq ($(LOSCFG_COMPILER_CLANG_LLVM), y) LITEOS_LD_OPTS += -nostartfiles diff --git a/tools/menuconfig/conf b/tools/menuconfig/conf deleted file mode 100755 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F!Q_j$V-076V3ktVA3X{pB(Nz`aYhUlLJpohK^|e{}HY>=6COr?PmUNCzw)NBlJ%q z`6m|p$}u5^jl=0{shR1$xX@VsVdg)~{7-F=tJ8-o-ywg2lg9k+y8-tPSU&gMx#N%4 z|5MEG`p^BYXM*|X47!{~6XB%yIi#f|m*2e)_rZU#^6z&K$TDBF{DYDF?!CD?pSAoC zp2v(N(e`` zwEepL$AC4K?|u*HFSh)XMl`SdOVrQoQ_m*2mJVxq0g+JGB&i~2yY*zl& P?=-1bB*4&cM9cpVqeA0C From e4ff04586f6543e50dd8e67cf85d692cba8ee316 Mon Sep 17 00:00:00 2001 From: x_xiny <1301913191@qq.com> Date: Tue, 6 Jul 2021 16:37:10 +0800 Subject: [PATCH 17/43] =?UTF-8?q?=20fix:=E6=B6=88=E9=99=A4=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E5=91=8A=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【背景】 消除编译告警 【修改方案】 消除编译告警 re #I3ZC1R Change-Id: I594d0f57e4cbbdb246a6bef1c978a38228123a34 Signed-off-by: x-xiny <1301913191@qq.com> Change-Id: I1d75cdcdcf9d06ec28e541cdfea77300da7c6bb1 --- arch/arm/arm/src/los_arch_mmu.c | 12 ++++++------ arch/arm/arm/src/los_exc.c | 5 ++--- compat/posix/src/time.c | 6 +++--- fs/fat/os_adapt/fatfs.c | 5 +++-- fs/include/fs/file.h | 2 +- fs/vfs/operation/fs_file.c | 2 +- kernel/base/ipc/los_signal.c | 4 ++-- kernel/base/vm/los_vm_filemap.c | 2 +- kernel/base/vm/los_vm_iomap.c | 1 - kernel/common/console.c | 6 +++--- kernel/common/los_config.c | 2 +- kernel/common/los_magickey.c | 2 +- syscall/misc_syscall.c | 1 - 13 files changed, 24 insertions(+), 26 deletions(-) diff --git a/arch/arm/arm/src/los_arch_mmu.c b/arch/arm/arm/src/los_arch_mmu.c index 435dcfaf..ccefd5ba 100644 --- a/arch/arm/arm/src/los_arch_mmu.c +++ b/arch/arm/arm/src/los_arch_mmu.c @@ -871,7 +871,7 @@ STATIC VOID OsSetKSectionAttr(UINTPTR virtAddr, BOOL uncached) kSpace->archMmu.virtTtb = (PTE_T *)g_firstPageTable; kSpace->archMmu.physTtb = LOS_PaddrQuery(kSpace->archMmu.virtTtb); status = LOS_ArchMmuUnmap(&kSpace->archMmu, virtAddr, - (bssEndBoundary - virtAddr) >> MMU_DESCRIPTOR_L2_SMALL_SHIFT); + (bssEndBoundary - virtAddr) >> MMU_DESCRIPTOR_L2_SMALL_SHIFT); if (status != ((bssEndBoundary - virtAddr) >> MMU_DESCRIPTOR_L2_SMALL_SHIFT)) { VM_ERR("unmap failed, status: %d", status); return; @@ -882,8 +882,8 @@ STATIC VOID OsSetKSectionAttr(UINTPTR virtAddr, BOOL uncached) flags |= VM_MAP_REGION_FLAG_UNCACHED; } status = LOS_ArchMmuMap(&kSpace->archMmu, virtAddr, SYS_MEM_BASE, - (textStart - virtAddr) >> MMU_DESCRIPTOR_L2_SMALL_SHIFT, - flags); + (textStart - virtAddr) >> MMU_DESCRIPTOR_L2_SMALL_SHIFT, + flags); if (status != ((textStart - virtAddr) >> MMU_DESCRIPTOR_L2_SMALL_SHIFT)) { VM_ERR("mmap failed, status: %d", status); return; @@ -910,9 +910,9 @@ STATIC VOID OsSetKSectionAttr(UINTPTR virtAddr, BOOL uncached) flags |= VM_MAP_REGION_FLAG_UNCACHED; } status = LOS_ArchMmuMap(&kSpace->archMmu, bssEndBoundary, - SYS_MEM_BASE + bssEndBoundary - virtAddr, - kmallocLength >> MMU_DESCRIPTOR_L2_SMALL_SHIFT, - flags); + SYS_MEM_BASE + bssEndBoundary - virtAddr, + kmallocLength >> MMU_DESCRIPTOR_L2_SMALL_SHIFT, + flags); if (status != (kmallocLength >> MMU_DESCRIPTOR_L2_SMALL_SHIFT)) { VM_ERR("mmap failed, status: %d", status); return; diff --git a/arch/arm/arm/src/los_exc.c b/arch/arm/arm/src/los_exc.c index 1c0c89cd..bdaa4f09 100644 --- a/arch/arm/arm/src/los_exc.c +++ b/arch/arm/arm/src/los_exc.c @@ -38,7 +38,6 @@ #include "los_excinfo_pri.h" #endif #include "los_sys_stack_pri.h" -#include "los_stackinfo_pri.h" #ifdef LOSCFG_COREDUMP #include "los_coredump.h" #endif @@ -723,7 +722,7 @@ VOID BackTraceSub(UINTPTR regFP) } backLR = *(UINTPTR *)(UINTPTR)kvaddr; #else - backLR = *(UINTPTR *)(UINTPTR)kvaddr; + backLR = *(UINTPTR *)(UINTPTR)kvaddr; if (IsValidFP(tmpFP - POINTER_SIZE, stackStart, stackEnd, &kvaddr) == FALSE) { PrintExcInfo("traceback backFP check failed, backFP: 0x%x\n", tmpFP - POINTER_SIZE); return; @@ -1007,7 +1006,7 @@ STATIC VOID OsCheckAllCpuStatus(VOID) OsWaitOtherCoresHandleExcEnd(currCpuID); } else { - if (g_excFromUserMode[g_currHandleExcCpuID] == TRUE) { + if ((g_currHandleExcCpuID < LOSCFG_KERNEL_CORE_NUM) && (g_excFromUserMode[g_currHandleExcCpuID] == TRUE)) { g_currHandleExcCpuID = currCpuID; LOS_SpinUnlock(&g_excSerializerSpin); target = (UINT32)(OS_MP_CPU_ALL & ~CPUID_TO_AFFI_MASK(currCpuID)); diff --git a/compat/posix/src/time.c b/compat/posix/src/time.c index 71870721..865f8dbd 100644 --- a/compat/posix/src/time.c +++ b/compat/posix/src/time.c @@ -456,7 +456,7 @@ static int PthreadGetCputime(clockid_t clockID, struct timespec *ats) { uint64_t runtime; UINT32 intSave; - UINT32 tid = ((UINT32) ~((clockID) >> CPUCLOCK_ID_OFFSET)); + UINT32 tid = ((UINT32) ~((UINT32)(clockID) >> CPUCLOCK_ID_OFFSET)); if (OS_TID_CHECK_INVALID(tid)) { return -EINVAL; @@ -482,7 +482,7 @@ static int ProcessGetCputime(clockid_t clockID, struct timespec *ats) { UINT64 runtime; UINT32 intSave; - const pid_t pid = ((pid_t) ~((clockID) >> CPUCLOCK_ID_OFFSET)); + const pid_t pid = ((pid_t) ~((UINT32)(clockID) >> CPUCLOCK_ID_OFFSET)); LosProcessCB *spcb = NULL; if (OsProcessIDUserCheckInvalid(pid) || pid < 0) { @@ -524,7 +524,7 @@ static int GetCputime(clockid_t clockID, struct timespec *tp) static int CheckClock(const clockid_t clockID) { int error = 0; - const pid_t pid = ((pid_t) ~((clockID) >> CPUCLOCK_ID_OFFSET)); + const pid_t pid = ((pid_t) ~((UINT32)(clockID) >> CPUCLOCK_ID_OFFSET)); if (!((UINT32)clockID & CPUCLOCK_PERTHREAD_MASK)) { LosProcessCB *spcb = NULL; diff --git a/fs/fat/os_adapt/fatfs.c b/fs/fat/os_adapt/fatfs.c index 06c33d57..0330388e 100644 --- a/fs/fat/os_adapt/fatfs.c +++ b/fs/fat/os_adapt/fatfs.c @@ -238,7 +238,8 @@ static mode_t fatfs_get_mode(BYTE attribute, mode_t fs_mode) return fs_mode; } -static enum VnodeType fatfstype_2_vnodetype(BYTE type) { +static enum VnodeType fatfstype_2_vnodetype(BYTE type) +{ switch (type) { case AM_ARC: return VNODE_TYPE_REG; @@ -286,7 +287,7 @@ static FRESULT init_cluster(DIR_FILE *pdfp, DIR *dp_new, FATFS *fs, int type, co mem_set(dir, 0, SS(fs)); if (type == AM_LNK && target) { /* Write target to symlink */ - strcpy_s((char *)dir, SS(fs), target); + (void)strcpy_s((char *)dir, SS(fs), target); } else { /* Write the dir cluster */ mem_set(dir, 0, SS(fs)); diff --git a/fs/include/fs/file.h b/fs/include/fs/file.h index cb05f0bc..11b78782 100644 --- a/fs/include/fs/file.h +++ b/fs/include/fs/file.h @@ -473,7 +473,7 @@ off64_t file_seek64(struct file *filep, off64_t offset, int whence); * ****************************************************************************/ -int files_allocate(struct Vnode *vnode, int oflags, off_t pos,void *priv, int minfd); +int files_allocate(struct Vnode *vnode, int oflags, off_t pos, void *priv, int minfd); /**************************************************************************** * Name: files_close diff --git a/fs/vfs/operation/fs_file.c b/fs/vfs/operation/fs_file.c index 245d8f5d..1e600bbb 100644 --- a/fs/vfs/operation/fs_file.c +++ b/fs/vfs/operation/fs_file.c @@ -406,7 +406,7 @@ int CopyFdToProc(int fd, unsigned int targetPid) return -ESRCH; } - procFd = AssignProcessFd(fdt, 3); + procFd = AssignProcessFd(fdt, 3); // minfd is 3 if (procFd < 0) { if (sem_post(&semId) == -1) { PRINT_ERR("sem_post error, errno %d \n", get_errno()); diff --git a/kernel/base/ipc/los_signal.c b/kernel/base/ipc/los_signal.c index 06fee687..e30f29df 100644 --- a/kernel/base/ipc/los_signal.c +++ b/kernel/base/ipc/los_signal.c @@ -132,7 +132,7 @@ int OsTcbDispatch(LosTaskCB *stcb, siginfo_t *info) if (masked) { /* If signal is in wait list and mask list, need unblock it */ if (LOS_ListEmpty(&sigcb->waitList) || - (!LOS_ListEmpty(&sigcb->waitList) && !OsSigIsMember(&sigcb->sigwaitmask, info->si_signo))) { + (!LOS_ListEmpty(&sigcb->waitList) && !OsSigIsMember(&sigcb->sigwaitmask, info->si_signo))) { OsSigAddSet(&sigcb->sigPendFlag, info->si_signo); } } else { @@ -308,7 +308,7 @@ int OsSigProcessSend(LosProcessCB *spcb, siginfo_t *sigInfo) .receivedTcb = NULL }; - if (info.sigInfo == NULL){ + if (info.sigInfo == NULL) { return -EFAULT; } diff --git a/kernel/base/vm/los_vm_filemap.c b/kernel/base/vm/los_vm_filemap.c index 9a6ec2ce..81a74900 100644 --- a/kernel/base/vm/los_vm_filemap.c +++ b/kernel/base/vm/los_vm_filemap.c @@ -44,7 +44,7 @@ #include "vnode.h" #ifndef UNUSED -#define UNUSED(x) (VOID)x +#define UNUSED(x) (VOID)(x) #endif #ifdef LOSCFG_DEBUG_VERSION diff --git a/kernel/base/vm/los_vm_iomap.c b/kernel/base/vm/los_vm_iomap.c index dde9e472..5acc88fd 100644 --- a/kernel/base/vm/los_vm_iomap.c +++ b/kernel/base/vm/los_vm_iomap.c @@ -34,7 +34,6 @@ #include "los_vm_zone.h" #include "los_vm_common.h" #include "los_vm_map.h" -#include "los_vm_lock.h" #include "los_memory.h" diff --git a/kernel/common/console.c b/kernel/common/console.c index c70466c3..36ccb5ba 100644 --- a/kernel/common/console.c +++ b/kernel/common/console.c @@ -437,10 +437,10 @@ STATIC VOID StoreReadChar(CONSOLE_CB *consoleCB, char ch, INT32 readcount) VOID KillPgrp() { - INT32 consoleId = -1; + INT32 consoleId; LosProcessCB *process = OsCurrProcessGet(); - if ((process->consoleID > CONSOLE_NUM -1 ) || (process->consoleID < 0)) { + if ((process->consoleID > CONSOLE_NUM - 1) || (process->consoleID < 0)) { return; } @@ -872,7 +872,7 @@ STATIC INT32 ConsoleGetTermios(unsigned long arg) return -EFAULT; } - if(LOS_ArchCopyToUser((VOID *)arg, &consoleCB->consoleTermios, sizeof(struct termios)) != 0) { + if (LOS_ArchCopyToUser((VOID *)arg, &consoleCB->consoleTermios, sizeof(struct termios)) != 0) { return -EFAULT; } else { return LOS_OK; diff --git a/kernel/common/los_config.c b/kernel/common/los_config.c index afd45a78..0757fc83 100644 --- a/kernel/common/los_config.c +++ b/kernel/common/los_config.c @@ -83,7 +83,7 @@ LITE_OS_SEC_TEXT_INIT STATIC UINT32 EarliestInit(VOID) LITE_OS_SEC_TEXT_INIT STATIC UINT32 ArchEarlyInit(VOID) { - UINT32 ret = LOS_OK; + UINT32 ret; /* set system counter freq */ #ifndef LOSCFG_TEE_ENABLE diff --git a/kernel/common/los_magickey.c b/kernel/common/los_magickey.c index 7e5f00ee..9368f77f 100644 --- a/kernel/common/los_magickey.c +++ b/kernel/common/los_magickey.c @@ -137,7 +137,7 @@ INT32 CheckMagicKey(CHAR key) PRINTK("Magic key off\n"); } return 1; - } else if (key == 0x03){ /* ctrl + c */ + } else if (key == 0x03) { /* ctrl + c */ KillPgrp(); return 0; } diff --git a/syscall/misc_syscall.c b/syscall/misc_syscall.c index 29b571d9..936d48cc 100644 --- a/syscall/misc_syscall.c +++ b/syscall/misc_syscall.c @@ -35,7 +35,6 @@ #include "sys/resource.h" #include "sys/times.h" #include "sys/utsname.h" -#include "time.h" #include "capability_type.h" #include "capability_api.h" #include "los_process_pri.h" From cacb4f0103ecb2d1b7af54d84957f88d3e9443d2 Mon Sep 17 00:00:00 2001 From: Guangyao Ma Date: Tue, 15 Jun 2021 09:57:03 +0800 Subject: [PATCH 18/43] feat: active mksh & toybox Close #I3VEOG Change-Id: Ibc73aacf68c65e64b88084edfd3549b3137dde07 Signed-off-by: Guangyao Ma --- apps/module.mk | 10 ++-------- tools/scripts/make_rootfs/rootfsdir.sh | 13 +++++++------ 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/apps/module.mk b/apps/module.mk index b3df0fc2..5b246a45 100644 --- a/apps/module.mk +++ b/apps/module.mk @@ -33,6 +33,8 @@ APP_SUBDIRS := ifeq ($(LOSCFG_SHELL), y) APP_SUBDIRS += shell +APP_SUBDIRS += mksh +APP_SUBDIRS += toybox endif ifeq ($(LOSCFG_USER_INIT_DEBUG), y) @@ -42,11 +44,3 @@ endif ifeq ($(LOSCFG_NET_LWIP_SACK_TFTP), y) APP_SUBDIRS += tftp endif - -#only enable for qemu now -ifeq ($(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7), y) -ifeq ($(LOSCFG_SHELL), y) -APP_SUBDIRS += mksh -APP_SUBDIRS += toybox -endif -endif diff --git a/tools/scripts/make_rootfs/rootfsdir.sh b/tools/scripts/make_rootfs/rootfsdir.sh index ed3f690a..35c553e4 100755 --- a/tools/scripts/make_rootfs/rootfsdir.sh +++ b/tools/scripts/make_rootfs/rootfsdir.sh @@ -34,17 +34,18 @@ BIN_DIR=$1 LIB_DIR=$2 ROOTFS_DIR=$3 OUT_DIR=$4 +NEED_COPYTO_OUTDIR=(shell toybox mksh tftp) mkdir -p ${ROOTFS_DIR}/bin ${ROOTFS_DIR}/lib ${ROOTFS_DIR}/usr/bin ${ROOTFS_DIR}/usr/lib ${ROOTFS_DIR}/etc \ ${ROOTFS_DIR}/app ${ROOTFS_DIR}/data ${ROOTFS_DIR}/proc ${ROOTFS_DIR}/dev ${ROOTFS_DIR}/data/system ${ROOTFS_DIR}/data/system/param \ ${ROOTFS_DIR}/system ${ROOTFS_DIR}/system/internal ${ROOTFS_DIR}/system/external ${OUT_DIR}/bin ${OUT_DIR}/libs if [ -d "${BIN_DIR}" ] && [ "$(ls -A "${BIN_DIR}")" != "" ]; then cp -f ${BIN_DIR}/* ${ROOTFS_DIR}/bin - if [ -e ${BIN_DIR}/shell ] && [ "${BIN_DIR}/shell" != "${OUT_DIR}/bin/shell" ]; then - cp -f ${BIN_DIR}/shell ${OUT_DIR}/bin/shell - fi - if [ -e ${BIN_DIR}/tftp ] && [ "${BIN_DIR}/tftp" != "${OUT_DIR}/bin/tftp" ]; then - cp -f ${BIN_DIR}/tftp ${OUT_DIR}/bin/tftp - fi + for el in ${NEED_COPYTO_OUTDIR[@]} + do + if [ -e ${BIN_DIR}/$el ] && [ "${BIN_DIR}/$el" != "${OUT_DIR}/bin/$el" ]; then + cp -f ${BIN_DIR}/$el ${OUT_DIR}/bin/$el + fi + done fi cp -f ${LIB_DIR}/* ${ROOTFS_DIR}/lib cp -f ${LIB_DIR}/* ${OUT_DIR}/libs From 40f239a7d4673dc740c853b1011b5072e48385b7 Mon Sep 17 00:00:00 2001 From: Guangyao Ma Date: Thu, 1 Jul 2021 10:16:02 +0800 Subject: [PATCH 19/43] fix: Ctrl-C move out of LOS_MAGIC_KEY_ENABLE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 由于没有tty,当前的Ctrl-C实现基于uart回调特定函数实现,后续tty实现后 可以重新考虑Ctrl-C设计实现。本次将Ctrl-C移除LOS_MAGIC_KEY_ENABLE,保 证任意情况下可以生效。 Change-Id: I4e1e51b2d92535879bbdbbfa91b0229119d0e90e Signed-off-by: Guangyao Ma --- kernel/common/los_magickey.c | 18 ++++++------------ .../debug/mini_qemu_liteos_a_clang.config | 1 - .../build/config/hispark_aries_release.config | 1 - .../build/config/hispark_taurus_release.config | 1 - .../config/hispark_taurus_release_tee.config | 1 - .../ipcamera_hi3516dv300_liteos_release.config | 1 - ...amera_hi3516dv300_liteos_release_tee.config | 1 - .../ipcamera_hi3518ev300_liteos_release.config | 1 - .../config/qemu_arm_virt_debug_shell.config | 1 - 9 files changed, 6 insertions(+), 20 deletions(-) diff --git a/kernel/common/los_magickey.c b/kernel/common/los_magickey.c index 9368f77f..1db5c88c 100644 --- a/kernel/common/los_magickey.c +++ b/kernel/common/los_magickey.c @@ -66,12 +66,6 @@ STATIC MagicKeyOp g_magicHelpOp = { .magicKey = 0x1a /* ctrl + z */ }; -STATIC MagicKeyOp g_magicKillPgrp = { - .opHandler = KillPgrp, - .helpMsg = "Show all magic op key(ctrl+c) ", - .magicKey = 0x03 /* ctrl + c */ -}; - /* * NOTICE:Suggest don't use * ctrl+h/backspace=0x8, @@ -87,7 +81,7 @@ STATIC MagicKeyOp *g_magicOpTable[MAGIC_KEY_NUM] = { &g_magicPanicOp, /* ctrl + p */ &g_magicTaskShowOp, /* ctrl + t */ &g_magicHelpOp, /* ctrl + z */ - &g_magicKillPgrp /* ctrl + c */ + NULL }; STATIC VOID OsMagicHelp(VOID) @@ -129,7 +123,11 @@ INT32 CheckMagicKey(CHAR key) #ifdef LOSCFG_ENABLE_MAGICKEY INT32 i; STATIC UINT32 magicKeySwitch = 0; - if (key == 0x12) { /* ctrl + r */ + + if (key == 0x03) { /* ctrl + c */ + KillPgrp(); + return 0; + } else if (key == 0x12) { /* ctrl + r */ magicKeySwitch = ~magicKeySwitch; if (magicKeySwitch != 0) { PRINTK("Magic key on\n"); @@ -137,11 +135,7 @@ INT32 CheckMagicKey(CHAR key) PRINTK("Magic key off\n"); } return 1; - } else if (key == 0x03) { /* ctrl + c */ - KillPgrp(); - return 0; } - if (magicKeySwitch != 0) { for (i = 0; i < MAGIC_KEY_NUM; i++) { if (g_magicOpTable[i] != NULL && key == g_magicOpTable[i]->magicKey) { diff --git a/tools/build/config/debug/mini_qemu_liteos_a_clang.config b/tools/build/config/debug/mini_qemu_liteos_a_clang.config index 6670fbb1..f5ab9aa4 100644 --- a/tools/build/config/debug/mini_qemu_liteos_a_clang.config +++ b/tools/build/config/debug/mini_qemu_liteos_a_clang.config @@ -10,6 +10,5 @@ LOSCFG_BOARD_CONFIG_PATH="device/qemu/arm_virt/liteos_a/config/board" # LOSCFG_FS_VFS is not set # LOSCFG_NET_LWIP_SACK is not set # LOSCFG_PLATFORM_ADAPT is not set -# LOSCFG_ENABLE_MAGICKEY is not set # LOSCFG_DRIVERS is not set # LOSCFG_SECURITY is not set diff --git a/tools/build/config/hispark_aries_release.config b/tools/build/config/hispark_aries_release.config index 2bdc4dea..36fba84b 100644 --- a/tools/build/config/hispark_aries_release.config +++ b/tools/build/config/hispark_aries_release.config @@ -8,7 +8,6 @@ LOSCFG_FS_VFS_BLOCK_DEVICE=y LOSCFG_FS_FAT_CACHE_SYNC_THREAD=y LOSCFG_FS_FAT_VIRTUAL_PARTITION=y LOSCFG_ENABLE_OOM_LOOP_TASK=y -# LOSCFG_ENABLE_MAGICKEY is not set LOSCFG_DRIVERS_USB_HOST_XHCI=y LOSCFG_DRIVERS_USB_ETHERNET=y LOSCFG_DRIVERS_USB_WIRELESS=y diff --git a/tools/build/config/hispark_taurus_release.config b/tools/build/config/hispark_taurus_release.config index 83d0d4f0..8b510ac2 100644 --- a/tools/build/config/hispark_taurus_release.config +++ b/tools/build/config/hispark_taurus_release.config @@ -9,7 +9,6 @@ LOSCFG_KERNEL_VDSO=y LOSCFG_FS_VFS_BLOCK_DEVICE=y LOSCFG_FS_FAT_VIRTUAL_PARTITION=y LOSCFG_ENABLE_OOM_LOOP_TASK=y -# LOSCFG_ENABLE_MAGICKEY is not set LOSCFG_DRIVERS_USB_HOST_XHCI=y LOSCFG_DRIVERS_USB_ETHERNET=y LOSCFG_DRIVERS_USB_WIRELESS=y diff --git a/tools/build/config/hispark_taurus_release_tee.config b/tools/build/config/hispark_taurus_release_tee.config index 46a2d492..f5b6eba8 100644 --- a/tools/build/config/hispark_taurus_release_tee.config +++ b/tools/build/config/hispark_taurus_release_tee.config @@ -10,7 +10,6 @@ LOSCFG_KERNEL_VDSO=y LOSCFG_FS_VFS_BLOCK_DEVICE=y LOSCFG_FS_FAT_VIRTUAL_PARTITION=y LOSCFG_ENABLE_OOM_LOOP_TASK=y -# LOSCFG_ENABLE_MAGICKEY is not set LOSCFG_DRIVERS_USB_HOST_XHCI=y LOSCFG_DRIVERS_USB_ETHERNET=y LOSCFG_DRIVERS_USB_WIRELESS=y diff --git a/tools/build/config/ipcamera_hi3516dv300_liteos_release.config b/tools/build/config/ipcamera_hi3516dv300_liteos_release.config index c62d4cb8..f0c14d2b 100644 --- a/tools/build/config/ipcamera_hi3516dv300_liteos_release.config +++ b/tools/build/config/ipcamera_hi3516dv300_liteos_release.config @@ -9,7 +9,6 @@ LOSCFG_FS_VFS_BLOCK_DEVICE=y LOSCFG_FS_FAT_VIRTUAL_PARTITION=y LOSCFG_NET_LWIP_SACK_2_0=y LOSCFG_ENABLE_OOM_LOOP_TASK=y -# LOSCFG_ENABLE_MAGICKEY is not set LOSCFG_DRIVERS_USB_HOST_XHCI=y LOSCFG_DRIVERS_USB_ETHERNET=y LOSCFG_DRIVERS_USB_WIRELESS=y diff --git a/tools/build/config/ipcamera_hi3516dv300_liteos_release_tee.config b/tools/build/config/ipcamera_hi3516dv300_liteos_release_tee.config index c62d4cb8..f0c14d2b 100644 --- a/tools/build/config/ipcamera_hi3516dv300_liteos_release_tee.config +++ b/tools/build/config/ipcamera_hi3516dv300_liteos_release_tee.config @@ -9,7 +9,6 @@ LOSCFG_FS_VFS_BLOCK_DEVICE=y LOSCFG_FS_FAT_VIRTUAL_PARTITION=y LOSCFG_NET_LWIP_SACK_2_0=y LOSCFG_ENABLE_OOM_LOOP_TASK=y -# LOSCFG_ENABLE_MAGICKEY is not set LOSCFG_DRIVERS_USB_HOST_XHCI=y LOSCFG_DRIVERS_USB_ETHERNET=y LOSCFG_DRIVERS_USB_WIRELESS=y diff --git a/tools/build/config/ipcamera_hi3518ev300_liteos_release.config b/tools/build/config/ipcamera_hi3518ev300_liteos_release.config index f323e791..805febf4 100644 --- a/tools/build/config/ipcamera_hi3518ev300_liteos_release.config +++ b/tools/build/config/ipcamera_hi3518ev300_liteos_release.config @@ -8,7 +8,6 @@ LOSCFG_FS_FAT_CACHE_SYNC_THREAD=y LOSCFG_FS_FAT_VIRTUAL_PARTITION=y LOSCFG_NET_LWIP_SACK_2_0=y LOSCFG_ENABLE_OOM_LOOP_TASK=y -# LOSCFG_ENABLE_MAGICKEY is not set LOSCFG_DRIVERS_USB_HOST_XHCI=y LOSCFG_DRIVERS_USB_ETHERNET=y LOSCFG_DRIVERS_USB_WIRELESS=y diff --git a/tools/build/config/qemu_arm_virt_debug_shell.config b/tools/build/config/qemu_arm_virt_debug_shell.config index cef8fbb3..0efa46b2 100644 --- a/tools/build/config/qemu_arm_virt_debug_shell.config +++ b/tools/build/config/qemu_arm_virt_debug_shell.config @@ -6,7 +6,6 @@ LOSCFG_FS_FAT=y LOSCFG_FS_FAT_DISK=y LOSCFG_FS_FAT_VIRTUAL_PARTITION=y LOSCFG_FS_VFS_BLOCK_DEVICE=y -LOSCFG_ENABLE_MAGICKEY=y LOSCFG_DEBUG_VERSION=y # LOSCFG_SHELL_LK is not set LOSCFG_USER_INIT_DEBUG=y From 6d948a42bbc2f952e2cd8bb5273b629f3343df8b Mon Sep 17 00:00:00 2001 From: Caoruihong Date: Sat, 10 Jul 2021 19:36:44 +0800 Subject: [PATCH 20/43] chore: place .config files under config dir of products place .config files under config dir of products Signed-off-by: Caoruihong Change-Id: I80c6641ae462d4888a6f3124f92b4c9d7fa1567b --- BUILD.gn | 6 +----- build.sh | 33 +++++++++++---------------------- kernel_test.sources | 1 - 3 files changed, 12 insertions(+), 28 deletions(-) delete mode 100644 kernel_test.sources diff --git a/BUILD.gn b/BUILD.gn index af86842e..df7704a6 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -73,14 +73,10 @@ lite_subsystem("kernel") { build_ext_component("make") { exec_path = rebase_path(".", root_build_dir) - tee_enable = "false" - if (board_name == "hi3516dv300" && enable_tee_ree) { - tee_enable = "tee" - } outdir = rebase_path(get_path_info(".", "out_dir")) sysroot_path = rebase_path(ohos_current_sysroot) arch_cflags = string_join(" ", target_arch_cflags) - command = "./build.sh ${board_name} ${ohos_build_compiler} ${root_build_dir} ${ohos_build_type} ${tee_enable}" + command = "./build.sh ${board_name} ${ohos_build_compiler} ${root_build_dir} ${ohos_build_type} \"${tee_enable}\"" command += " \"${device_company}\" \"${product_path}\" $outdir \"${ohos_version}\" ${sysroot_path} \"${arch_cflags}\"" command += " \"${device_path}\"" } diff --git a/build.sh b/build.sh index 70ffc687..16794d13 100755 --- a/build.sh +++ b/build.sh @@ -48,44 +48,33 @@ echo "sh param:" "$@" function main() { destination=".config" - config_file="" tee="" - if [ "${tee_enable}" = "tee" ]; then + if [ "${tee_enable}" = "true" ]; then tee="_tee" fi + + config_file="${product_path}/config/${ohos_build_type}${tee}.config" + if [ -f "${config_file}" ]; then + cp "${config_file}" "${destination}" + return + fi + product_name=$(basename "${product_path}") - source="tools/build/config/${product_name}_release.config" + config_file="${product_name}_release.config" if [ "${ohos_build_compiler}" = "clang" ]; then if [ "${ohos_build_type}" = "debug" ]; then - config_file="${product_name}_${ohos_build_compiler}${tee}.config" - source="tools/build/config/debug/${config_file}" + config_file="debug/${product_name}_${ohos_build_compiler}${tee}.config" else config_file="${product_name}_${ohos_build_compiler}_release${tee}.config" - source="tools/build/config/${config_file}" fi elif [ "${ohos_build_compiler}" = "gcc" ]; then if [ "${ohos_build_type}" = "debug" ]; then config_file="${product_name}_debug_shell${tee}.config" - source="tools/build/config/${config_file}" else config_file="${product_name}_release${tee}.config" - source="tools/build/config/${config_file}" fi fi - if [ -d "./out" ]; then - rm -rf ./out - fi - if [ -f "${destination}" ]; then - rm -rf ${destination} - fi - if [ ! -f "${source}" ]; then - source="${product_path}/config/sys/${config_file}" - fi - cp "${source}" ${destination} - - test_info_outdir="../..${root_build_dir}/test_info/gen/kernel/test" - mkdir -p "${test_info_outdir}" - cp kernel_test.sources "${test_info_outdir}" + cp "tools/build/config/${config_file}" "${destination}" } if [ "x" != "x${sysroot_path}" ]; then diff --git a/kernel_test.sources b/kernel_test.sources deleted file mode 100644 index cab52bfd..00000000 --- a/kernel_test.sources +++ /dev/null @@ -1 +0,0 @@ -../../kernel/liteos_a/test/apps/src/osTest.c From 92d7672b1938ab2bfc5d1b96107c9a804ccd9e9f Mon Sep 17 00:00:00 2001 From: Caoruihong Date: Mon, 12 Jul 2021 18:26:37 +0800 Subject: [PATCH 21/43] chore: remove unused dead symlink files remove unused dead symlink files Signed-off-by: Caoruihong Change-Id: I8dd3bf4496173fd20bfcd728c256d429fb4fa077 --- bsd/compat/linuxkpi/include/linux/mtd/mtd.h | 1 - bsd/compat/linuxkpi/include/linux/mtd/mtd_list.h | 1 - 2 files changed, 2 deletions(-) delete mode 120000 bsd/compat/linuxkpi/include/linux/mtd/mtd.h delete mode 120000 bsd/compat/linuxkpi/include/linux/mtd/mtd_list.h diff --git a/bsd/compat/linuxkpi/include/linux/mtd/mtd.h b/bsd/compat/linuxkpi/include/linux/mtd/mtd.h deleted file mode 120000 index 89878fc8..00000000 --- a/bsd/compat/linuxkpi/include/linux/mtd/mtd.h +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../third_party/Linux_Kernel/fs/jffs2/mtd.h \ No newline at end of file diff --git a/bsd/compat/linuxkpi/include/linux/mtd/mtd_list.h b/bsd/compat/linuxkpi/include/linux/mtd/mtd_list.h deleted file mode 120000 index d7004259..00000000 --- a/bsd/compat/linuxkpi/include/linux/mtd/mtd_list.h +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../third_party/Linux_Kernel/fs/jffs2/mtd_list.h \ No newline at end of file From ec977a1c7e9ba4ea6621ceb1d0d10e586148208d Mon Sep 17 00:00:00 2001 From: wangchen <253227059@qq.com> Date: Mon, 12 Jul 2021 20:06:58 +0800 Subject: [PATCH 22/43] =?UTF-8?q?fix:=20A=E6=A0=B8codex=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【背景】A核codex扫描告警消除。 【修改方案】 1. 将不可屏蔽告警进行修复。 【影响】 对现有的产品编译不会有影响。 re #I40B1S Signed-off-by: wangchen <253227059@qq.com> --- fs/jffs2/src/vfs_jffs2.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/jffs2/src/vfs_jffs2.c b/fs/jffs2/src/vfs_jffs2.c index 5fa6a156..234c435a 100644 --- a/fs/jffs2/src/vfs_jffs2.c +++ b/fs/jffs2/src/vfs_jffs2.c @@ -717,14 +717,17 @@ ssize_t VfsJffs2Readlink(struct Vnode *vnode, char *buffer, size_t bufLen) int VfsJffs2Unlink(struct Vnode *parentVnode, struct Vnode *targetVnode, const char *path) { int ret; - struct jffs2_inode *parentInode = (struct jffs2_inode *)parentVnode->data; - struct jffs2_inode *targetInode = (struct jffs2_inode *)targetVnode->data; + struct jffs2_inode *parentInode = NULL; + struct jffs2_inode *targetInode = NULL; if (!parentVnode || !targetVnode) { PRINTK("%s-%d parentVnode=%x, targetVnode=%x\n", __FUNCTION__, __LINE__, parentVnode, targetVnode); return -EINVAL; } + parentInode = (struct jffs2_inode *)parentVnode->data; + targetInode = (struct jffs2_inode *)targetVnode->data; + LOS_MuxLock(&g_jffs2FsLock, (uint32_t)JFFS2_WAITING_FOREVER); ret = jffs2_unlink(parentInode, targetInode, (const unsigned char *)path); From 33f5c70e6c8781758d2bfde0f60ca3d6ec7d543f Mon Sep 17 00:00:00 2001 From: Far Date: Mon, 12 Jul 2021 21:05:19 +0800 Subject: [PATCH 23/43] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DFATFS=E4=B8=AD?= =?UTF-8?q?=E4=B8=8D=E5=90=8C=E5=86=85=E9=83=A8=E6=8E=A5=E5=8F=A3=E4=B8=8D?= =?UTF-8?q?=E6=94=AF=E6=8C=81FAT12/FAT16=20FAT=E8=A1=A8=E7=BB=93=E6=9D=9F?= =?UTF-8?q?=E6=A0=87=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit FATFS内部接口中,仅对FAT32的FAT表结束符0x0FFFFFFF做了判断,而忽略了FAT12和FAT16的结束标志。 这会导致子在FAT12/FAT16中,部分功能异常。 Close #I409R6 Signed-off-by: Far --- fs/fat/os_adapt/fatfs.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/fs/fat/os_adapt/fatfs.c b/fs/fat/os_adapt/fatfs.c index 0330388e..1876af94 100644 --- a/fs/fat/os_adapt/fatfs.c +++ b/fs/fat/os_adapt/fatfs.c @@ -904,11 +904,13 @@ int fatfs_fallocate64(struct file *filep, int mode, off64_t offset, off64_t len) return -EBUSY; } result = f_expand(fp, (FSIZE_t)offset, (FSIZE_t)len, 1); - if (result == FR_OK && finfo->sclst == 0) { - finfo->sclst = fp->obj.sclust; + if (result == FR_OK) { + if (finfo->sclst == 0) { + finfo->sclst = fp->obj.sclust; + } + result = f_sync(fp); } - result = f_sync(fp); - unlock_fs(fs, FR_OK); + unlock_fs(fs, result); return -fatfs_2_vfs(result); } From fd6f91bc9f8321e646ab371858db33baa645c391 Mon Sep 17 00:00:00 2001 From: vcbchang Date: Fri, 2 Jul 2021 15:56:13 +0800 Subject: [PATCH 24/43] =?UTF-8?q?test:=20=E4=BF=AE=E5=A4=8Dsignal=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E5=85=B3=E4=BA=8Epipe=E9=83=A8=E5=88=86=E7=9A=84?= =?UTF-8?q?=E7=94=A8=E4=BE=8B=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【背景】signal模块中的pipe用例存在无法通过测试的问题,经查找,pipe用例存在多处bug,这里做以修复 【修改方案】 1 ItPosixPipe002用例存在pipe存在在父进程中没有关闭写端,父进程判断处有编码问题等 2 删掉了一些用例多余的close函数,精简了用例的结构 3 原来用例主子进程依靠延时来实现进程同步,这里更改为使用共享内存的方法来实现 re #I3YPQ8 Signed-off-by: vcbchang Change-Id: Ic0d0ab20521c9af5e5f1d75e76e047162d978464 --- .../unittest/signal/full/It_ipc_fdclr_001.cpp | 2 +- .../unittest/signal/full/It_ipc_fdset_001.cpp | 2 +- .../signal/full/It_ipc_fdzero_001.cpp | 2 +- .../unittest/signal/full/It_ipc_pipe_002.cpp | 17 ++++- .../unittest/signal/full/It_ipc_pipe_003.cpp | 21 +++++-- .../unittest/signal/full/pipe_test_005.cpp | 62 ++++++++++--------- testsuites/unittest/signal/signal_test.cpp | 11 ++++ .../signal/smoke/It_ipc_fdisset_001.cpp | 2 +- .../unittest/signal/smoke/pipe_test_002.cpp | 35 ++++++++--- 9 files changed, 105 insertions(+), 49 deletions(-) diff --git a/testsuites/unittest/signal/full/It_ipc_fdclr_001.cpp b/testsuites/unittest/signal/full/It_ipc_fdclr_001.cpp index 0a1f1897..13fd61a4 100644 --- a/testsuites/unittest/signal/full/It_ipc_fdclr_001.cpp +++ b/testsuites/unittest/signal/full/It_ipc_fdclr_001.cpp @@ -46,7 +46,7 @@ static UINT32 Testcase(VOID) ret = pipe(pipeFd[i]); ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); fdmax = pipeFd[i][1] > fdmax ? pipeFd[i][1] : fdmax; - ret = write(pipeFd[i][1], "hello world", TAR_STR_LEN); + ret = write(pipeFd[i][1], "aloha world", TAR_STR_LEN); printf("write first status: %d\n", ret); ICUNIT_GOTO_EQUAL(ret, TAR_STR_LEN, ret, EXIT); } diff --git a/testsuites/unittest/signal/full/It_ipc_fdset_001.cpp b/testsuites/unittest/signal/full/It_ipc_fdset_001.cpp index f244971b..dda0395b 100644 --- a/testsuites/unittest/signal/full/It_ipc_fdset_001.cpp +++ b/testsuites/unittest/signal/full/It_ipc_fdset_001.cpp @@ -49,7 +49,7 @@ static UINT32 Testcase(VOID) ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); fdmax = pipeFd[i][1] > fdmax ? pipeFd[i][1] : fdmax; fdmax = pipeFd[i][0] > fdmax ? pipeFd[i][0] : fdmax; - ret = write(pipeFd[i][1], "hello world", TAR_STR_LEN); + ret = write(pipeFd[i][1], "Aloha World", TAR_STR_LEN); printf("write first status: %d\n", ret); ICUNIT_GOTO_EQUAL(ret, TAR_STR_LEN, ret, EXIT); } diff --git a/testsuites/unittest/signal/full/It_ipc_fdzero_001.cpp b/testsuites/unittest/signal/full/It_ipc_fdzero_001.cpp index 34d14f83..33a45823 100644 --- a/testsuites/unittest/signal/full/It_ipc_fdzero_001.cpp +++ b/testsuites/unittest/signal/full/It_ipc_fdzero_001.cpp @@ -48,7 +48,7 @@ static UINT32 Testcase(VOID) ret = pipe(pipeFd[i]); ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); fdmax = pipeFd[i][1] > fdmax ? pipeFd[i][1] : fdmax; - ret = write(pipeFd[i][1], "hello world", TAR_STR_LEN); + ret = write(pipeFd[i][1], "Aloha world", TAR_STR_LEN); printf("write first status: %d\n", ret); ICUNIT_GOTO_EQUAL(ret, TAR_STR_LEN, ret, EXIT); } diff --git a/testsuites/unittest/signal/full/It_ipc_pipe_002.cpp b/testsuites/unittest/signal/full/It_ipc_pipe_002.cpp index f5dfbc21..be0e2578 100644 --- a/testsuites/unittest/signal/full/It_ipc_pipe_002.cpp +++ b/testsuites/unittest/signal/full/It_ipc_pipe_002.cpp @@ -29,28 +29,41 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "it_test_signal.h" - +#include "sys/shm.h" static UINT32 Testcase(VOID) { int pipeFd[2], ret, spid; // 2, pipe return 2 file descripter char buffer[20]; // 20, target buffer size + int *sharedflag = NULL; + int shmid; + ret = pipe(pipeFd); ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1); + shmid = shmget((key_t)IPC_PRIVATE, sizeof(int), 0666 | IPC_CREAT); // 0666 the authority of the shm + ICUNIT_ASSERT_NOT_EQUAL(shmid, -1, shmid); + sharedflag = (int *)shmat(shmid, NULL, 0); + *sharedflag = 0; + spid = fork(); ICUNIT_GOTO_NOT_EQUAL(spid, -1, spid, EXIT1); if (spid == 0) { + sharedflag = (int *)shmat(shmid, NULL, 0); close(pipeFd[0]); - sleep(10); // 10, sleep 10 second. ret = write(pipeFd[1], "hello world", 12); // 12, "hello world" length and '\0' printf("write first status: %d\n", ret); if (ret != 12) { // 12, "hello world" length and '\0' exit(11); // 11, the value of son process unexpect exit, convenient to debug } + *sharedflag = 1; close(pipeFd[1]); exit(RED_FLAG); } close(pipeFd[1]); + // waitting for the sub process has written the sentence + while (*sharedflag != 1) { + usleep(1); + } ret = read(pipeFd[0], buffer, 12); // 12, "hello world" length and '\0' ICUNIT_GOTO_EQUAL(ret, 12, ret, EXIT); // 12, "hello world" length and '\0' ret = strcmp(buffer, "hello world"); diff --git a/testsuites/unittest/signal/full/It_ipc_pipe_003.cpp b/testsuites/unittest/signal/full/It_ipc_pipe_003.cpp index d4e697a1..e19417f8 100644 --- a/testsuites/unittest/signal/full/It_ipc_pipe_003.cpp +++ b/testsuites/unittest/signal/full/It_ipc_pipe_003.cpp @@ -29,7 +29,7 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "it_test_signal.h" - +#include "sys/shm.h" static const int TAR_STR_LEN = 12; @@ -37,25 +37,38 @@ static UINT32 Testcase(VOID) { int pipeFd[2], ret, spid; // 2, pipe return 2 file descripter char buffer[20]; // 20, target buffer size + int *sharedflag = NULL; + int shmid; + ret = pipe(pipeFd); ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1); + shmid = shmget((key_t)IPC_PRIVATE, sizeof(int), 0666 | IPC_CREAT); // 0666 the authority of the shm + ICUNIT_ASSERT_NOT_EQUAL(shmid, -1, shmid); + sharedflag = (int *)shmat(shmid, NULL, 0); + *sharedflag = 0; + spid = fork(); ICUNIT_GOTO_NOT_EQUAL(spid, -1, spid, EXIT1); if (spid == 0) { + sharedflag = (int *)shmat(shmid, NULL, 0); close(pipeFd[0]); - ret = write(pipeFd[1], "hello world", TAR_STR_LEN); + ret = write(pipeFd[1], "Hello world", TAR_STR_LEN); printf("write first status: %d\n", ret); if (ret != TAR_STR_LEN) { exit(11); // 11, the value of son process unexpect exit, convenient to debug } + *sharedflag = 1; close(pipeFd[1]); exit(RED_FLAG); } close(pipeFd[1]); - sleep(2); // 2, sleep 2 second + // waitting for the sub process has written the sentence + while (*sharedflag != 1) { + usleep(1); + } ret = read(pipeFd[0], buffer, TAR_STR_LEN); ICUNIT_GOTO_EQUAL(ret, TAR_STR_LEN, ret, EXIT); - ret = strcmp(buffer, "hello world"); + ret = strcmp(buffer, "Hello world"); ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); printf("read pipe success: %s\n", buffer); wait(&ret); diff --git a/testsuites/unittest/signal/full/pipe_test_005.cpp b/testsuites/unittest/signal/full/pipe_test_005.cpp index f17964ef..9b490529 100644 --- a/testsuites/unittest/signal/full/pipe_test_005.cpp +++ b/testsuites/unittest/signal/full/pipe_test_005.cpp @@ -28,6 +28,7 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "sys/shm.h" #include "it_test_signal.h" #include "signal.h" @@ -41,58 +42,59 @@ static int PipecommonWrite() int pipefd[2]; // 2, array subscript pid_t pid; int retValue = -1; - retValue = pipe(pipefd); - ICUNIT_ASSERT_EQUAL(retValue, 0, retValue); - - signal(SIGPIPE, SigPrint); - + int *sharedflag = NULL; + int shmid; int *readFd = &pipefd[0]; int *writeFd = &pipefd[1]; - char sentence[] = "Hello World"; char readbuffer[100]; int status, ret; + retValue = pipe(pipefd); + ICUNIT_ASSERT_EQUAL(retValue, 0, retValue); + if (signal(SIGPIPE, SigPrint) == SIG_ERR) { + printf("signal error\n"); + } + + shmid = shmget((key_t)IPC_PRIVATE, sizeof(int), 0666 | IPC_CREAT); // 0666 the authority of the shm + ICUNIT_ASSERT_NOT_EQUAL(shmid, -1, shmid); + sharedflag = (int *)shmat(shmid, NULL, 0); + *sharedflag = 0; + pid = fork(); if (pid == -1) { printf("Fork Error!\n"); return -1; } else if (pid == 0) { - for (int i = 0; i < 3; i++) { // 3, Number of cycles - close(*readFd); - retValue = write(*writeFd, sentence, strlen(sentence) + 1); - - if (i == 0) { - if (retValue != strlen(sentence) + 1) { - exit(retValue); - } - } else { - if (retValue != -1) { - exit(retValue); - } - if (errno != EPIPE) { - exit(errno); - } - } - usleep(150000); // 150000, Used to calculate the delay time. + sharedflag = (int *)shmat(shmid, NULL, 0); + close(*readFd); + retValue = write(*writeFd, sentence, strlen(sentence) + 1); + ICUNIT_ASSERT_EQUAL(retValue, strlen(sentence) + 1, retValue); + *sharedflag = 1; + // 2 waitting for the father process close the pipe's read port + while (*sharedflag != 2) { + usleep(1); } + retValue = write(*writeFd, sentence, strlen(sentence) + 1); + ICUNIT_ASSERT_EQUAL(retValue, -1, retValue); + ICUNIT_ASSERT_EQUAL(errno, EPIPE, errno); exit(0); } else { - usleep(10000); // 10000, Used to calculate the delay time. - for (int i = 0; i < 3; i++) { // 3, Number of cycles - close(*readFd); + close(*writeFd); + // 1 waitting for the sub process has written the sentence first + while (*sharedflag != 1) { + usleep(1); } + close(*readFd); + // 2 father process close the pipe's read port + *sharedflag = 2; ret = waitpid(pid, &status, 0); ICUNIT_ASSERT_EQUAL(ret, pid, ret); ICUNIT_ASSERT_EQUAL(WEXITSTATUS(status), 0, WEXITSTATUS(status)); } - - close(*readFd); - close(*writeFd); return 0; } - void ItPosixPipe005(void) { TEST_ADD_CASE(__FUNCTION__, PipecommonWrite, TEST_POSIX, TEST_MEM, TEST_LEVEL0, TEST_FUNCTION); diff --git a/testsuites/unittest/signal/signal_test.cpp b/testsuites/unittest/signal/signal_test.cpp index 959457a5..7ddd1a97 100644 --- a/testsuites/unittest/signal/signal_test.cpp +++ b/testsuites/unittest/signal/signal_test.cpp @@ -627,6 +627,17 @@ HWTEST_F(SignalTest, ItPosixPipe003, TestSize.Level0) ItPosixPipe003(); } +/* * + * @tc.name: ItPosixPipe004 + * @tc.desc: function for SignalTest + * @tc.type: FUNC + * @tc.require: AR000EEMQ9 + */ +HWTEST_F(SignalTest, ItPosixPipe004, TestSize.Level0) +{ + ItPosixPipe004(); +} + /* * * @tc.name: ItPosixPipe005 * @tc.desc: function for SignalTest diff --git a/testsuites/unittest/signal/smoke/It_ipc_fdisset_001.cpp b/testsuites/unittest/signal/smoke/It_ipc_fdisset_001.cpp index 21205390..806f38d0 100644 --- a/testsuites/unittest/signal/smoke/It_ipc_fdisset_001.cpp +++ b/testsuites/unittest/signal/smoke/It_ipc_fdisset_001.cpp @@ -39,7 +39,7 @@ static UINT32 Testcase(VOID) fd_set reads; ret = pipe(pipeFd); ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); - ret = write(pipeFd[1], "hello world", TAR_STR_LEN); + ret = write(pipeFd[1], "Hello World", TAR_STR_LEN); printf("write first status: %d\n", ret); ICUNIT_GOTO_EQUAL(ret, TAR_STR_LEN, ret, EXIT); FD_ZERO(&reads); diff --git a/testsuites/unittest/signal/smoke/pipe_test_002.cpp b/testsuites/unittest/signal/smoke/pipe_test_002.cpp index ccbcfbc6..fafa5f3b 100644 --- a/testsuites/unittest/signal/smoke/pipe_test_002.cpp +++ b/testsuites/unittest/signal/smoke/pipe_test_002.cpp @@ -31,6 +31,7 @@ #include "it_test_signal.h" #include "signal.h" #include "fcntl.h" +#include "sys/shm.h" static int TestPipeMultiProcess() { @@ -42,46 +43,62 @@ static int TestPipeMultiProcess() int *readFd = &pipefd[0]; int *writeFd = &pipefd[1]; - - char readbuffer[100]; + char readbuffer[100] = {0}; int status, ret; int totalNum = 3; + int *sharedflag = NULL; + int shmid; int flag = fcntl(*readFd, F_GETFL); fcntl(*readFd, F_SETFL, flag | O_NONBLOCK); + shmid = shmget((key_t)IPC_PRIVATE, sizeof(int), 0666 | IPC_CREAT); // 0666 the authority of the shm + ICUNIT_ASSERT_NOT_EQUAL(shmid, -1, shmid); + sharedflag = (int *)shmat(shmid, NULL, 0); + *sharedflag = 0; pid = fork(); if (pid == -1) { printf("Fork Error!\n"); return -1; } else if (pid == 0) { + sharedflag = (int *)shmat(shmid, NULL, 0); + close(pipefd[0]); for (int i = 0; i < totalNum; i++) { errno = 0; char sentence1[15] = "Hello World"; - char a[4] = {0}; + char a[2] = {0}; sprintf(a, "%d", i); strcat(sentence1, a); int ret = write(*writeFd, sentence1, strlen(sentence1) + 1); + ICUNIT_ASSERT_EQUAL(ret, strlen(sentence1) + 1, ret); usleep(10000); // 10000, Used to calculate the delay time. } + *sharedflag = 1; + ret = close(pipefd[1]); + ICUNIT_ASSERT_EQUAL(ret, 0, ret); exit(0); } else { + close(pipefd[1]); + // waitting for the sub process has written the sentence first + while (*sharedflag != 1) { + usleep(1); + } for (int i = 0; i < totalNum; i++) { printf("read\n"); char sentence1[15] = "Hello World"; - char a[4] = {0}; + char a[2] = {0}; + sprintf(a, "%d", i); + strcat(sentence1, a); memset(readbuffer, 0, sizeof(readbuffer)); - retValue = read(*readFd, readbuffer, sizeof(readbuffer)); - printf("Receive %d bytes data : %s,%d\n", retValue, readbuffer, errno); - ICUNIT_ASSERT_SIZE_STRING_EQUAL(readbuffer, readbuffer, strlen(sentence1), errno); + retValue = read(*readFd, readbuffer, strlen(sentence1) + 1); + printf("Receive %d bytes data : %s, errno : %d\n", retValue, readbuffer, errno); + ICUNIT_ASSERT_SIZE_STRING_EQUAL(readbuffer, sentence1, strlen(sentence1), errno); } } ret = waitpid(pid, &status, 0); ICUNIT_ASSERT_EQUAL(ret, pid, ret); ret = close(pipefd[0]); ICUNIT_ASSERT_EQUAL(ret, 0, ret); - ret = close(pipefd[1]); - ICUNIT_ASSERT_EQUAL(ret, 0, ret); return 0; } From e7c4b1963a1f11cb976d1ebdf6e48d8eb2eb84d2 Mon Sep 17 00:00:00 2001 From: vcbchang Date: Tue, 6 Jul 2021 21:55:38 +0800 Subject: [PATCH 25/43] =?UTF-8?q?test:=20=E4=BF=AE=E5=A4=8Dmqueue=5Funitte?= =?UTF-8?q?st=E5=85=A8=E9=87=8F=E7=94=A8=E4=BE=8BItPosixQueue075=E4=B8=8EI?= =?UTF-8?q?tPosixQueue097,=E5=86=92=E7=83=9F=E7=94=A8=E4=BE=8B=20ItPosixQu?= =?UTF-8?q?eue053=E7=94=A8=E4=BE=8B=E5=AD=98=E5=9C=A8=E5=81=B6=E5=B0=94?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E9=80=9A=E8=BF=87=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【背景】mqueue_unittest用例ItPosixQueue075、ItPosixQueue053 与ItPosixQueue097用例存在偶尔无法通过的问题,现在将其修复 【修改方案】ItPosixQueue075中原来是通过延时来实现线程同步,现在更改为静态全局变量实现; ItPosixQueue097中的关于g_testCount利用延时来置标志位,实现线程同步。这里通过延时来期望线程调度,写的不合理,这里更改为等待标志位来实现线程同步。 re #I3Z9H9 Signed-off-by: vcbchang Change-Id: Ib1bb945a5393cb03f4d92e4332e20acd82eb1845 --- testsuites/unittest/common/include/osTest.h | 1 + testsuites/unittest/common/osTest.cpp | 7 +++++++ .../unittest/posix/mqueue/full/It_posix_queue_075.cpp | 9 +++++++-- .../unittest/posix/mqueue/full/It_posix_queue_097.cpp | 5 +---- .../unittest/posix/mqueue/smoke/It_posix_queue_053.cpp | 10 +++------- 5 files changed, 19 insertions(+), 13 deletions(-) diff --git a/testsuites/unittest/common/include/osTest.h b/testsuites/unittest/common/include/osTest.h index 0623b40a..3ee6fb5d 100644 --- a/testsuites/unittest/common/include/osTest.h +++ b/testsuites/unittest/common/include/osTest.h @@ -132,6 +132,7 @@ extern void TestBusyTaskDelay(UINT32 tick); extern void *malloc(size_t size); extern void TEST_DumpCpuid(void); extern u_long T_random(void); +extern VOID TestAssertWaitDelay(UINT32 *testCount, UINT32 flag); UINT32 LosTaskDelay(UINT32 tick); #define TEST_HwiDelete(ID) TEST_TEST_HwiDelete(ID, NULL) diff --git a/testsuites/unittest/common/osTest.cpp b/testsuites/unittest/common/osTest.cpp index a771a147..0c02e5e6 100644 --- a/testsuites/unittest/common/osTest.cpp +++ b/testsuites/unittest/common/osTest.cpp @@ -215,6 +215,13 @@ VOID TestAssertBusyTaskDelay(UINT32 timeout, UINT32 flag) } } +VOID TestAssertWaitDelay(UINT32 *testCount, UINT32 flag) +{ + while (*testCount != flag) { + usleep(1); + } +} + UINT32 PosixPthreadInit(pthread_attr_t *attr, int pri) { UINT32 uwRet = 0; diff --git a/testsuites/unittest/posix/mqueue/full/It_posix_queue_075.cpp b/testsuites/unittest/posix/mqueue/full/It_posix_queue_075.cpp index 137b60a2..2fea2090 100644 --- a/testsuites/unittest/posix/mqueue/full/It_posix_queue_075.cpp +++ b/testsuites/unittest/posix/mqueue/full/It_posix_queue_075.cpp @@ -29,6 +29,7 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "It_posix_queue.h" +static int g_testFlag = 0; static VOID *PthreadF01(VOID *arg) { @@ -37,12 +38,12 @@ static VOID *PthreadF01(VOID *arg) CHAR msgrcd[MQUEUE_STANDARD_NAME_LENGTH] = {0}; struct timespec ts = { 0 }; ts.tv_sec = 0xffff; - for (i = 0; i < MQUEUE_STANDARD_NAME_LENGTH * 2; i++) { // 2, The loop frequency name length. ret = mq_timedreceive(g_gqueue, msgrcd, MQUEUE_STANDARD_NAME_LENGTH, NULL, &ts); ICUNIT_GOTO_EQUAL(ret, MQUEUE_SHORT_ARRAY_LENGTH, ret, EXIT); ICUNIT_GOTO_STRING_EQUAL(msgrcd, MQUEUE_SEND_STRING_TEST, msgrcd, EXIT); } + g_testFlag = 0; // 0 means the sub thread has executed return NULL; EXIT: return NULL; @@ -62,6 +63,7 @@ static UINT32 Testcase(VOID) attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; + g_testFlag = 1; // 1 initialize the flag LOS_TaskLock(); snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq075_%d", LosCurTaskIDGet()); @@ -85,7 +87,10 @@ static UINT32 Testcase(VOID) ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); } - TestExtraTaskDelay(10); // 10, Set delay time. + // waitting for the flag is 0, means the sub thread has executed + while (g_testFlag) { + usleep(1); + } ret = mq_close(g_gqueue); ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); diff --git a/testsuites/unittest/posix/mqueue/full/It_posix_queue_097.cpp b/testsuites/unittest/posix/mqueue/full/It_posix_queue_097.cpp index e11c5034..00fad7b1 100644 --- a/testsuites/unittest/posix/mqueue/full/It_posix_queue_097.cpp +++ b/testsuites/unittest/posix/mqueue/full/It_posix_queue_097.cpp @@ -107,9 +107,6 @@ static UINT32 Testcase(VOID) ret = pthread_create(&newTh, &attr1, PthreadF01, NULL); ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); - LosTaskDelay(1); - ICUNIT_GOTO_EQUAL(g_testCount, 1, g_testCount, EXIT1); - ret = PosixPthreadInit(&attr1, MQUEUE_PTHREAD_PRIORITY_TEST2); ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT2); @@ -119,7 +116,7 @@ static UINT32 Testcase(VOID) ret = LosTaskDelay(10); // 10, Set delay time. ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT2); - ICUNIT_GOTO_EQUAL(g_testCount, 4, g_testCount, EXIT2); // 4, Here, assert the g_testCount. + TestAssertWaitDelay(&g_testCount, 4); // 4, Here, assert the g_testCount. ret = PosixPthreadDestroy(&attr1, newTh2); ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT2); diff --git a/testsuites/unittest/posix/mqueue/smoke/It_posix_queue_053.cpp b/testsuites/unittest/posix/mqueue/smoke/It_posix_queue_053.cpp index 2308073d..01dd6aa2 100644 --- a/testsuites/unittest/posix/mqueue/smoke/It_posix_queue_053.cpp +++ b/testsuites/unittest/posix/mqueue/smoke/It_posix_queue_053.cpp @@ -37,10 +37,7 @@ static VOID *PthreadF01(VOID *argument) g_testCount = 1; - ret = LosTaskDelay(5); // 5, Set the timeout of task delay; - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); - - ICUNIT_GOTO_EQUAL(g_testCount, 3, g_testCount, EXIT); // 3, Here, assert the g_testCount. + TestAssertWaitDelay(&g_testCount, 3); // 3, Here, assert the g_testCount. ret = mq_send(g_gqueue, msgptr, strlen(msgptr), 0); ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); @@ -105,8 +102,7 @@ static UINT32 Testcase(VOID) ret = pthread_create(&newTh1, &attr1, PthreadF01, NULL); ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); - LosTaskDelay(1); - ICUNIT_GOTO_EQUAL(g_testCount, 1, g_testCount, EXIT1); + TestAssertWaitDelay(&g_testCount, 1); ret = PosixPthreadInit(&attr1, MQUEUE_PTHREAD_PRIORITY_TEST2); ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT2); @@ -121,7 +117,7 @@ static UINT32 Testcase(VOID) #endif ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT2); - ICUNIT_GOTO_EQUAL(g_testCount, 4, g_testCount, EXIT2); // 4, Here, assert the g_testCount. + TestAssertWaitDelay(&g_testCount, 4); // 4, Here, assert the g_testCount. ret = PosixPthreadDestroy(&attr1, newTh2); ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT2); From 1157c4a28997e877a6e5e4da76f6095bddb12c51 Mon Sep 17 00:00:00 2001 From: zhushengle Date: Sat, 10 Jul 2021 17:36:56 +0800 Subject: [PATCH 26/43] =?UTF-8?q?fix=20:=20futex=20requeue=E6=9C=BA?= =?UTF-8?q?=E5=88=B6=E4=B8=AD=EF=BC=8C=E5=A4=B4=E8=8A=82=E7=82=B9=E7=9A=84?= =?UTF-8?q?queueList=20=E4=B8=BANULL,=20=E5=AF=BC=E8=87=B4=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit queuelist中的普通节点在调整为futexList的节点时, 未校验其queueList的有效性,导致queueList未初始化, 出现访问空指针;且在从旧链表迁移节点到新链表时, 节点从旧链表删除之后又插入到另一个链表中,导致对 旧链表的为NULL判断出错。 Close #I4024F Change-Id: I506a10fc5740ce16e682c2c419b9d92a82000b86 Signed-off-by: zhushengle --- kernel/base/ipc/los_futex.c | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/kernel/base/ipc/los_futex.c b/kernel/base/ipc/los_futex.c index 9e720e2f..d831a7c5 100644 --- a/kernel/base/ipc/los_futex.c +++ b/kernel/base/ipc/los_futex.c @@ -199,6 +199,9 @@ STATIC INLINE VOID OsFutexReplaceQueueListHeadNode(FutexNode *oldHeadNode, Futex LOS_DL_LIST *futexList = oldHeadNode->futexList.pstPrev; LOS_ListDelete(&oldHeadNode->futexList); LOS_ListHeadInsert(futexList, &newHeadNode->futexList); + if ((newHeadNode->queueList.pstNext == NULL) || (newHeadNode->queueList.pstPrev == NULL)) { + LOS_ListInit(&newHeadNode->queueList); + } } STATIC INLINE VOID OsFutexDeleteKeyFromFutexList(FutexNode *node) @@ -319,11 +322,10 @@ STATIC VOID OsFutexInsertNewFutexKeyToHash(FutexNode *node) futexList != &(hashNode->lockList); futexList = futexList->pstNext) { headNode = OS_FUTEX_FROM_FUTEXLIST(futexList); - if (node->key <= headNode->key) { + if (node->key <= headNode->key) { LOS_ListTailInsert(&(headNode->futexList), &(node->futexList)); break; } - } EXIT: @@ -797,6 +799,7 @@ EXIT_UNLOCK_ERR: STATIC INT32 OsFutexRequeueInsertNewKey(UINTPTR newFutexKey, INT32 newIndex, FutexNode *oldHeadNode) { + BOOL queueListIsEmpty = FALSE; INT32 ret; UINT32 intSave; LosTaskCB *task = NULL; @@ -817,25 +820,33 @@ STATIC INT32 OsFutexRequeueInsertNewKey(UINTPTR newFutexKey, INT32 newIndex, Fut nextNode = OS_FUTEX_FROM_QUEUELIST(queueList); SCHEDULER_LOCK(intSave); if (LOS_ListEmpty(&nextNode->pendList)) { - queueList = queueList->pstNext; + if (LOS_ListEmpty(queueList)) { + queueListIsEmpty = TRUE; + } else { + queueList = queueList->pstNext; + } OsFutexDeinitFutexNode(nextNode); SCHEDULER_UNLOCK(intSave); - if (queueList->pstNext != NULL) { - continue; - } else { + if (queueListIsEmpty) { return LOS_OK; } + + continue; } task = OS_TCB_FROM_PENDLIST(LOS_DL_LIST_FIRST(&(nextNode->pendList))); - queueList = queueList->pstNext; + if (LOS_ListEmpty(queueList)) { + queueListIsEmpty = TRUE; + } else { + queueList = queueList->pstNext; + } LOS_ListDelete(&nextNode->queueList); ret = OsFutexInsertTasktoPendList(&newHeadNode, nextNode, task); SCHEDULER_UNLOCK(intSave); if (ret != LOS_OK) { PRINT_ERR("Futex requeue insert new key failed!\n"); } - } while (queueList->pstNext != NULL); + } while (!queueListIsEmpty); return LOS_OK; } From a195aac9fb60b0163f9eebb29084287d226bd14c Mon Sep 17 00:00:00 2001 From: qidechun Date: Fri, 9 Jul 2021 18:46:19 +0800 Subject: [PATCH 27/43] feat: add blackbox for liteos_a MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1、在内核增加BlackBox核心框架,对外提供模块回调接口注册和故障处理接口。 2、增加默认的系统模块适配层,处理通用内核态和用户态故障日志抓取和保存。 3、BBOX特性默认关闭,若想使用此特性,请在内核配置文件中增加如下编译选项: LOSCFG_BLACKBOX=y LOSCFG_SAVE_EXCINFO=y LOSCFG_SAVE_EXCINFO可以帮助抓取更多的故障日志。 4、若已经打开BBOX特性,想快速验证此特性,请添加如下编译选项: LOSCFG_HIDUMPER=y Close #I406NP Signed-off-by: qidechun --- Kconfig | 2 + arch/arm/arm/src/los_exc.c | 16 + kernel/base/misc/task_shellcmd.c | 6 + kernel/common/blackbox/Kconfig | 10 + kernel/common/blackbox/Makefile | 14 + kernel/common/blackbox/los_blackbox.h | 91 ++++ kernel/common/blackbox/los_blackbox_common.c | 127 +++++ kernel/common/blackbox/los_blackbox_common.h | 61 +++ kernel/common/blackbox/los_blackbox_core.c | 458 ++++++++++++++++++ .../common/blackbox/los_blackbox_detector.c | 63 +++ .../common/blackbox/los_blackbox_detector.h | 51 ++ .../blackbox/los_blackbox_system_adapter.c | 265 ++++++++++ .../blackbox/los_blackbox_system_adapter.h | 51 ++ kernel/common/los_excinfo.c | 4 + tools/build/mk/liteos_tables_ldflags.mk | 4 +- tools/build/mk/los_config.mk | 8 +- 16 files changed, 1229 insertions(+), 2 deletions(-) create mode 100644 kernel/common/blackbox/Kconfig create mode 100644 kernel/common/blackbox/Makefile create mode 100644 kernel/common/blackbox/los_blackbox.h create mode 100644 kernel/common/blackbox/los_blackbox_common.c create mode 100644 kernel/common/blackbox/los_blackbox_common.h create mode 100644 kernel/common/blackbox/los_blackbox_core.c create mode 100644 kernel/common/blackbox/los_blackbox_detector.c create mode 100644 kernel/common/blackbox/los_blackbox_detector.h create mode 100644 kernel/common/blackbox/los_blackbox_system_adapter.c create mode 100644 kernel/common/blackbox/los_blackbox_system_adapter.h diff --git a/Kconfig b/Kconfig index d8cbaa97..d9f60a40 100644 --- a/Kconfig +++ b/Kconfig @@ -61,6 +61,8 @@ source "arch/Kconfig" source "kernel/common/Kconfig" ######################### config options of patchfs ##################### source "kernel/common/patchfs/Kconfig" +######################### config options of blackbox ##################### +source "kernel/common/blackbox/Kconfig" config QUICK_START bool "Enable QUICK_START" diff --git a/arch/arm/arm/src/los_exc.c b/arch/arm/arm/src/los_exc.c index 2c05b21a..c90f591f 100644 --- a/arch/arm/arm/src/los_exc.c +++ b/arch/arm/arm/src/los_exc.c @@ -61,6 +61,9 @@ #ifdef LOSCFG_FS_VFS #include "console.h" #endif +#ifdef LOSCFG_BLACKBOX +#include "los_blackbox.h" +#endif #define INVALID_CPUID 0xFFFF @@ -568,6 +571,9 @@ STATIC VOID OsUserExcHandle(ExcContext *excBufAddr) #endif #endif +#ifdef LOSCFG_BLACKBOX + BBoxNotifyError("USER_CRASH", MODULE_SYSTEM, "Crash in user", 0); +#endif SCHEDULER_LOCK(intSave); #ifdef LOSCFG_SAVE_EXCINFO OsProcessExitCodeCoreDumpSet(runProcess); @@ -1057,6 +1063,11 @@ LITE_OS_SEC_TEXT VOID STATIC OsExcPriorDisposal(ExcContext *excBufAddr) LITE_OS_SEC_TEXT_INIT STATIC VOID OsPrintExcHead(UINT32 far) { +#ifdef LOSCFG_BLACKBOX +#ifdef LOSCFG_SAVE_EXCINFO + SetExcInfoIndex(0); +#endif +#endif #ifdef LOSCFG_KERNEL_VM /* You are not allowed to add any other print information before this exception information */ if (g_excFromUserMode[ArchCurrCpuid()] == TRUE) { @@ -1124,7 +1135,9 @@ LITE_OS_SEC_TEXT_INIT VOID OsExcHandleEntry(UINT32 excType, ExcContext *excBufAd if (g_curNestCount[ArchCurrCpuid()] == 1) { #ifdef LOSCFG_SAVE_EXCINFO if (func != NULL) { +#ifndef LOSCFG_BLACKBOX SetExcInfoIndex(0); +#endif OsSysStateSave(&intCount, &lockCount); OsRecordExcInfoTime(); OsSysStateRestore(intCount, lockCount); @@ -1153,6 +1166,9 @@ LITE_OS_SEC_TEXT_INIT VOID OsExcHandleEntry(UINT32 excType, ExcContext *excBufAd } #endif +#ifdef LOSCFG_BLACKBOX + BBoxNotifyError(EVENT_PANIC, MODULE_SYSTEM, "Crash in kernel", 1); +#endif while (1) {} } diff --git a/kernel/base/misc/task_shellcmd.c b/kernel/base/misc/task_shellcmd.c index 05623a56..854e2d6c 100644 --- a/kernel/base/misc/task_shellcmd.c +++ b/kernel/base/misc/task_shellcmd.c @@ -85,12 +85,18 @@ STATIC UINT32 *taskWaterLine = NULL; #define OS_TASK_ALL_INFO_LEN (g_taskMaxNum * (sizeof(LosTaskCB) + sizeof(UINT32))) #ifdef LOSCFG_FS_VFS +#if defined(LOSCFG_BLACKBOX) && defined(LOSCFG_SAVE_EXCINFO) +#define SaveExcInfo(arg, ...) WriteExcInfoToBuf(arg, ##__VA_ARGS__) +#else +#define SaveExcInfo(arg, ...) +#endif #define PROCESS_INFO_SHOW(seqBuf, arg...) do { \ if (seqBuf != NULL) { \ (void)LosBufPrintf((struct SeqBuf *)seqBuf, ##arg); \ } else { \ PRINTK(arg); \ } \ + SaveExcInfo(arg); \ } while (0) #else #define PROCESS_INFO_SHOW(seqBuf, arg...) PRINTK(arg) diff --git a/kernel/common/blackbox/Kconfig b/kernel/common/blackbox/Kconfig new file mode 100644 index 00000000..8298b923 --- /dev/null +++ b/kernel/common/blackbox/Kconfig @@ -0,0 +1,10 @@ +config BLACKBOX + bool "Enable BlackBox" + default n + help + Answer Y to enable LiteOS support blackbox + +config LOG_ROOT_PATH + string "unknown" + help + define the default log path of blackbox \ No newline at end of file diff --git a/kernel/common/blackbox/Makefile b/kernel/common/blackbox/Makefile new file mode 100644 index 00000000..3e611c90 --- /dev/null +++ b/kernel/common/blackbox/Makefile @@ -0,0 +1,14 @@ +include $(LITEOSTOPDIR)/config.mk + +MODULE_NAME := $(notdir $(shell pwd)) + +LOCAL_SRCS := $(wildcard *.c) + +LOCAL_INCLUDE := \ + -I $(LITEOSTOPDIR)/kernel/common \ + -I $(LITEOSTOPDIR)/kernel/common/blackbox \ + -I $(LITEOSTOPDIR)/syscall + +LOCAL_FLAGS := $(LOCAL_INCLUDE) $(LITEOS_GCOV_OPTS) + +include $(MODULE) diff --git a/kernel/common/blackbox/los_blackbox.h b/kernel/common/blackbox/los_blackbox.h new file mode 100644 index 00000000..36a69820 --- /dev/null +++ b/kernel/common/blackbox/los_blackbox.h @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef LOS_BLACKBOX_H +#define LOS_BLACKBOX_H + +#ifdef __cplusplus +#if __cplusplus +extern "C" { +#endif /* __cplusplus */ +#endif /* __cplusplus */ + +#include "stdarg.h" +#include "los_typedef.h" + +#define PATH_MAX_LEN 256 +#define EVENT_MAX_LEN 32 +#define MODULE_MAX_LEN 32 +#define ERROR_DESC_MAX_LEN 512 +#ifndef LOSCFG_LOG_ROOT_PATH +#define LOSCFG_LOG_ROOT_PATH "/storage/data/log" +#endif +#define KERNEL_FAULT_LOG_PATH LOSCFG_LOG_ROOT_PATH "/kernel_fault.log" +#define USER_FAULT_LOG_PATH LOSCFG_LOG_ROOT_PATH "/user_fault.log" + +#define MODULE_SYSTEM "SYSTEM" +#define EVENT_SYSREBOOT "SYSREBOOT" +#define EVENT_LONGPRESS "LONGPRESS" +#define EVENT_COMBINATIONKEY "COMBINATIONKEY" +#define EVENT_SUBSYSREBOOT "SUBSYSREBOOT" +#define EVENT_POWEROFF "POWEROFF" +#define EVENT_PANIC "PANIC" +#define EVENT_SYS_WATCHDOG "SYSWATCHDOG" +#define EVENT_HUNGTASK "HUNGTASK" +#define EVENT_BOOTFAIL "BOOTFAIL" + +struct ErrorInfo { + char event[EVENT_MAX_LEN]; + char module[MODULE_MAX_LEN]; + char errorDesc[ERROR_DESC_MAX_LEN]; +}; + +struct ModuleOps { + char module[MODULE_MAX_LEN]; + void (*Dump)(const char *logDir, struct ErrorInfo *info); + void (*Reset)(struct ErrorInfo *info); + int (*GetLastLogInfo)(struct ErrorInfo *info); + int (*SaveLastLog)(const char *logDir, struct ErrorInfo *info); +}; + +int BBoxRegisterModuleOps(struct ModuleOps *ops); +int BBoxNotifyError(const char event[EVENT_MAX_LEN], + const char module[MODULE_MAX_LEN], + const char errorDesc[ERROR_DESC_MAX_LEN], + int needSysReset); +int OsBBoxDriverInit(void); + +#ifdef __cplusplus +#if __cplusplus +} +#endif /* __cplusplus */ +#endif /* __cplusplus */ + +#endif \ No newline at end of file diff --git a/kernel/common/blackbox/los_blackbox_common.c b/kernel/common/blackbox/los_blackbox_common.c new file mode 100644 index 00000000..c7ae0795 --- /dev/null +++ b/kernel/common/blackbox/los_blackbox_common.c @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* ------------ includes ------------ */ +#include "los_blackbox_common.h" +#ifdef LOSCFG_LIB_LIBC +#include "stdlib.h" +#include "unistd.h" +#endif +#ifdef LOSCFG_FS_VFS +#include "fs/fs.h" +#endif +#include "securec.h" +#include "los_memory.h" + +/* ------------ local macroes ------------ */ +/* ------------ local prototypes ------------ */ +/* ------------ local function declarations ------------ */ +/* ------------ global function declarations ------------ */ +/* ------------ local variables ------------ */ +/* ------------ function definitions ------------ */ +int FullWriteFile(const char *filePath, const char *buf, size_t bufSize, int isAppend) +{ +#ifdef LOSCFG_FS_VFS + int fd; + int totalToWrite = (int)bufSize; + int totalWrite = 0; + + if (filePath == NULL || buf == NULL || bufSize == 0) { + BBOX_PRINT_ERR("filePath: %p, buf: %p, bufSize: %lu!\n", filePath, buf, bufSize); + return -1; + } + + if (!IsLogPartReady()) { + BBOX_PRINT_ERR("log path [%s] isn't ready to be written!\n", LOSCFG_LOG_ROOT_PATH); + return -1; + } + fd = open(filePath, O_CREAT | O_RDWR | (isAppend ? O_APPEND : O_TRUNC), 0644); + if (fd < 0) { + BBOX_PRINT_ERR("Create file [%s] failed, fd: %d!\n", filePath, fd); + return -1; + } + while (totalToWrite > 0) { + int writeThisTime = write(fd, buf, totalToWrite); + if (writeThisTime < 0) { + BBOX_PRINT_ERR("Failed to write file [%s]!\n", filePath); + (void)close(fd); + return -1; + } + buf += writeThisTime; + totalToWrite -= writeThisTime; + totalWrite += writeThisTime; + } + (void)close(fd); + + return (totalWrite == (int)bufSize) ? 0 : -1; +#else + (VOID)filePath; + (VOID)buf; + (VOID)bufSize; + (VOID)isAppend; + return -1; +#endif +} + +int SaveBasicErrorInfo(const char *filePath, struct ErrorInfo *info) +{ + char *buf = NULL; + + if (filePath == NULL || info == NULL) { + BBOX_PRINT_ERR("filePath: %p, event: %p!\n", filePath, info); + return -1; + } + + buf = LOS_MemAlloc(m_aucSysMem1, ERROR_INFO_MAX_LEN); + if (buf == NULL) { + BBOX_PRINT_ERR("LOS_MemAlloc failed!\n"); + return -1; + } + (void)memset_s(buf, ERROR_INFO_MAX_LEN, 0, ERROR_INFO_MAX_LEN); + (void)snprintf_s(buf, ERROR_INFO_MAX_LEN, ERROR_INFO_MAX_LEN - 1, + ERROR_INFO_HEADER_FORMAT, info->event, info->module, info->errorDesc); + *(buf + ERROR_INFO_MAX_LEN - 1) = '\0'; + (void)FullWriteFile(filePath, buf, strlen(buf), 0); + (void)LOS_MemFree(m_aucSysMem1, buf); + + return 0; +} + +#ifdef LOSCFG_FS_VFS +bool IsLogPartReady(void) +{ + return access(LOSCFG_LOG_ROOT_PATH, W_OK) == 0; +} +#else +bool IsLogPartReady(void) +{ + return TRUE; +} +#endif \ No newline at end of file diff --git a/kernel/common/blackbox/los_blackbox_common.h b/kernel/common/blackbox/los_blackbox_common.h new file mode 100644 index 00000000..6d20a934 --- /dev/null +++ b/kernel/common/blackbox/los_blackbox_common.h @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef LOS_BLACKBOX_COMMON_H +#define LOS_BLACKBOX_COMMON_H + +#ifdef __cplusplus +#if __cplusplus +extern "C" { +#endif /* __cplusplus */ +#endif /* __cplusplus */ + +#include "los_blackbox.h" +#include "los_printf.h" +#include "los_typedef.h" + +#define ERROR_INFO_HEADER_FORMAT "#### error info ####\nevent: %s\nmodule: %s\nerrorDesc: %s\n" +#define ERROR_INFO_MAX_LEN 768 +#define Min(a, b) (((a) > (b)) ? (b) : (a)) +#define BBOX_PRINT_ERR(format, ...) PRINTK("bbox: func: %s, line: %d, Err: " \ + format, __func__, __LINE__, ##__VA_ARGS__) +#define BBOX_PRINT_INFO(format, ...) PRINTK("bbox: Info: " format, ##__VA_ARGS__) + +int FullWriteFile(const char *filePath, const char *buf, size_t bufSize, int isAppend); +int SaveBasicErrorInfo(const char *filePath, struct ErrorInfo *info); +bool IsLogPartReady(void); + +#ifdef __cplusplus +#if __cplusplus +} +#endif /* __cplusplus */ +#endif /* __cplusplus */ + +#endif \ No newline at end of file diff --git a/kernel/common/blackbox/los_blackbox_core.c b/kernel/common/blackbox/los_blackbox_core.c new file mode 100644 index 00000000..1e283fea --- /dev/null +++ b/kernel/common/blackbox/los_blackbox_core.c @@ -0,0 +1,458 @@ +/* + * Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* ------------ includes ------------ */ +#include "los_blackbox.h" +#include "los_blackbox_common.h" +#include "los_blackbox_detector.h" +#ifdef LOSCFG_LIB_LIBC +#include "stdlib.h" +#include "unistd.h" +#endif +#include "los_base.h" +#include "los_config.h" +#include "los_excinfo_pri.h" +#include "los_hw.h" +#include "los_init.h" +#include "los_memory.h" +#include "los_sem.h" +#include "los_syscall.h" +#include "los_task_pri.h" +#include "securec.h" +#include "sys/reboot.h" + +/* ------------ local macroes ------------ */ +#define LOG_WAIT_TIMES 10 +#define LOG_PART_WAIT_TIME 1000 + +/* ------------ local prototypes ------------ */ +typedef struct BBoxOps { + LOS_DL_LIST opsList; + struct ModuleOps ops; +} BBoxOps; + +/* ------------ local function declarations ------------ */ +/* ------------ global function declarations ------------ */ +/* ------------ local variables ------------ */ +static bool g_bboxInitSucc = FALSE; +static UINT32 g_opsListSem = 0; +static UINT32 g_tempErrInfoSem = 0; +static UINT32 g_tempErrLogSaveSem = 0; +static LOS_DL_LIST_HEAD(g_opsList); +struct ErrorInfo *g_tempErrInfo; + +/* ------------ function definitions ------------ */ +static void FormatErrorInfo(struct ErrorInfo *info, + const char event[EVENT_MAX_LEN], + const char module[MODULE_MAX_LEN], + const char errorDesc[ERROR_DESC_MAX_LEN]) +{ + if (info == NULL || event == NULL || module == NULL || errorDesc == NULL) { + BBOX_PRINT_ERR("info: %p, event: %p, module: %p, errorDesc: %p!\n", info, event, module, errorDesc); + return; + } + + (void)memset_s(info, sizeof(*info), 0, sizeof(*info)); + (void)strncpy_s(info->event, sizeof(info->event), event, Min(strlen(event), sizeof(info->event) - 1)); + (void)strncpy_s(info->module, sizeof(info->module), module, Min(strlen(module), sizeof(info->module) - 1)); + (void)strncpy_s(info->errorDesc, sizeof(info->errorDesc), errorDesc, + Min(strlen(errorDesc), sizeof(info->errorDesc) - 1)); +} + +#ifdef LOSCFG_FS_VFS +static void WaitForLogPart(void) +{ + BBOX_PRINT_INFO("wait for log part [%s] begin!\n", LOSCFG_LOG_ROOT_PATH); + while (!IsLogPartReady()) { + LOS_Msleep(LOG_PART_WAIT_TIME); + } + BBOX_PRINT_INFO("wait for log part [%s] end!\n", LOSCFG_LOG_ROOT_PATH); +} +#else +static void WaitForLogPart(void) +{ + int i = 0; + + BBOX_PRINT_INFO("wait for log part [%s] begin!\n", LOSCFG_LOG_ROOT_PATH); + while (i++ < LOG_WAIT_TIMES) { + LOS_Msleep(LOG_PART_WAIT_TIME); + } + BBOX_PRINT_INFO("wait for log part [%s] end!\n", LOSCFG_LOG_ROOT_PATH); +} +#endif + +static bool FindModuleOps(struct ErrorInfo *info, BBoxOps **ops) +{ + bool found = false; + + if (info == NULL || ops == NULL) { + BBOX_PRINT_ERR("info: %p, ops: %p!\n", info, ops); + return found; + } + + LOS_DL_LIST_FOR_EACH_ENTRY(*ops, &g_opsList, BBoxOps, opsList) { + if (*ops != NULL && strcmp((*ops)->ops.module, info->module) == 0) { + found = true; + break; + } + } + if (!found) { + BBOX_PRINT_ERR("[%s] hasn't been registered!\n", info->module); + } + + return found; +} + +static void InvokeModuleOps(struct ErrorInfo *info, BBoxOps *ops) +{ + if (info == NULL || ops == NULL) { + BBOX_PRINT_ERR("info: %p, ops: %p!\n", info, ops); + return; + } + + if (ops->ops.Dump != NULL) { + BBOX_PRINT_INFO("[%s] starts dumping log!\n", ops->ops.module); + ops->ops.Dump(LOSCFG_LOG_ROOT_PATH, info); + BBOX_PRINT_INFO("[%s] ends dumping log!\n", ops->ops.module); + } + if (ops->ops.Reset != NULL) { + BBOX_PRINT_INFO("[%s] starts resetting!\n", ops->ops.module); + ops->ops.Reset(info); + BBOX_PRINT_INFO("[%s] ends resetting!\n", ops->ops.module); + } +} + +static void SaveLastLog(const char *logDir) +{ + struct ErrorInfo *info = NULL; + BBoxOps *ops = NULL; + + info = LOS_MemAlloc(m_aucSysMem1, sizeof(*info)); + if (info == NULL) { + BBOX_PRINT_ERR("LOS_MemAlloc failed!\n"); + return; + } + + if (LOS_SemPend(g_opsListSem, LOS_WAIT_FOREVER) != LOS_OK) { + BBOX_PRINT_ERR("Request g_opsListSem failed!\n"); + (void)LOS_MemFree(m_aucSysMem1, info); + return; + } + + LOS_DL_LIST_FOR_EACH_ENTRY(ops, &g_opsList, BBoxOps, opsList) { + if (ops == NULL) { + BBOX_PRINT_ERR("ops: NULL, please check it!\n"); + continue; + } + if (ops->ops.GetLastLogInfo != NULL && ops->ops.SaveLastLog != NULL) { + (void)memset_s(info, sizeof(*info), 0, sizeof(*info)); + if (ops->ops.GetLastLogInfo(info) != 0) { + BBOX_PRINT_ERR("[%s] failed to get log info!\n", ops->ops.module); + continue; + } + BBOX_PRINT_INFO("[%s] starts saving log!\n", ops->ops.module); + if (ops->ops.SaveLastLog(logDir, info) != 0) { + BBOX_PRINT_ERR("[%s] failed to save log!\n", ops->ops.module); + } else { + BBOX_PRINT_INFO("[%s] ends saving log!\n", ops->ops.module); + BBOX_PRINT_INFO("[%s] starts uploading event [%s]\n", info->module, info->event); +#ifdef LOSCFG_FS_VFS + (void)UploadEventByFile(KERNEL_FAULT_LOG_PATH); +#else + BBOX_PRINT_INFO("LOSCFG_FS_VFS isn't defined!\n"); +#endif + BBOX_PRINT_INFO("[%s] ends uploading event [%s]\n", info->module, info->event); + } + } else { + BBOX_PRINT_ERR("module [%s], GetLastLogInfo: %p, SaveLastLog: %p!\n", + ops->ops.module, ops->ops.GetLastLogInfo, ops->ops.SaveLastLog); + } + } + (void)LOS_SemPost(g_opsListSem); + (void)LOS_MemFree(m_aucSysMem1, info); +} + +static void SaveLogWithoutReset(struct ErrorInfo *info) +{ + BBoxOps *ops = NULL; + + if (info == NULL) { + BBOX_PRINT_ERR("info is NULL!\n"); + return; + } + + if (LOS_SemPend(g_opsListSem, LOS_WAIT_FOREVER) != LOS_OK) { + BBOX_PRINT_ERR("Request g_opsListSem failed!\n"); + return; + } + if (!FindModuleOps(info, &ops)) { + (void)LOS_SemPost(g_opsListSem); + return; + } + if (ops->ops.Dump == NULL && ops->ops.Reset == NULL) { + (void)LOS_SemPost(g_opsListSem); + if (SaveBasicErrorInfo(USER_FAULT_LOG_PATH, info) == 0) { + BBOX_PRINT_INFO("[%s] starts uploading event [%s]\n", info->module, info->event); +#ifdef LOSCFG_FS_VFS + (void)UploadEventByFile(USER_FAULT_LOG_PATH); +#else + BBOX_PRINT_INFO("LOSCFG_FS_VFS isn't defined!\n"); +#endif + BBOX_PRINT_INFO("[%s] ends uploading event [%s]\n", info->module, info->event); + } + return; + } + InvokeModuleOps(info, ops); + (void)LOS_SemPost(g_opsListSem); +} + +static void SaveTempErrorLog(void) +{ + if (LOS_SemPend(g_tempErrInfoSem, LOS_WAIT_FOREVER) != LOS_OK) { + BBOX_PRINT_ERR("Request g_tempErrInfoSem failed!\n"); + return; + } + if (g_tempErrInfo == NULL) { + BBOX_PRINT_ERR("g_tempErrInfo is NULL!\n"); + (void)LOS_SemPost(g_tempErrInfoSem); + return; + } + if (strlen(g_tempErrInfo->event) != 0) { + SaveLogWithoutReset(g_tempErrInfo); + } + (void)LOS_SemPost(g_tempErrInfoSem); +} + +static void SaveLogWithReset(struct ErrorInfo *info) +{ + int ret; + BBoxOps *ops = NULL; + + if (info == NULL) { + BBOX_PRINT_ERR("info is NULL!\n"); + return; + } + + if (!FindModuleOps(info, &ops)) { + return; + } + InvokeModuleOps(info, ops); + ret = SysReboot(0, 0, RB_AUTOBOOT); + BBOX_PRINT_INFO("SysReboot, ret: %d\n", ret); +} + +static void SaveTempErrorInfo(const char event[EVENT_MAX_LEN], + const char module[MODULE_MAX_LEN], + const char errorDesc[ERROR_DESC_MAX_LEN]) +{ + if (event == NULL || module == NULL || errorDesc == NULL) { + BBOX_PRINT_ERR("event: %p, module: %p, errorDesc: %p!\n", event, module, errorDesc); + return; + } + if (LOS_SemPend(g_tempErrInfoSem, LOS_NO_WAIT) != LOS_OK) { + BBOX_PRINT_ERR("Request g_tempErrInfoSem failed!\n"); + return; + } + FormatErrorInfo(g_tempErrInfo, event, module, errorDesc); + (void)LOS_SemPost(g_tempErrInfoSem); +} + +static int SaveErrorLog(UINTPTR uwParam1, UINTPTR uwParam2, UINTPTR uwParam3, UINTPTR uwParam4) +{ + const char *logDir = (const char *)uwParam1; + (void)uwParam2; + (void)uwParam3; + (void)uwParam4; + +#ifdef LOSCFG_FS_VFS + WaitForLogPart(); +#endif + SaveLastLog(logDir); + while (1) { + if (LOS_SemPend(g_tempErrLogSaveSem, LOS_WAIT_FOREVER) != LOS_OK) { + BBOX_PRINT_ERR("Request g_tempErrLogSaveSem failed!\n"); + continue; + } + SaveTempErrorLog(); + } + return 0; +} + +#ifdef LOSCFG_BLACKBOX_DEBUG +static void PrintModuleOps(void) +{ + struct BBoxOps *ops = NULL; + + BBOX_PRINT_INFO("The following modules have been registered!\n"); + LOS_DL_LIST_FOR_EACH_ENTRY(ops, &g_opsList, BBoxOps, opsList) { + if (ops == NULL) { + continue; + } + BBOX_PRINT_INFO("module: %s, Dump: %p, Reset: %p, GetLastLogInfo: %p, SaveLastLog: %p\n", + ops->ops.module, ops->ops.Dump, ops->ops.Reset, ops->ops.GetLastLogInfo, ops->ops.SaveLastLog); + } +} +#endif + +int BBoxRegisterModuleOps(struct ModuleOps *ops) +{ + BBoxOps *newOps = NULL; + BBoxOps *temp = NULL; + + if (!g_bboxInitSucc) { + BBOX_PRINT_ERR("BlackBox isn't initialized successfully!\n"); + return -1; + } + if (ops == NULL) { + BBOX_PRINT_ERR("ops is NULL!\n"); + return -1; + } + + newOps = LOS_MemAlloc(m_aucSysMem1, sizeof(*newOps)); + if (newOps == NULL) { + BBOX_PRINT_ERR("LOS_MemAlloc failed!\n"); + return -1; + } + (void)memset_s(newOps, sizeof(*newOps), 0, sizeof(*newOps)); + (void)memcpy_s(&newOps->ops, sizeof(newOps->ops), ops, sizeof(*ops)); + if (LOS_SemPend(g_opsListSem, LOS_WAIT_FOREVER) != LOS_OK) { + BBOX_PRINT_ERR("Request g_opsListSem failed!\n"); + (void)LOS_MemFree(m_aucSysMem1, newOps); + return -1; + } + if (LOS_ListEmpty(&g_opsList)) { + goto __out; + } + + LOS_DL_LIST_FOR_EACH_ENTRY(temp, &g_opsList, BBoxOps, opsList) { + if (temp == NULL) { + continue; + } + if (strcmp(temp->ops.module, ops->module) == 0) { + BBOX_PRINT_ERR("module [%s] has been registered!\n", ops->module); + (void)LOS_SemPost(g_opsListSem); + (void)LOS_MemFree(m_aucSysMem1, newOps); + return -1; + } + } + +__out: + LOS_ListTailInsert(&g_opsList, &newOps->opsList); + (void)LOS_SemPost(g_opsListSem); + BBOX_PRINT_INFO("module [%s] is registered successfully!\n", ops->module); +#ifdef LOSCFG_BLACKBOX_DEBUG + PrintModuleOps(); +#endif + + return 0; +} + +int BBoxNotifyError(const char event[EVENT_MAX_LEN], + const char module[MODULE_MAX_LEN], + const char errorDesc[ERROR_DESC_MAX_LEN], + int needSysReset) +{ + if (event == NULL || module == NULL || errorDesc == NULL) { + BBOX_PRINT_ERR("event: %p, module: %p, errorDesc: %p!\n", event, module, errorDesc); + return -1; + } + if (!g_bboxInitSucc) { + BBOX_PRINT_ERR("BlackBox isn't initialized successfully!\n"); + return -1; + } + + if (needSysReset == 0) { + SaveTempErrorInfo(event, module, errorDesc); + (void)LOS_SemPost(g_tempErrLogSaveSem); + } else { + struct ErrorInfo *info = LOS_MemAlloc(m_aucSysMem1, sizeof(struct ErrorInfo)); + if (info == NULL) { + BBOX_PRINT_ERR("LOS_MemAlloc failed!\n"); + return -1; + } + FormatErrorInfo(info, event, module, errorDesc); + SaveLogWithReset(info); + (void)LOS_MemFree(m_aucSysMem1, info); + } + + return 0; +} + +int OsBBoxDriverInit(void) +{ + UINT32 taskID; + TSK_INIT_PARAM_S taskParam; + + if (LOS_BinarySemCreate(1, &g_opsListSem) != LOS_OK) { + BBOX_PRINT_ERR("Create g_opsListSem failed!\n"); + return LOS_NOK; + } + if (LOS_BinarySemCreate(1, &g_tempErrInfoSem) != LOS_OK) { + BBOX_PRINT_ERR("Create g_tempErrInfoSem failed!\n"); + goto __err; + } + if (LOS_BinarySemCreate(0, &g_tempErrLogSaveSem) != LOS_OK) { + BBOX_PRINT_ERR("Create g_tempErrLogSaveSem failed!\n"); + goto __err; + } + LOS_ListInit(&g_opsList); + g_tempErrInfo = LOS_MemAlloc(m_aucSysMem1, sizeof(*g_tempErrInfo)); + if (g_tempErrInfo == NULL) { + BBOX_PRINT_ERR("LOS_MemAlloc failed!\n"); + goto __err; + } + (void)memset_s(g_tempErrInfo, sizeof(*g_tempErrInfo), 0, sizeof(*g_tempErrInfo)); + (void)memset_s(&taskParam, sizeof(taskParam), 0, sizeof(taskParam)); + taskParam.auwArgs[0] = (UINTPTR)LOSCFG_LOG_ROOT_PATH; + taskParam.pfnTaskEntry = (TSK_ENTRY_FUNC)SaveErrorLog; + taskParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; + taskParam.pcName = "SaveErrorLog"; + taskParam.usTaskPrio = LOSCFG_BASE_CORE_TSK_DEFAULT_PRIO; + taskParam.uwResved = LOS_TASK_STATUS_DETACHED; +#ifdef LOSCFG_KERNEL_SMP + taskParam.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); +#endif + (void)LOS_TaskCreate(&taskID, &taskParam); + g_bboxInitSucc = TRUE; + return LOS_OK; + +__err: + if (g_opsListSem != 0) { + (void)LOS_SemDelete(g_opsListSem); + } + if (g_tempErrInfoSem != 0) { + (void)LOS_SemDelete(g_tempErrInfoSem); + } + if (g_tempErrLogSaveSem != 0) { + (void)LOS_SemDelete(g_tempErrLogSaveSem); + } + return LOS_NOK; +} +LOS_MODULE_INIT(OsBBoxDriverInit, LOS_INIT_LEVEL_ARCH); \ No newline at end of file diff --git a/kernel/common/blackbox/los_blackbox_detector.c b/kernel/common/blackbox/los_blackbox_detector.c new file mode 100644 index 00000000..ea14c9ea --- /dev/null +++ b/kernel/common/blackbox/los_blackbox_detector.c @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* ------------ includes ------------ */ +#include "los_blackbox_detector.h" +#include "los_blackbox_common.h" +#ifdef LOSCFG_LIB_LIBC +#include "stdlib.h" +#include "unistd.h" +#endif + +/* ------------ local macroes ------------ */ +/* ------------ local prototypes ------------ */ +/* ------------ local function declarations ------------ */ +/* ------------ global function declarations ------------ */ +/* ------------ local variables ------------ */ +/* ------------ function definitions ------------ */ +int UploadEventByFile(const char *filePath) +{ + if (filePath == NULL) { + BBOX_PRINT_ERR("filePath is NULL\n"); + return -1; + } + + return 0; +} + +int UploadEventByStream(const char *buf, size_t bufSize) +{ + if (buf == NULL || bufSize == 0) { + BBOX_PRINT_ERR("buf: %p, bufSize: %u\n", buf, (UINT32)bufSize); + return -1; + } + + return 0; +} \ No newline at end of file diff --git a/kernel/common/blackbox/los_blackbox_detector.h b/kernel/common/blackbox/los_blackbox_detector.h new file mode 100644 index 00000000..f6714aad --- /dev/null +++ b/kernel/common/blackbox/los_blackbox_detector.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef LOS_BLACKBOX_DETECTOR_H +#define LOS_BLACKBOX_DETECTOR_H + +#ifdef __cplusplus +#if __cplusplus +extern "C" { +#endif /* __cplusplus */ +#endif /* __cplusplus */ + +#include "los_typedef.h" + +int UploadEventByFile(const char *filePath); +int UploadEventByStream(const char *buf, size_t bufSize); + +#ifdef __cplusplus +#if __cplusplus +} +#endif /* __cplusplus */ +#endif /* __cplusplus */ + +#endif \ No newline at end of file diff --git a/kernel/common/blackbox/los_blackbox_system_adapter.c b/kernel/common/blackbox/los_blackbox_system_adapter.c new file mode 100644 index 00000000..6e5b87d6 --- /dev/null +++ b/kernel/common/blackbox/los_blackbox_system_adapter.c @@ -0,0 +1,265 @@ +/* + * Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* ------------ includes ------------ */ +#include "los_blackbox_system_adapter.h" +#include "los_blackbox_common.h" +#include "los_blackbox_detector.h" +#ifdef LOSCFG_LIB_LIBC +#include "stdlib.h" +#include "unistd.h" +#endif +#include "los_base.h" +#include "los_config.h" +#ifdef LOSCFG_SAVE_EXCINFO +#include "los_excinfo_pri.h" +#endif +#include "los_hw.h" +#include "los_init.h" +#include "los_memory.h" +#include "los_vm_phys.h" +#include "los_vm_common.h" +#include "securec.h" + +/* ------------ local macroes ------------ */ +#define MEM_OVERLAP_COUNT 50 +#define LOG_FLAG "GOODLOG" +#define FAULT_LOG_SIZE 0x4000 /* 16KB */ + +/* ------------ local prototypes ------------ */ +struct FaultLogInfo { + char flag[8]; /* 8 is the length of the flag */ + int len; /* length of the fault log saved by the module excinfo */ + struct ErrorInfo info; +}; + +/* ------------ local function declarations ------------ */ +/* ------------ global function declarations ------------ */ +/* ------------ local variables ------------ */ +static char *g_logBuffer = NULL; + +/* ------------ function definitions ------------ */ +static void SaveFaultLog(const char *filePath, const char *dataBuf, size_t bufSize, struct ErrorInfo *info) +{ + (void)SaveBasicErrorInfo(filePath, info); + (void)FullWriteFile(filePath, dataBuf, bufSize, 1); +} + +#ifdef LOSCFG_SAVE_EXCINFO +static void WriteExcFile(UINT32 startAddr, UINT32 space, UINT32 rwFlag, char *buf) +{ + (void)startAddr; + (void)space; + (void)rwFlag; + (void)buf; +} +#endif + +static void RegisterExcInfoHook(void) +{ + if (g_logBuffer != NULL) { +#ifdef LOSCFG_SAVE_EXCINFO + LOS_ExcInfoRegHook(0, FAULT_LOG_SIZE - sizeof(struct FaultLogInfo), + g_logBuffer + sizeof(struct FaultLogInfo), WriteExcFile); +#endif + } else { + BBOX_PRINT_ERR("Alloc mem failed!\n"); + } +} + +static int AllocLogBuffer(void) +{ + int i = 0; + size_t nPages = ROUNDUP(FAULT_LOG_SIZE, PAGE_SIZE) >> PAGE_SHIFT; + void *tempBuffer[MEM_OVERLAP_COUNT] = { NULL }; + + for (i = 0; i < MEM_OVERLAP_COUNT; i++) { + tempBuffer[i] = LOS_PhysPagesAllocContiguous(nPages); + } + for (i = 0; i < (MEM_OVERLAP_COUNT - 1); i++) { + LOS_PhysPagesFreeContiguous(tempBuffer[i], nPages); + } + g_logBuffer = tempBuffer[i]; + BBOX_PRINT_INFO("g_logBuffer: %p for blackbox!\n", g_logBuffer); + + return (g_logBuffer != NULL) ? 0 : -1; +} + +static void Dump(const char *logDir, struct ErrorInfo *info) +{ + struct FaultLogInfo *pLogInfo = NULL; + + if (logDir == NULL || info == NULL) { + BBOX_PRINT_ERR("logDir: %p, info: %p!\n", logDir, info); + return; + } + if (g_logBuffer == NULL) { + BBOX_PRINT_ERR("g_logBuffer is NULL, alloc physical pages failed!\n"); + return; + } + + if (strcmp(info->event, EVENT_PANIC) == 0) { + pLogInfo = (struct FaultLogInfo *)g_logBuffer; + (void)memset_s(pLogInfo, sizeof(*pLogInfo), 0, sizeof(*pLogInfo)); +#ifdef LOSCFG_SAVE_EXCINFO + pLogInfo->len = GetExcInfoIndex(); +#else + pLogInfo->len = 0; +#endif + (void)memcpy_s(&pLogInfo->flag, sizeof(pLogInfo->flag), LOG_FLAG, strlen(LOG_FLAG)); + (void)memcpy_s(&pLogInfo->info, sizeof(pLogInfo->info), info, sizeof(*info)); + DCacheFlushRange((UINTPTR)g_logBuffer, (UINTPTR)(g_logBuffer + FAULT_LOG_SIZE)); + } else { +#ifdef LOSCFG_SAVE_EXCINFO + SaveFaultLog(USER_FAULT_LOG_PATH, g_logBuffer + sizeof(struct FaultLogInfo), + Min(FAULT_LOG_SIZE - sizeof(struct FaultLogInfo), GetExcInfoIndex()), info); +#else + SaveFaultLog(USER_FAULT_LOG_PATH, g_logBuffer + sizeof(struct FaultLogInfo), 0, info); +#endif + } +} + +static void Reset(struct ErrorInfo *info) +{ + if (info == NULL) { + BBOX_PRINT_ERR("info is NULL!\n"); + return; + } + + if (strcmp(info->event, EVENT_PANIC) != 0) { + BBOX_PRINT_INFO("[%s] starts uploading event [%s]\n", info->module, info->event); + (void)UploadEventByFile(USER_FAULT_LOG_PATH); + BBOX_PRINT_INFO("[%s] ends uploading event [%s]\n", info->module, info->event); + } +} + +static int GetLastLogInfo(struct ErrorInfo *info) +{ + struct FaultLogInfo *pLogInfo = NULL; + + if (info == NULL) { + BBOX_PRINT_ERR("info is NULL!\n"); + return -1; + } + if (g_logBuffer == NULL) { + BBOX_PRINT_ERR("g_logBuffer is NULL, alloc physical pages failed!\n"); + return -1; + } + + pLogInfo = (struct FaultLogInfo *)g_logBuffer; + if (memcmp(pLogInfo->flag, LOG_FLAG, strlen(LOG_FLAG)) == 0) { + (void)memcpy_s(info, sizeof(*info), &pLogInfo->info, sizeof(pLogInfo->info)); + return 0; + } + + return -1; +} + +static int SaveLastLog(const char *logDir, struct ErrorInfo *info) +{ +#ifdef LOSCFG_FS_VFS + struct FaultLogInfo *pLogInfo = NULL; + + if (logDir == NULL || info == NULL) { + BBOX_PRINT_ERR("logDir: %p, info: %p!\n", logDir, info); + return -1; + } + if (g_logBuffer == NULL) { + BBOX_PRINT_ERR("g_logBuffer is NULL, alloc physical pages failed!\n"); + return -1; + } + + pLogInfo = (struct FaultLogInfo *)g_logBuffer; + if (memcmp(pLogInfo->flag, LOG_FLAG, strlen(LOG_FLAG)) == 0) { + SaveFaultLog(KERNEL_FAULT_LOG_PATH, g_logBuffer + sizeof(*pLogInfo), + Min(FAULT_LOG_SIZE - sizeof(*pLogInfo), pLogInfo->len), info); + } + (void)memset_s(g_logBuffer, FAULT_LOG_SIZE, 0, FAULT_LOG_SIZE); + BBOX_PRINT_INFO("[%s] starts uploading event [%s]\n", info->module, info->event); + (void)UploadEventByFile(KERNEL_FAULT_LOG_PATH); + BBOX_PRINT_INFO("[%s] ends uploading event [%s]\n", info->module, info->event); + return 0; +#else + (VOID)logDir; + (VOID)info; + BBOX_PRINT_ERR("LOSCFG_FS_VFS isn't defined!\n"); + return -1; +#endif +} + +#ifdef LOSCFG_BLACKBOX_TEST +static void BBoxTest(void) +{ + struct ModuleOps ops = { + .module = "MODULE_TEST", + .Dump = NULL, + .Reset = NULL, + .GetLastLogInfo = NULL, + .SaveLastLog = NULL, + }; + + if (BBoxRegisterModuleOps(&ops) != 0) { + BBOX_PRINT_ERR("BBoxRegisterModuleOps failed!\n"); + return; + } + BBoxNotifyError("EVENT_TEST1", "MODULE_TEST", "Test BBoxNotifyError111", 0); +} +#endif + +int OsBBoxSystemAdapterInit(void) +{ + struct ModuleOps ops = { + .module = MODULE_SYSTEM, + .Dump = Dump, + .Reset = Reset, + .GetLastLogInfo = GetLastLogInfo, + .SaveLastLog = SaveLastLog, + }; + + /* allocate buffer for kmsg */ + if (AllocLogBuffer() == 0) { + RegisterExcInfoHook(); + if (BBoxRegisterModuleOps(&ops) != 0) { + BBOX_PRINT_ERR("BBoxRegisterModuleOps failed!\n"); + LOS_PhysPagesFreeContiguous(g_logBuffer, ROUNDUP(FAULT_LOG_SIZE, PAGE_SIZE) >> PAGE_SHIFT); + g_logBuffer = NULL; + return LOS_NOK; + } + } else { + BBOX_PRINT_ERR("AllocLogBuffer failed!\n"); + } + +#ifdef LOSCFG_BLACKBOX_TEST + BBoxTest(); +#endif + + return LOS_OK; +} +LOS_MODULE_INIT(OsBBoxSystemAdapterInit, LOS_INIT_LEVEL_PLATFORM); \ No newline at end of file diff --git a/kernel/common/blackbox/los_blackbox_system_adapter.h b/kernel/common/blackbox/los_blackbox_system_adapter.h new file mode 100644 index 00000000..eb61bf83 --- /dev/null +++ b/kernel/common/blackbox/los_blackbox_system_adapter.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef LOS_BLACKBOX_SYSTEM_ADAPTER_H +#define LOS_BLACKBOX_SYSTEM_ADAPTER_H + +#ifdef __cplusplus +#if __cplusplus +extern "C" { +#endif /* __cplusplus */ +#endif /* __cplusplus */ + +#include "los_blackbox.h" +#include "los_blackbox_common.h" + +int OsBBoxSystemAdapterInit(void); + +#ifdef __cplusplus +#if __cplusplus +} +#endif /* __cplusplus */ +#endif /* __cplusplus */ + +#endif \ No newline at end of file diff --git a/kernel/common/los_excinfo.c b/kernel/common/los_excinfo.c index b18ee23b..7bf01236 100644 --- a/kernel/common/los_excinfo.c +++ b/kernel/common/los_excinfo.c @@ -34,6 +34,10 @@ #ifdef LOSCFG_SHELL #include "shcmd.h" #endif +#ifdef LOSCFG_FS_VFS +#include "fs/fs.h" +#include "fs/fs_operation.h" +#endif #ifdef LOSCFG_SAVE_EXCINFO STATIC log_read_write_fn g_excInfoRW = NULL; /* the hook of read-writing exception information */ diff --git a/tools/build/mk/liteos_tables_ldflags.mk b/tools/build/mk/liteos_tables_ldflags.mk index dd670571..db8b93c9 100644 --- a/tools/build/mk/liteos_tables_ldflags.mk +++ b/tools/build/mk/liteos_tables_ldflags.mk @@ -135,7 +135,9 @@ LITEOS_TABLES_KERNEL_INIT_LDFLAGS := \ -uOsCpupGuardCreator \ -uOsMpInit \ -uOsResourceFreeTaskCreate \ - -uOsSystemInit + -uOsSystemInit \ + -uOsBBoxDriverInit \ + -uOsBBoxSystemAdapterInit LITEOS_TABLES_DRIVER_LDFLAGS := \ -ui2c_init \ diff --git a/tools/build/mk/los_config.mk b/tools/build/mk/los_config.mk index cbefe9c7..902f770a 100644 --- a/tools/build/mk/los_config.mk +++ b/tools/build/mk/los_config.mk @@ -443,6 +443,11 @@ ifeq ($(LOSCFG_BASE_CORE_HILOG), y) LITEOS_HILOG_INCLUDE += -I $(LITEOSTOPDIR)/../../base/hiviewdfx/hilog_lite/interfaces/native/kits/hilog LITEOS_CMACRO += -DLOSCFG_BASE_CORE_HILOG endif +ifeq ($(LOSCFG_BLACKBOX), y) + LITEOS_BASELIB += -lblackbox + LIB_SUBDIRS += $(LITEOSTOPDIR)/kernel/common/blackbox + LITEOS_BLACKBOX_INCLUDE += -I $(LITEOSTOPDIR)/kernel/common/blackbox +endif ############################## Dfx Option End ####################################### ############################# Tools && Debug Option Begin ############################## @@ -639,7 +644,8 @@ LITEOS_DRIVERS_INCLUDE := $(LITEOS_CELLWISE_INCLUDE) $(LITEOS_GPIO_INCLUDE $(LITEOS_DRIVERS_HDF_INCLUDE) $(LITEOS_TZDRIVER_INCLUDE) \ $(LITEOS_HIEVENT_INCLUDE) $(LITEOS_DEV_MEM_INCLUDE) \ $(LITEOS_DEV_QUICKSTART_INCLUDE) -LITEOS_DFX_INCLUDE := $(LITEOS_HILOG_INCLUDE) +LITEOS_DFX_INCLUDE := $(LITEOS_HILOG_INCLUDE) \ + $(LITEOS_BLACKBOX_INCLUDE) LITEOS_SECURITY_INCLUDE := $(LITEOS_SECURITY_CAP_INC) $(LITEOS_SECURITY_VID_INC) LOSCFG_TOOLS_DEBUG_INCLUDE := $(LITEOS_SHELL_INCLUDE) $(LITEOS_UART_INCLUDE) \ From 09c491ca1fd6d3110eafb0d07e45b25bdc3bd5d0 Mon Sep 17 00:00:00 2001 From: Guangyao Ma Date: Wed, 14 Jul 2021 14:40:38 +0800 Subject: [PATCH 28/43] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E7=AA=97=E5=8F=A3=E5=AE=BD=E5=BA=A6=E5=88=B0400?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 由于内核暂不支持tty,窗口默认宽度写死的为80。在流水线中,往往有时候需要更宽的 窗口宽度。在tty支持动态获取和设置大小之前,先调整大小为400。 re #I40LQX Signed-off-by: Guangyao Ma Change-Id: Ic21a8b7098f47b7d608762678eebb7b8ecb67ce4 --- kernel/common/console.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/common/console.c b/kernel/common/console.c index 353e98c3..4e09335f 100644 --- a/kernel/common/console.c +++ b/kernel/common/console.c @@ -842,7 +842,7 @@ STATIC INT32 ConsoleSetSW(CONSOLE_CB *consoleCB, unsigned long arg) return LOS_OK; } -#define DEFAULT_WINDOW_SIZE_COL 80 +#define DEFAULT_WINDOW_SIZE_COL 400 #define DEFAULT_WINDOW_SIZE_ROW 24 STATIC INT32 ConsoleGetWinSize(unsigned long arg) { From cb17fa50ed28e6e8f59b7d68ede13c759b983311 Mon Sep 17 00:00:00 2001 From: qidechun Date: Wed, 14 Jul 2021 10:27:02 +0800 Subject: [PATCH 29/43] =?UTF-8?q?feat:=20=E7=BB=99=E5=BC=80=E5=8F=91?= =?UTF-8?q?=E8=80=85=E6=8F=90=E4=BE=9B=E7=B3=BB=E7=BB=9F=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=AF=BC=E5=87=BAHidumper=E5=B7=A5=E5=85=B7=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 给开发者提供系统信息DUMP机制,帮助开发者观察系统功能状态,发现潜在问题。 Close #I3NN7D Signed-off-by: qidechun --- Kconfig | 2 + kernel/common/hidumper/Kconfig | 5 + kernel/common/hidumper/Makefile | 13 + kernel/common/hidumper/los_hidumper.c | 381 ++++++++++++++++++++++++ kernel/common/hidumper/los_hidumper.h | 88 ++++++ tools/build/mk/liteos_tables_ldflags.mk | 3 +- tools/build/mk/los_config.mk | 8 +- 7 files changed, 498 insertions(+), 2 deletions(-) create mode 100644 kernel/common/hidumper/Kconfig create mode 100644 kernel/common/hidumper/Makefile create mode 100644 kernel/common/hidumper/los_hidumper.c create mode 100644 kernel/common/hidumper/los_hidumper.h diff --git a/Kconfig b/Kconfig index d9f60a40..1b3a174e 100644 --- a/Kconfig +++ b/Kconfig @@ -63,6 +63,8 @@ source "kernel/common/Kconfig" source "kernel/common/patchfs/Kconfig" ######################### config options of blackbox ##################### source "kernel/common/blackbox/Kconfig" +######################### config options of hidumper ##################### +source "kernel/common/hidumper/Kconfig" config QUICK_START bool "Enable QUICK_START" diff --git a/kernel/common/hidumper/Kconfig b/kernel/common/hidumper/Kconfig new file mode 100644 index 00000000..b15d50a8 --- /dev/null +++ b/kernel/common/hidumper/Kconfig @@ -0,0 +1,5 @@ +config HIDUMPER + bool "Enable hidumper" + default n + help + Answer Y to enable LiteOS support hidumper diff --git a/kernel/common/hidumper/Makefile b/kernel/common/hidumper/Makefile new file mode 100644 index 00000000..230c1d8a --- /dev/null +++ b/kernel/common/hidumper/Makefile @@ -0,0 +1,13 @@ +include $(LITEOSTOPDIR)/config.mk + +MODULE_NAME := $(notdir $(shell pwd)) + +LOCAL_SRCS := $(wildcard *.c) + +LOCAL_INCLUDE := \ + -I $(LITEOSTOPDIR)/kernel/common \ + -I $(LITEOSTOPDIR)/kernel/common/hidumper \ + +LOCAL_FLAGS := $(LOCAL_INCLUDE) $(LITEOS_GCOV_OPTS) + +include $(MODULE) diff --git a/kernel/common/hidumper/los_hidumper.c b/kernel/common/hidumper/los_hidumper.c new file mode 100644 index 00000000..d04647db --- /dev/null +++ b/kernel/common/hidumper/los_hidumper.c @@ -0,0 +1,381 @@ +/* + * Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* ------------ includes ------------ */ +#include "los_hidumper.h" +#ifdef LOSCFG_BLACKBOX +#include "los_blackbox.h" +#endif +#ifdef LOSCFG_CPUP_INCLUDE_IRQ +#include "los_cpup_pri.h" +#endif +#include "los_hwi_pri.h" +#include "los_init.h" +#include "los_mp.h" +#include "los_mux.h" +#include "los_printf.h" +#include "los_process_pri.h" +#include "los_task_pri.h" +#include "los_vm_dump.h" +#include "los_vm_lock.h" +#include "los_vm_map.h" +#ifdef LOSCFG_FS_VFS +#include "fs/file.h" +#endif +#include "fs/driver.h" +#include "securec.h" +#ifdef LOSCFG_LIB_LIBC +#include "unistd.h" +#endif +#include "user_copy.h" + +/* ------------ local macroes ------------ */ +#define CPUP_TYPE_COUNT 3 +#define HIDUMPER_DEVICE "/dev/hidumper" +#define HIDUMPER_DEVICE_MODE 0666 +#define KERNEL_FAULT_ADDR 0x1 +#define KERNEL_FAULT_VALUE 0x2 +#define READ_BUF_SIZE 128 +#define SYS_INFO_HEADER "************ sys info ***********" +#define CPU_USAGE_HEADER "************ cpu usage ***********" +#define MEM_USAGE_HEADER "************ mem usage ***********" +#define PAGE_USAGE_HEADER "************ physical page usage ***********" +#define TASK_INFO_HEADER "************ task info ***********" +#ifndef ARRAY_SIZE +#define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0])) +#endif +#define REPLACE_INTERFACE(dst, src, type, func) {\ + if (((type *)src)->func != NULL) {\ + ((type *)dst)->func = ((type *)src)->func;\ + } else {\ + PRINT_ERR("%s->%s is NULL!\n", #src, #func);\ + }\ +} +#define INVOKE_INTERFACE(adapter, type, func) {\ + if (((type *)adapter)->func != NULL) {\ + ((type *)adapter)->func();\ + } else {\ + PRINT_ERR("%s->%s is NULL!\n", #adapter, #func);\ + }\ +} + +/* ------------ local prototypes ------------ */ +/* ------------ local function declarations ------------ */ +STATIC INT32 HiDumperOpen(struct file *filep); +STATIC INT32 HiDumperClose(struct file *filep); +STATIC INT32 HiDumperIoctl(struct file *filep, INT32 cmd, unsigned long arg); + +/* ------------ global function declarations ------------ */ +#ifdef LOSCFG_SHELL +extern VOID OsShellCmdSystemInfoGet(VOID); +extern UINT32 OsShellCmdFree(INT32 argc, const CHAR *argv[]); +extern UINT32 OsShellCmdUname(INT32 argc, const CHAR *argv[]); +extern UINT32 OsShellCmdDumpPmm(VOID); +#endif + +/* ------------ local variables ------------ */ +static struct HiDumperAdapter g_adapter; +STATIC struct file_operations_vfs g_hidumperDevOps = { + HiDumperOpen, /* open */ + HiDumperClose, /* close */ + NULL, /* read */ + NULL, /* write */ + NULL, /* seek */ + HiDumperIoctl, /* ioctl */ + NULL, /* mmap */ +#ifndef CONFIG_DISABLE_POLL + NULL, /* poll */ +#endif + NULL, /* unlink */ +}; + +/* ------------ function definitions ------------ */ +STATIC INT32 HiDumperOpen(struct file *filep) +{ + (VOID)filep; + return 0; +} + +STATIC INT32 HiDumperClose(struct file *filep) +{ + (VOID)filep; + return 0; +} + +static void DumpSysInfo(void) +{ + PRINTK("\n%s\n", SYS_INFO_HEADER); +#ifdef LOSCFG_SHELL + const char *argv[1] = {"-a"}; + (VOID)OsShellCmdUname(ARRAY_SIZE(argv), &argv[0]); + (VOID)OsShellCmdSystemInfoGet(); +#else + PRINTK("\nUnsupported!\n"); +#endif +} + +#ifdef LOSCFG_KERNEL_CPUP +static void DoDumpCpuUsageUnsafe(CPUP_INFO_S *processCpupAll, + CPUP_INFO_S *processCpup10s, + CPUP_INFO_S *processCpup1s) +{ + UINT32 pid; + + PRINTK("%-32s PID CPUUSE CPUUSE10S CPUUSE1S\n", "PName"); + for (pid = 0; pid < g_processMaxNum; pid++) { + LosProcessCB *processCB = g_processCBArray + pid; + if (OsProcessIsUnused(processCB)) { + continue; + } + PRINTK("%-32s %u %5u.%1u%8u.%1u%7u.%-1u\n", + processCB->processName, processCB->processID, + processCpupAll[pid].usage / LOS_CPUP_PRECISION_MULT, + processCpupAll[pid].usage % LOS_CPUP_PRECISION_MULT, + processCpup10s[pid].usage / LOS_CPUP_PRECISION_MULT, + processCpup10s[pid].usage % LOS_CPUP_PRECISION_MULT, + processCpup1s[pid].usage / LOS_CPUP_PRECISION_MULT, + processCpup1s[pid].usage % LOS_CPUP_PRECISION_MULT); + } +} +#endif + +static void DumpCpuUsageUnsafe(void) +{ + PRINTK("\n%s\n", CPU_USAGE_HEADER); +#ifdef LOSCFG_KERNEL_CPUP + UINT32 size; + CPUP_INFO_S *processCpup = NULL; + CPUP_INFO_S *processCpupAll = NULL; + CPUP_INFO_S *processCpup10s = NULL; + CPUP_INFO_S *processCpup1s = NULL; + + size = sizeof(*processCpup) * g_processMaxNum * CPUP_TYPE_COUNT; + processCpup = LOS_MemAlloc(m_aucSysMem1, size); + if (processCpup == NULL) { + PRINT_ERR("func: %s, LOS_MemAlloc failed, Line: %d\n", __func__, __LINE__); + return; + } + processCpupAll = processCpup; + processCpup10s = processCpupAll + g_processMaxNum; + processCpup1s = processCpup10s + g_processMaxNum; + (VOID)memset_s(processCpup, size, 0, size); + LOS_GetAllProcessCpuUsage(CPUP_ALL_TIME, processCpupAll, g_processMaxNum * sizeof(CPUP_INFO_S)); + LOS_GetAllProcessCpuUsage(CPUP_LAST_TEN_SECONDS, processCpup10s, g_processMaxNum * sizeof(CPUP_INFO_S)); + LOS_GetAllProcessCpuUsage(CPUP_LAST_ONE_SECONDS, processCpup1s, g_processMaxNum * sizeof(CPUP_INFO_S)); + DoDumpCpuUsageUnsafe(processCpupAll, processCpup10s, processCpup1s); + (VOID)LOS_MemFree(m_aucSysMem1, processCpup); +#else + PRINTK("\nUnsupported!\n"); +#endif +} + +static void DumpMemUsage(void) +{ + PRINTK("\n%s\n", MEM_USAGE_HEADER); +#ifdef LOSCFG_SHELL + PRINTK("Unit: KB\n"); + const char *argv[1] = {"-k"}; + (VOID)OsShellCmdFree(ARRAY_SIZE(argv), &argv[0]); + PRINTK("%s\n", PAGE_USAGE_HEADER); + (VOID)OsShellCmdDumpPmm(); +#else + PRINTK("\nUnsupported!\n"); +#endif +} + +static void DumpTaskInfo(void) +{ + PRINTK("\n%s\n", TASK_INFO_HEADER); +#ifdef LOSCFG_SHELL + (VOID)OsShellCmdTskInfoGet(OS_ALL_TASK_MASK, NULL, OS_PROCESS_INFO_ALL); +#else + PRINTK("\nUnsupported!\n"); +#endif +} + +#ifdef LOSCFG_BLACKBOX +static void PrintFileData(INT32 fd) +{ +#ifdef LOSCFG_FS_VFS + CHAR buf[READ_BUF_SIZE]; + + if (fd < 0) { + PRINT_ERR("fd: %d!\n", fd); + return; + } + + (void)memset_s(buf, sizeof(buf), 0, sizeof(buf)); + while (read(fd, buf, sizeof(buf) - 1) > 0) { + PRINTK("%s", buf); + (void)memset_s(buf, sizeof(buf), 0, sizeof(buf)); + } +#else + (VOID)fd; + PRINT_ERR("LOSCFG_FS_VFS isn't defined!\n"); +#endif +} + +static void PrintFile(const char *filePath, const char *pHeader) +{ +#ifdef LOSCFG_FS_VFS + int fd; + + if (filePath == NULL || pHeader == NULL) { + PRINT_ERR("filePath: %p, pHeader: %p\n", filePath, pHeader); + return; + } + + fd = open(filePath, O_RDONLY); + if (fd >= 0) { + PRINTK("\n%s\n", pHeader); + PrintFileData(fd); + (void)close(fd); + } else { + PRINT_ERR("Open [%s] failed or there's no fault log!\n", filePath); + } +#else + (VOID)filePath; + (VOID)pHeader; + PRINT_ERR("LOSCFG_FS_VFS isn't defined!\n"); +#endif +} +#endif + +static void DumpFaultLog(void) +{ +#ifdef LOSCFG_BLACKBOX + PrintFile(KERNEL_FAULT_LOG_PATH, "************kernel fault info************"); + PrintFile(USER_FAULT_LOG_PATH, "************user fault info************"); +#endif +} + +static void DumpMemData(struct MemDumpParam *param) +{ + PRINTK("\nDumpType: %d\n", param->type); + PRINTK("Unsupported now!\n"); +} + +static void InjectKernelCrash(void) +{ +#ifdef LOSCFG_DEBUG_VERSION + *((INT32 *)KERNEL_FAULT_ADDR) = KERNEL_FAULT_VALUE; +#else + PRINTK("\nUnsupported!\n"); +#endif +} + +static INT32 HiDumperIoctl(struct file *filep, INT32 cmd, unsigned long arg) +{ + INT32 ret = 0; + + switch (cmd) { + case HIDUMPER_DUMP_ALL: + INVOKE_INTERFACE(&g_adapter, struct HiDumperAdapter, DumpSysInfo); + INVOKE_INTERFACE(&g_adapter, struct HiDumperAdapter, DumpCpuUsage); + INVOKE_INTERFACE(&g_adapter, struct HiDumperAdapter, DumpMemUsage); + INVOKE_INTERFACE(&g_adapter, struct HiDumperAdapter, DumpTaskInfo); + break; + case HIDUMPER_CPU_USAGE: + INVOKE_INTERFACE(&g_adapter, struct HiDumperAdapter, DumpCpuUsage); + break; + case HIDUMPER_MEM_USAGE: + INVOKE_INTERFACE(&g_adapter, struct HiDumperAdapter, DumpMemUsage); + break; + case HIDUMPER_TASK_INFO: + INVOKE_INTERFACE(&g_adapter, struct HiDumperAdapter, DumpTaskInfo); + break; + case HIDUMPER_INJECT_KERNEL_CRASH: + INVOKE_INTERFACE(&g_adapter, struct HiDumperAdapter, InjectKernelCrash); + break; + case HIDUMPER_DUMP_FAULT_LOG: + INVOKE_INTERFACE(&g_adapter, struct HiDumperAdapter, DumpFaultLog); + break; + case HIDUMPER_MEM_DATA: + if (g_adapter.DumpMemData != NULL) { + g_adapter.DumpMemData((struct MemDumpParam *)arg); + } + break; + default: + ret = EPERM; + PRINTK("Invalid CMD: 0x%x\n", (UINT32)cmd); + break; + } + + return ret; +} + +static void RegisterCommonAdapter(void) +{ + struct HiDumperAdapter adapter; + + adapter.DumpSysInfo = DumpSysInfo; + adapter.DumpCpuUsage = DumpCpuUsageUnsafe; + adapter.DumpMemUsage = DumpMemUsage; + adapter.DumpTaskInfo = DumpTaskInfo; + adapter.DumpFaultLog = DumpFaultLog; + adapter.DumpMemData = DumpMemData; + adapter.InjectKernelCrash = InjectKernelCrash; + HiDumperRegisterAdapter(&adapter); +} + +int HiDumperRegisterAdapter(struct HiDumperAdapter *pAdapter) +{ + if (pAdapter == NULL) { + PRINT_ERR("pAdapter: %p\n", pAdapter); + return -1; + } + + REPLACE_INTERFACE(&g_adapter, pAdapter, struct HiDumperAdapter, DumpSysInfo); + REPLACE_INTERFACE(&g_adapter, pAdapter, struct HiDumperAdapter, DumpCpuUsage); + REPLACE_INTERFACE(&g_adapter, pAdapter, struct HiDumperAdapter, DumpMemUsage); + REPLACE_INTERFACE(&g_adapter, pAdapter, struct HiDumperAdapter, DumpTaskInfo); + REPLACE_INTERFACE(&g_adapter, pAdapter, struct HiDumperAdapter, DumpFaultLog); + REPLACE_INTERFACE(&g_adapter, pAdapter, struct HiDumperAdapter, DumpMemData); + REPLACE_INTERFACE(&g_adapter, pAdapter, struct HiDumperAdapter, InjectKernelCrash); + + return 0; +} + +int OsHiDumperDriverInit(void) +{ + INT32 ret; + +#ifdef LOSCFG_DEBUG_VERSION + RegisterCommonAdapter(); + ret = register_driver(HIDUMPER_DEVICE, &g_hidumperDevOps, HIDUMPER_DEVICE_MODE, NULL); + if (ret != 0) { + PRINT_ERR("Hidumper register driver failed!\n"); + return -1; + } +#endif + + return 0; +} +LOS_MODULE_INIT(OsHiDumperDriverInit, LOS_INIT_LEVEL_KMOD_EXTENDED); diff --git a/kernel/common/hidumper/los_hidumper.h b/kernel/common/hidumper/los_hidumper.h new file mode 100644 index 00000000..ab48f302 --- /dev/null +++ b/kernel/common/hidumper/los_hidumper.h @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef LOS_HIDUMPER_H +#define LOS_HIDUMPER_H + +#ifdef __cplusplus +#if __cplusplus +extern "C" { +#endif /* __cplusplus */ +#endif /* __cplusplus */ + +#ifndef __user +#define __user +#endif + +#define PATH_MAX_LEN 256 + +enum MemDumpType { + DUMP_TO_STDOUT, + DUMP_REGION_TO_STDOUT, + DUMP_TO_FILE, + DUMP_REGION_TO_FILE +}; + +struct MemDumpParam { + enum MemDumpType type; + unsigned long long start; + unsigned long long size; + char filePath[PATH_MAX_LEN]; +}; + +struct HiDumperAdapter { + void (*DumpSysInfo)(void); + void (*DumpCpuUsage)(void); + void (*DumpMemUsage)(void); + void (*DumpTaskInfo)(void); + void (*DumpFaultLog)(void); + void (*DumpMemData)(struct MemDumpParam *param); + void (*InjectKernelCrash)(void); +}; + +#define HIDUMPER_IOC_BASE 'd' +#define HIDUMPER_DUMP_ALL _IO(HIDUMPER_IOC_BASE, 1) +#define HIDUMPER_CPU_USAGE _IO(HIDUMPER_IOC_BASE, 2) +#define HIDUMPER_MEM_USAGE _IO(HIDUMPER_IOC_BASE, 3) +#define HIDUMPER_TASK_INFO _IO(HIDUMPER_IOC_BASE, 4) +#define HIDUMPER_INJECT_KERNEL_CRASH _IO(HIDUMPER_IOC_BASE, 5) +#define HIDUMPER_DUMP_FAULT_LOG _IO(HIDUMPER_IOC_BASE, 6) +#define HIDUMPER_MEM_DATA _IOW(HIDUMPER_IOC_BASE, 7, struct MemDumpParam) + +int HiDumperRegisterAdapter(struct HiDumperAdapter *pAdapter); +int OsHiDumperDriverInit(void); + +#ifdef __cplusplus +#if __cplusplus +} +#endif /* __cplusplus */ +#endif /* __cplusplus */ + +#endif \ No newline at end of file diff --git a/tools/build/mk/liteos_tables_ldflags.mk b/tools/build/mk/liteos_tables_ldflags.mk index db8b93c9..eed3a4b9 100644 --- a/tools/build/mk/liteos_tables_ldflags.mk +++ b/tools/build/mk/liteos_tables_ldflags.mk @@ -137,7 +137,8 @@ LITEOS_TABLES_KERNEL_INIT_LDFLAGS := \ -uOsResourceFreeTaskCreate \ -uOsSystemInit \ -uOsBBoxDriverInit \ - -uOsBBoxSystemAdapterInit + -uOsBBoxSystemAdapterInit \ + -uOsHiDumperDriverInit LITEOS_TABLES_DRIVER_LDFLAGS := \ -ui2c_init \ diff --git a/tools/build/mk/los_config.mk b/tools/build/mk/los_config.mk index 902f770a..b332f723 100644 --- a/tools/build/mk/los_config.mk +++ b/tools/build/mk/los_config.mk @@ -448,6 +448,11 @@ ifeq ($(LOSCFG_BLACKBOX), y) LIB_SUBDIRS += $(LITEOSTOPDIR)/kernel/common/blackbox LITEOS_BLACKBOX_INCLUDE += -I $(LITEOSTOPDIR)/kernel/common/blackbox endif +ifeq ($(LOSCFG_HIDUMPER), y) + LITEOS_BASELIB += -lhidumper + LIB_SUBDIRS += $(LITEOSTOPDIR)/kernel/common/hidumper + LITEOS_HIDUMPER_INCLUDE += -I $(LITEOSTOPDIR)/kernel/common/hidumper +endif ############################## Dfx Option End ####################################### ############################# Tools && Debug Option Begin ############################## @@ -645,7 +650,8 @@ LITEOS_DRIVERS_INCLUDE := $(LITEOS_CELLWISE_INCLUDE) $(LITEOS_GPIO_INCLUDE $(LITEOS_HIEVENT_INCLUDE) $(LITEOS_DEV_MEM_INCLUDE) \ $(LITEOS_DEV_QUICKSTART_INCLUDE) LITEOS_DFX_INCLUDE := $(LITEOS_HILOG_INCLUDE) \ - $(LITEOS_BLACKBOX_INCLUDE) + $(LITEOS_BLACKBOX_INCLUDE) \ + $(LITEOS_HIDUMPER_INCLUDE) LITEOS_SECURITY_INCLUDE := $(LITEOS_SECURITY_CAP_INC) $(LITEOS_SECURITY_VID_INC) LOSCFG_TOOLS_DEBUG_INCLUDE := $(LITEOS_SHELL_INCLUDE) $(LITEOS_UART_INCLUDE) \ From 9547133e6488d65e8a2ebf365a3411b861d14718 Mon Sep 17 00:00:00 2001 From: Haryslee Date: Thu, 15 Jul 2021 19:19:56 +0800 Subject: [PATCH 30/43] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E5=A4=8Dllvm?= =?UTF-8?q?=E7=BC=96=E8=AF=91=E7=8E=AF=E5=A2=83=E4=B8=8B=E5=86=85=E6=A0=B8?= =?UTF-8?q?=E6=80=81=E5=86=85=E5=AD=98=E8=B0=83=E6=B5=8B=E8=B0=83=E7=94=A8?= =?UTF-8?q?=E6=A0=88=E4=BF=A1=E6=81=AF=E8=A7=A3=E6=9E=90=E6=9C=89=E8=AF=AF?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 背景:内核态内存调测调用栈信息在gcc编译环境下是准确的,但是llvm 编译环境下是错误的,分析知,gcc和llvm编译环境下fp和lr的对应关系 是有区别的。 修复:增加llvm编译环境下对lr解析的逻辑,并用编译宏控制。 close #I40TQS Signed-off-by: Haryslee Change-Id: If2a7b7a286d91e78dcff2bdeb136fda71e656a79 --- arch/arm/arm/src/los_exc.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/arm/arm/src/los_exc.c b/arch/arm/arm/src/los_exc.c index c90f591f..297a061b 100644 --- a/arch/arm/arm/src/los_exc.c +++ b/arch/arm/arm/src/los_exc.c @@ -721,7 +721,7 @@ VOID BackTraceSub(UINTPTR regFP) while (IsValidFP(backFP, stackStart, stackEnd, &kvaddr) == TRUE) { tmpFP = backFP; #ifdef LOSCFG_COMPILER_CLANG_LLVM - backFP = *(UINTPTR *)(UINTPTR)kvaddr; + backFP = *(UINTPTR *)(UINTPTR)kvaddr; if (IsValidFP(tmpFP + POINTER_SIZE, stackStart, stackEnd, &kvaddr) == FALSE) { PrintExcInfo("traceback backLR check failed, backLP: 0x%x\n", tmpFP + POINTER_SIZE); return; @@ -1215,7 +1215,11 @@ VOID LOS_RecordLR(UINTPTR *LR, UINT32 LRSize, UINT32 recordCount, UINT32 jumpCou framePtr = Get_Fp(); while ((framePtr > stackStart) && (framePtr < stackEnd) && IS_ALIGNED(framePtr, sizeof(CHAR *))) { tmpFramePtr = framePtr; +#ifdef LOSCFG_COMPILER_CLANG_LLVM + linkReg = *(UINTPTR *)(tmpFramePtr + sizeof(UINTPTR)); +#else linkReg = *(UINTPTR *)framePtr; +#endif if (index >= jumpCount) { LR[count++] = linkReg; if (count == recordCount) { @@ -1223,7 +1227,11 @@ VOID LOS_RecordLR(UINTPTR *LR, UINT32 LRSize, UINT32 recordCount, UINT32 jumpCou } } index++; +#ifdef LOSCFG_COMPILER_CLANG_LLVM + framePtr = *(UINTPTR *)framePtr; +#else framePtr = *(UINTPTR *)(tmpFramePtr - sizeof(UINTPTR)); +#endif } /* if linkReg is not enough,clean up the last of the effective LR as the end. */ From 7a6e4c815547be64c594ec0919998d0315925a5f Mon Sep 17 00:00:00 2001 From: JerryH1011 Date: Mon, 19 Jul 2021 14:37:36 +0800 Subject: [PATCH 31/43] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E5=A4=8D=E5=85=B1?= =?UTF-8?q?=E4=BA=AB=E5=86=85=E5=AD=98shmat=E5=92=8Cshmdt=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E4=B9=8B=E9=97=B4=E5=AD=98=E5=9C=A8=E7=9A=84=E6=AD=BB?= =?UTF-8?q?=E9=94=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit close #I40QOM Change-Id: Ib3783f5d6b1095bf2100ab024fe0235a64355823 Signed-off-by: JerryH1011 --- kernel/base/vm/shm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel/base/vm/shm.c b/kernel/base/vm/shm.c index 577eb160..035a456f 100644 --- a/kernel/base/vm/shm.c +++ b/kernel/base/vm/shm.c @@ -742,6 +742,7 @@ INT32 ShmDt(const VOID *shmaddr) /* remove it from aspace */ LOS_RbDelNode(&space->regionRbTree, ®ion->rbNode); LOS_ArchMmuUnmap(&space->archMmu, region->range.base, region->range.size >> PAGE_SHIFT); + (VOID)LOS_MuxRelease(&space->regionMux); /* free it */ free(region); @@ -750,7 +751,7 @@ INT32 ShmDt(const VOID *shmaddr) if (seg == NULL) { ret = EINVAL; SYSV_SHM_UNLOCK(); - goto ERROR_WITH_LOCK; + goto ERROR; } ShmPagesRefDec(seg); @@ -763,7 +764,7 @@ INT32 ShmDt(const VOID *shmaddr) seg->ds.shm_lpid = LOS_GetCurrProcessID(); } SYSV_SHM_UNLOCK(); - (VOID)LOS_MuxRelease(&space->regionMux); + return 0; ERROR_WITH_LOCK: From 80473f0975fe6fd4c4eae3a8a473674ad2dd1293 Mon Sep 17 00:00:00 2001 From: chenjing Date: Mon, 19 Jul 2021 15:18:16 +0800 Subject: [PATCH 32/43] =?UTF-8?q?fix:=20bootargs=E8=A7=A3=E6=9E=90?= =?UTF-8?q?=E4=B8=8Erootfs=E6=8C=82=E8=BD=BD=E8=A7=A3=E8=80=A6=EF=BC=8C?= =?UTF-8?q?=E5=B9=B6=E6=94=AF=E6=8C=81=E8=87=AA=E5=AE=9A=E4=B9=89bootargs?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1、bootargs解析与rootfs挂载进行解耦; 2、支持开发者自定义bootargs参数,内核存储bootargs中所有参数; 3、开发者可获取bootargs中的参数内容,并自行解析。 close #I41CL8 Change-Id: If384476714854ba0cf64eb70b785eb26737dd3d2 Signed-off-by: chenjing --- drivers/block/disk/include/disk.h | 3 + drivers/block/disk/src/disk.c | 16 + kernel/common/Makefile | 2 +- kernel/common/los_bootargs.c | 246 ++++++++++ kernel/common/los_bootargs.h | 58 +++ kernel/common/los_rootfs.c | 725 ++++++++++-------------------- kernel/common/los_rootfs.h | 69 +-- platform/Makefile | 2 +- 8 files changed, 595 insertions(+), 526 deletions(-) create mode 100644 kernel/common/los_bootargs.c create mode 100644 kernel/common/los_bootargs.h diff --git a/drivers/block/disk/include/disk.h b/drivers/block/disk/include/disk.h index 851aa563..b1f6884b 100644 --- a/drivers/block/disk/include/disk.h +++ b/drivers/block/disk/include/disk.h @@ -725,6 +725,9 @@ INT32 los_alloc_diskid_byname(const CHAR *diskName); */ INT32 los_get_diskid_byname(const CHAR *diskName); + +los_disk *los_get_mmcdisk_bytype(UINT8 type); + #ifdef __cplusplus #if __cplusplus } diff --git a/drivers/block/disk/src/disk.c b/drivers/block/disk/src/disk.c index 6c9681c6..34f48d47 100644 --- a/drivers/block/disk/src/disk.c +++ b/drivers/block/disk/src/disk.c @@ -187,6 +187,22 @@ INT32 los_get_diskid_byname(const CHAR *diskName) return diskID; } +los_disk *los_get_mmcdisk_bytype(UINT8 type) +{ + const CHAR *mmcDevHead = "/dev/mmcblk"; + + for (INT32 diskId = 0; diskId < SYS_MAX_DISK; diskId++) { + los_disk *disk = get_disk(diskId); + if (disk == NULL) { + continue; + } else if ((disk->type == type) && (strncmp(disk->disk_name, mmcDevHead, strlen(mmcDevHead)) == 0)) { + return disk; + } + } + PRINT_ERR("Cannot find the mmc disk!\n"); + return NULL; +} + VOID OsSetUsbStatus(UINT32 diskID) { if (diskID < SYS_MAX_DISK) { diff --git a/kernel/common/Makefile b/kernel/common/Makefile index 662f496e..6762cab4 100644 --- a/kernel/common/Makefile +++ b/kernel/common/Makefile @@ -31,7 +31,7 @@ include $(LITEOSTOPDIR)/config.mk MODULE_NAME := rootfs -LOCAL_SRCS := $(wildcard los_rootfs.c) +LOCAL_SRCS := $(wildcard los_rootfs.c los_bootargs.c) LOCAL_INCLUDE := \ -I $(LITEOSTOPDIR)/kernel/common \ diff --git a/kernel/common/los_bootargs.c b/kernel/common/los_bootargs.c new file mode 100644 index 00000000..03868dc7 --- /dev/null +++ b/kernel/common/los_bootargs.c @@ -0,0 +1,246 @@ +/* + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "los_bootargs.h" +#include "los_base.h" +#include "string.h" + +#if defined(LOSCFG_STORAGE_SPINOR) || defined(LOSCFG_STORAGE_SPINAND) || defined(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7) +#include "mtd_list.h" +#endif + +#ifdef LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7 +#include "cfiflash.h" +#endif + +#ifdef LOSCFG_STORAGE_EMMC +#include "disk.h" +#endif + +STATIC CHAR *g_cmdLine = NULL; +STATIC UINT64 g_alignSize = 0; +STATIC struct BootArgs g_bootArgs[MAX_ARGS_NUM] = {0}; + +INT32 LOS_GetCmdLine() { + int ret = 0; + + g_cmdLine = (CHAR *)malloc(COMMAND_LINE_SIZE); + if (g_cmdLine == NULL) { + PRINT_ERR("Malloc g_cmdLine space error!\n"); + return LOS_NOK; + } + +#ifdef LOSCFG_STORAGE_EMMC + los_disk *emmcDisk = los_get_mmcdisk_bytype(EMMC); + if (emmcDisk == NULL) { + PRINT_ERR("Get EMMC disk failed!\n"); + goto ERROUT; + } + g_alignSize = EMMC_SEC_SIZE; + ret = los_disk_read(emmcDisk->disk_id, g_cmdLine, COMMAND_LINE_ADDR / EMMC_SEC_SIZE, + COMMAND_LINE_SIZE / EMMC_SEC_SIZE, TRUE); + if (ret == 0) { + return LOS_OK; + } +#endif + +#ifdef LOSCFG_STORAGE_SPINOR + struct MtdDev *mtd = GetMtd("spinor"); + if (mtd == NULL) { + PRINT_ERR("Get spinor mtd failed!\n"); + goto ERROUT; + } + g_alignSize = mtd->eraseSize; + ret = mtd->read(mtd, COMMAND_LINE_ADDR, COMMAND_LINE_SIZE, g_cmdLine); + if (ret == COMMAND_LINE_SIZE) { + return LOS_OK; + } +#endif + +#ifdef LOSCFG_STORAGE_SPINAND + struct MtdDev *mtd = GetMtd("nand"); + if (mtd == NULL) { + PRINT_ERR("Get nand mtd failed!\n"); + goto ERROUT; + } + g_alignSize = mtd->eraseSize; + ret = mtd->read(mtd, COMMAND_LINE_ADDR, COMMAND_LINE_SIZE, g_cmdLine); + if (ret == COMMAND_LINE_SIZE) { + return LOS_OK; + } +#endif + +#ifdef LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7 + struct MtdDev *mtd = GetCfiMtdDev(); + if (mtd == NULL) { + PRINT_ERR("Get CFI mtd failed!\n"); + goto ERROUT; + } + g_alignSize = mtd->eraseSize; + ret = mtd->read(mtd, CFIFLASH_BOOTARGS_ADDR, COMMAND_LINE_SIZE, g_cmdLine); + if (ret == COMMAND_LINE_SIZE) { + return LOS_OK; + } +#endif + + PRINT_ERR("Read cmdline error!\n"); +ERROUT: + free(g_cmdLine); + g_cmdLine = NULL; + return LOS_NOK; +} + +VOID LOS_FreeCmdLine() { + if (g_cmdLine != NULL) { + free(g_cmdLine); + g_cmdLine = NULL; + } +} + +STATIC INT32 GetBootargs(CHAR **args) +{ +#ifdef LOSCFG_BOOTENV_RAM + *args = OsGetArgsAddr(); + return LOS_OK; +#else + INT32 i; + INT32 len = 0; + CHAR *tmp = NULL; + const CHAR *bootargsName = "bootargs="; + + if (g_cmdLine == NULL) { + PRINT_ERR("Should call LOS_GetCmdLine() first!\n"); + return LOS_NOK; + } + + for (i = 0; i < COMMAND_LINE_SIZE; i += len + 1) { + len = strlen(g_cmdLine + i); + tmp = strstr(g_cmdLine + i, bootargsName); + if (tmp != NULL) { + *args = tmp + strlen(bootargsName); + return LOS_OK; + } + } + PRINT_ERR("Cannot find bootargs!\n"); + return LOS_NOK; +#endif +} + +INT32 LOS_ParseBootargs() { + INT32 idx = 0; + INT32 ret; + CHAR *args; + CHAR *argName; + CHAR *argValue; + + ret = GetBootargs(&args); + if (ret != LOS_OK) { + return LOS_NOK; + } + + while ((argValue = strsep(&args, " ")) != NULL) { + argName = strsep(&argValue, "="); + if (argValue == NULL) { + /* If the argument is not compliance with the format 'foo=bar' */ + g_bootArgs[idx].argName = argName; + g_bootArgs[idx].argValue = argName; + } else { + g_bootArgs[idx].argName = argName; + g_bootArgs[idx].argValue = argValue; + } + if (++idx >= MAX_ARGS_NUM) { + /* Discard the rest arguments */ + break; + } + } + return LOS_OK; +} + +INT32 LOS_GetArgValue(CHAR *argName, CHAR **argValue) { + INT32 idx = 0; + + while (idx < MAX_ARGS_NUM) { + if (g_bootArgs[idx].argName == NULL) { + break; + } + if (strcmp(argName, g_bootArgs[idx].argName) == 0) { + *argValue = g_bootArgs[idx].argValue; + return LOS_OK; + } + idx++; + } + + return LOS_NOK; +} + + +UINT64 LOS_GetAlignsize() { + return g_alignSize; +} + +UINT64 LOS_SizeStrToNum(CHAR *value) +{ + UINT64 num = 0; + + /* If the string is a hexadecimal value */ + if (sscanf_s(value, "0x%x", &num) > 0) { + value += strlen("0x"); + if (strspn(value, "0123456789abcdefABCDEF") < strlen(value)) { + goto ERROUT; + } + return num; + } + + /* If the string is a decimal value in unit *Bytes */ + INT32 ret = sscanf_s(value, "%d", &num); + INT32 decOffset = strspn(value, "0123456789"); + CHAR *endPos = value + decOffset; + if ((ret <= 0) || (decOffset < (strlen(value) - 1))) { + goto ERROUT; + } + + if (strlen(endPos) == 0) { + return num; + } else if (strcasecmp(endPos, "k") == 0) { + num = num * BYTES_PER_KBYTE; + } else if (strcasecmp(endPos, "m") == 0) { + num = num * BYTES_PER_MBYTE; + } else if (strcasecmp(endPos, "g") == 0) { + num = num * BYTES_PER_GBYTE; + } else { + goto ERROUT; + } + + return num; + +ERROUT: + PRINT_ERR("Invalid value string \"%s\"!\n", value); + return num; +} \ No newline at end of file diff --git a/kernel/common/los_bootargs.h b/kernel/common/los_bootargs.h new file mode 100644 index 00000000..caae9d70 --- /dev/null +++ b/kernel/common/los_bootargs.h @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _LOS_BOOTARGS_H +#define _LOS_BOOTARGS_H + +#include "los_typedef.h" + +#define BYTES_PER_GBYTE (1 << 30) +#define BYTES_PER_MBYTE (1 << 20) +#define BYTES_PER_KBYTE (1 << 10) +#define COMMAND_LINE_ADDR (LOSCFG_BOOTENV_ADDR * BYTES_PER_KBYTE) +#define COMMAND_LINE_SIZE 1024 +#define MAX_ARGS_NUM 100 +#ifdef LOSCFG_STORAGE_EMMC +#define EMMC_SEC_SIZE 512 +#endif + +struct BootArgs { + CHAR *argName; + CHAR *argValue; +}; + +INT32 LOS_GetCmdLine(VOID); +VOID LOS_FreeCmdLine(VOID); +INT32 LOS_ParseBootargs(VOID); +INT32 LOS_GetArgValue(CHAR *argName, CHAR **argValue); +UINT64 LOS_GetAlignsize(VOID); +UINT64 LOS_SizeStrToNum(CHAR *value); + +#endif /* _LOS_BOOTARGS_H */ \ No newline at end of file diff --git a/kernel/common/los_rootfs.c b/kernel/common/los_rootfs.c index a1e442fe..8369f709 100644 --- a/kernel/common/los_rootfs.c +++ b/kernel/common/los_rootfs.c @@ -28,555 +28,294 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +#include "los_rootfs.h" +#include "los_bootargs.h" #include "los_base.h" -#include "los_typedef.h" #include "string.h" -#if defined(LOSCFG_STORAGE_SPINOR) || defined(LOSCFG_STORAGE_SPINAND) +#include "sys/mount.h" +#include "sys/stat.h" +#include "sys/types.h" + +#if defined(LOSCFG_STORAGE_SPINOR) || defined(LOSCFG_STORAGE_SPINAND) || defined(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7) +#include "mtd_list.h" #include "mtd_partition.h" #endif -#ifdef LOSCFG_DRIVERS_MMC -#include "disk.h" -#endif -#include "sys/mount.h" -#ifdef LOSCFG_PLATFORM_ROOTFS -#include "los_rootfs.h" -#endif -#include "mtd_list.h" -#include "fs/driver.h" #ifdef LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7 -#include "mtd_partition.h" #include "cfiflash.h" -#define DEV_STORAGE_PATH "/dev/cfiflash1" -#define SECOND_MTD_PART_NUM 1 -#define STORAGE_SIZE 0x1400000 -#endif - -#ifdef LOSCFG_STORAGE_SPINOR -#define DEV_STORAGE_PATH "/dev/spinorblk2" -#define SECOND_MTD_PART_NUM 2 -#define STORAGE_SIZE 0x80000 -#endif - -#ifdef LOSCFG_STORAGE_SPINAND -#define DEV_STORAGE_PATH "/dev/nandblk2" -#define SECOND_MTD_PART_NUM 2 -#define STORAGE_SIZE 0xa00000 #endif #ifdef LOSCFG_STORAGE_EMMC +#include "disk.h" #include "ff.h" -#define STORAGE_SIZE 0x3200000 -STATIC los_disk *g_emmcDisk = NULL; #endif -#ifndef LOSCFG_SECURITY_BOOT -STATIC INT32 g_alignSize = 0; -#endif - -#define VFAT_STORAGE_MOUNT_DIR_MODE 0777 -#define DEFAULT_STORAGE_MOUNT_DIR_MODE 0755 - -#ifdef LOSCFG_DRIVERS_MMC -los_disk *GetMmcDisk(UINT8 type) -{ - const CHAR *mmcDevHead = "/dev/mmcblk"; - - for (INT32 diskId = 0; diskId < SYS_MAX_DISK; diskId++) { - los_disk *disk = get_disk(diskId); - if (disk == NULL) { - continue; - } else if (disk->disk_name == NULL) { - continue; - } else if (strncmp(disk->disk_name, mmcDevHead, strlen(mmcDevHead))) { - continue; - } else { - if (disk->type == type) { - return disk; - } - } - } - PRINT_ERR("Cannot find the mmc disk!\n"); - return NULL; -} -#endif - #ifdef LOSCFG_STORAGE_EMMC struct disk_divide_info *StorageBlockGetEmmc(void); struct block_operations *StorageBlockGetMmcOps(void); char *StorageBlockGetEmmcNodeName(void *block); -STATIC const CHAR *AddEmmcRootfsPart(INT32 rootAddr, INT32 rootSize, INT32 userAddr, INT32 userSize) +STATIC INT32 AddEmmcParts(INT32 rootAddr, INT32 rootSize, INT32 userAddr, INT32 userSize) { INT32 ret; - void *block = ((struct drv_data *)g_emmcDisk->dev->data)->priv; + los_disk *emmcDisk = los_get_mmcdisk_bytype(EMMC); + if (emmcDisk == NULL) { + PRINT_ERR("Get EMMC disk failed!\n"); + return LOS_NOK; + } + + void *block = ((struct drv_data *)emmcDisk->dev->data)->priv; const char *node_name = StorageBlockGetEmmcNodeName(block); - if (los_disk_deinit(g_emmcDisk->disk_id) != ENOERR) { + if (los_disk_deinit(emmcDisk->disk_id) != ENOERR) { PRINT_ERR("Failed to deinit emmc disk!\n"); - return NULL; + return LOS_NOK; } struct disk_divide_info *emmc = StorageBlockGetEmmc(); ret = add_mmc_partition(emmc, rootAddr / EMMC_SEC_SIZE, rootSize / EMMC_SEC_SIZE); if (ret != LOS_OK) { PRINT_ERR("Failed to add mmc root partition!\n"); - return NULL; - } else { - UINT64 storageStartCnt = userAddr / EMMC_SEC_SIZE; - UINT64 storageSizeCnt = userSize / EMMC_SEC_SIZE; - UINT64 userdataStartCnt = storageStartCnt + storageSizeCnt; - UINT64 userdataSizeCnt = g_emmcDisk->sector_count - userdataStartCnt; - ret = add_mmc_partition(emmc, storageStartCnt, storageSizeCnt); - if (ret != LOS_OK) { - PRINT_ERR("Failed to add mmc storage partition!\n"); - } - ret = add_mmc_partition(emmc, userdataStartCnt, userdataSizeCnt); - if (ret != LOS_OK) { - PRINT_ERR("Failed to add mmc userdata partition!\n"); - } - LOS_Msleep(10); /* waiting for device identification */ - INT32 diskId = los_alloc_diskid_byname(node_name); - if (diskId < 0) { - PRINT_ERR("Failed to alloc disk %s!\n", node_name); - return NULL; - } - if (los_disk_init(node_name, StorageBlockGetMmcOps(), block, diskId, emmc) != ENOERR) { - PRINT_ERR("Failed to init emmc disk!\n"); - return NULL; - } - return node_name; - } -} -#endif - -STATIC const CHAR *GetDevName(const CHAR *rootType, INT32 rootAddr, INT32 rootSize, INT32 userAddr, INT32 userSize) -{ - const CHAR *rootDev = NULL; - -#if defined(LOSCFG_STORAGE_SPINOR) || defined(LOSCFG_STORAGE_SPINAND) - INT32 ret; - if (strcmp(rootType, "flash") == 0) { - ret = add_mtd_partition(FLASH_TYPE, rootAddr, rootSize, 0); - if (ret != LOS_OK) { - PRINT_ERR("Failed to add spinor/spinand root partition!\n"); - } else { - rootDev = FLASH_DEV_NAME; - ret = add_mtd_partition(FLASH_TYPE, userAddr, userSize, SECOND_MTD_PART_NUM); - if (ret != LOS_OK) { - PRINT_ERR("Failed to add spinor/spinand storage partition!\n"); - } - } - } else -#endif - -#ifdef LOSCFG_DRIVERS_USB_MASS_STORAGE - if (strcmp(rootType, "usb") == 0) { - rootDev = "/dev/sda"; - } else -#endif - -#ifdef LOSCFG_DRIVERS_SD - if (strcmp(rootType, "sdcard") == 0) { - los_disk *sdDisk = GetMmcDisk(OTHERS); - if (sdDisk == NULL) { - PRINT_ERR("Get sdcard failed!\n"); - } else { - rootDev = sdDisk->disk_name; - } - } else -#endif - -#ifdef LOSCFG_STORAGE_EMMC - if (strcmp(rootType, "emmc") == 0) { - rootDev = AddEmmcRootfsPart(rootAddr, rootSize, userAddr, userSize); - } else -#endif - -#ifdef LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7 - if (strcmp(rootType, FLASH_TYPE) == 0) { - INT32 ret; - if (rootAddr != CFIFLASH_ROOT_ADDR) { - PRINT_ERR("Error rootAddr, must be %#0x!\n", CFIFLASH_ROOT_ADDR); - return NULL; - } - ret = add_mtd_partition(FLASH_TYPE, rootAddr, rootSize, 0); - if (ret != LOS_OK) { - PRINT_ERR("Failed to add %s root partition!\n", FLASH_TYPE); - } else { - rootDev = "/dev/cfiflash0"; - ret = add_mtd_partition(FLASH_TYPE, (rootAddr + rootSize), - CFIFLASH_CAPACITY - rootAddr - rootSize, SECOND_MTD_PART_NUM); - if (ret != LOS_OK) { - PRINT_ERR("Failed to add %s storage partition!\n", FLASH_TYPE); - } - } - } else -#endif - { - PRINT_ERR("Failed to find root dev type: %s\n", rootType); - } - return rootDev; -} - -#ifndef LOSCFG_SECURITY_BOOT -STATIC INT32 GetArgs(CHAR **args) -{ -#ifdef LOSCFG_BOOTENV_RAM - *args = OsGetArgsAddr(); - return LOS_OK; - -#else - INT32 ret; - INT32 i; - INT32 len = 0; - CHAR *cmdLine = NULL; - CHAR *tmp = NULL; - const CHAR *bootargName = "bootargs="; - - cmdLine = (CHAR *)malloc(COMMAND_LINE_SIZE); - if (cmdLine == NULL) { - PRINT_ERR("Malloc cmdLine space error!\n"); return LOS_NOK; } -#ifdef LOSCFG_STORAGE_EMMC - g_emmcDisk = GetMmcDisk(EMMC); - if (g_emmcDisk == NULL) { - PRINT_ERR("Get EMMC disk failed!\n"); - goto ERROUT; - } - /* param4 is TRUE for not reading large contiguous data */ - ret = los_disk_read(g_emmcDisk->disk_id, cmdLine, COMMAND_LINE_ADDR / EMMC_SEC_SIZE, - COMMAND_LINE_SIZE / EMMC_SEC_SIZE, TRUE); - if (ret != 0) { - PRINT_ERR("Read EMMC command line failed!\n"); - goto ERROUT; - } - g_alignSize = EMMC_SEC_SIZE; -#endif - -#if defined(LOSCFG_STORAGE_SPINOR) || defined(LOSCFG_STORAGE_SPINAND) - struct MtdDev *mtd = GetMtd(FLASH_TYPE); - if (mtd == NULL) { - PRINT_ERR("Get spinor mtd failed!\n"); - goto ERROUT; - } - g_alignSize = mtd->eraseSize; - ret = mtd->read(mtd, COMMAND_LINE_ADDR, COMMAND_LINE_SIZE, cmdLine); - if (ret != COMMAND_LINE_SIZE) { - PRINT_ERR("Read spinor command line failed!\n"); - goto ERROUT; - } -#endif -#ifdef LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7 - struct MtdDev *mtd = GetCfiMtdDev(); - if (mtd == NULL) { - PRINT_ERR("Get CFI mtd failed!\n"); - goto ERROUT; - } - g_alignSize = mtd->eraseSize; - ret = mtd->read(mtd, CFIFLASH_BOOTARGS_ADDR, COMMAND_LINE_SIZE, cmdLine); - if (ret != COMMAND_LINE_SIZE) { - PRINT_ERR("Read CFI command line failed!\n"); - goto ERROUT; - } -#endif - - for (i = 0; i < COMMAND_LINE_SIZE; i += len + 1) { - len = strlen(cmdLine + i); - tmp = strstr(cmdLine + i, bootargName); - if (tmp != NULL) { - *args = strdup(tmp + strlen(bootargName)); - if (*args == NULL) { - goto ERROUT; - } - free(cmdLine); - return LOS_OK; - } - } - PRINT_ERR("Cannot find bootargs!\n"); - -ERROUT: - free(cmdLine); - return LOS_NOK; -#endif -} - -STATIC INT32 MatchRootPos(CHAR *p, const CHAR *rootInfoName, INT32 *rootInfo) -{ - UINT32 offset; - CHAR *value = NULL; - - if (strncmp(p, rootInfoName, strlen(rootInfoName)) == 0) { - value = p + strlen(rootInfoName); - offset = strspn(value, DEC_NUMBER_STRING); - if (strcmp(p + strlen(p) - 1, "M") == 0) { - if ((offset < (strlen(value) - 1)) || (sscanf_s(value, "%d", rootInfo) <= 0)) { - goto ERROUT; - } - *rootInfo = *rootInfo * BYTES_PER_MBYTE; - } else if (strcmp(p + strlen(p) - 1, "K") == 0) { - if ((offset < (strlen(value) - 1)) || (sscanf_s(value, "%d", rootInfo) <= 0)) { - goto ERROUT; - } - *rootInfo = *rootInfo * BYTES_PER_KBYTE; - } else if (sscanf_s(value, "0x%x", rootInfo) > 0) { - value += strlen("0x"); - if (strspn(value, HEX_NUMBER_STRING) < strlen(value)) { - goto ERROUT; - } - } else { - goto ERROUT; - } - } - - if ((*rootInfo >= 0) && (g_alignSize != 0) && ((UINT32)(*rootInfo) & (UINT32)(g_alignSize - 1))) { - PRINT_ERR("The bootarg \"%s\" will be 0x%x aligned!\n", p, g_alignSize); - } - return LOS_OK; - -ERROUT: - PRINT_ERR("Invalid bootarg \"%s\"!\n", p); - return LOS_NOK; -} - -STATIC INT32 MatchRootInfo(CHAR *p, CHAR **rootType, CHAR **fsType, INT32 *rootAddr, INT32 *rootSize, INT32 *userAddr, INT32 *userSize) -{ - const CHAR *rootName = "root="; - const CHAR *fsName = "fstype="; - const CHAR *rootAddrName = "rootaddr="; - const CHAR *rootSizeName = "rootsize="; - const CHAR *userAddrName = "useraddr="; - const CHAR *userSizeName = "usersize="; - - if ((*rootType == NULL) && (strncmp(p, rootName, strlen(rootName)) == 0)) { - *rootType = strdup(p + strlen(rootName)); - if (*rootType == NULL) { - return LOS_NOK; - } - return LOS_OK; - } - - if ((*fsType == NULL) && (strncmp(p, fsName, strlen(fsName)) == 0)) { - *fsType = strdup(p + strlen(fsName)); - if (*fsType == NULL) { - return LOS_NOK; - } - return LOS_OK; - } - - if (*rootAddr < 0) { - if (MatchRootPos(p, rootAddrName, rootAddr) != LOS_OK) { - return LOS_NOK; - } else if (*rootAddr >= 0) { - return LOS_OK; - } - } - - if (*rootSize < 0) { - if (MatchRootPos(p, rootSizeName, rootSize) != LOS_OK) { - return LOS_NOK; - } - } - - if (*userAddr < 0) { - if (MatchRootPos(p, userAddrName, userAddr) != LOS_OK) { - return LOS_NOK; - } else if (*userAddr >= 0) { - return LOS_OK; - } - } - - if (*userSize < 0) { - if (MatchRootPos(p, userSizeName, userSize) != LOS_OK) { - return LOS_NOK; - } - } - - return LOS_OK; -} - -STATIC INT32 GetRootType(CHAR **rootType, CHAR **fsType, INT32 *rootAddr, INT32 *rootSize, INT32 *userAddr, INT32 *userSize) -{ - CHAR *args = NULL; - CHAR *p = NULL; - - if (GetArgs(&args) != LOS_OK) { - PRINT_ERR("Cannot get bootargs!\n"); + UINT64 storageStartCnt = userAddr / EMMC_SEC_SIZE; + UINT64 storageSizeCnt = userSize / EMMC_SEC_SIZE; + UINT64 userdataStartCnt = storageStartCnt + storageSizeCnt; + UINT64 userdataSizeCnt = emmcDisk->sector_count - userdataStartCnt; + ret = add_mmc_partition(emmc, storageStartCnt, storageSizeCnt); + if (ret != LOS_OK) { + PRINT_ERR("Failed to add mmc storage partition!\n"); return LOS_NOK; } -#ifndef LOSCFG_BOOTENV_RAM - CHAR *argsBak = NULL; - argsBak = args; -#endif - p = strsep(&args, " "); - while (p != NULL) { - if (MatchRootInfo(p, rootType, fsType, rootAddr, rootSize, userAddr, userSize) != LOS_OK) { - goto ERROUT; - } - p = strsep(&args, " "); - } - if ((*fsType != NULL) && (*rootType != NULL)) { -#ifndef LOSCFG_BOOTENV_RAM - free(argsBak); -#endif - return LOS_OK; + + ret = add_mmc_partition(emmc, userdataStartCnt, userdataSizeCnt); + if (ret != LOS_OK) { + PRINT_ERR("Failed to add mmc userdata partition!\n"); + return LOS_NOK; } -ERROUT: - PRINT_ERR("Invalid rootfs information!\n"); - if (*rootType != NULL) { - free(*rootType); - *rootType = NULL; + LOS_Msleep(10); /* waiting for device identification */ + + INT32 diskId = los_alloc_diskid_byname(node_name); + if (diskId < 0) { + PRINT_ERR("Failed to alloc disk %s!\n", node_name); + return LOS_NOK; } - if (*fsType != NULL) { - free(*fsType); - *fsType = NULL; + + if (los_disk_init(node_name, StorageBlockGetMmcOps(), block, diskId, emmc) != ENOERR) { + PRINT_ERR("Failed to init emmc disk!\n"); + return LOS_NOK; } -#ifndef LOSCFG_BOOTENV_RAM - free(argsBak); -#endif - return LOS_NOK; + + return LOS_OK; } #endif -#ifdef LOSCFG_STORAGE_EMMC -STATIC VOID OsMountUserdata(const CHAR *fsType) + +STATIC INT32 AddPartitions(CHAR *dev, UINT64 rootAddr, UINT64 rootSize, UINT64 userAddr, UINT64 userSize) { - INT32 ret; - INT32 err; - const CHAR *userdataDir = "/userdata"; - ret = mkdir(userdataDir, VFAT_STORAGE_MOUNT_DIR_MODE); - if ((ret != LOS_OK) && ((err = get_errno()) != EEXIST)) { - PRINT_ERR("Failed to mkdir /userdata, errno %d: %s\n", err, strerror(err)); - return; +#ifdef LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7 + if ((strcmp(dev, "cfi-flash") == 0) && (rootAddr != CFIFLASH_ROOT_ADDR)) { + PRINT_ERR("Error rootAddr, must be %#0x!\n", CFIFLASH_ROOT_ADDR); + return LOS_NOK; } - CHAR emmcUserdataDev[DISK_NAME] = {0}; - if (snprintf_s(emmcUserdataDev, sizeof(emmcUserdataDev), sizeof(emmcUserdataDev) - 1, - "%s%s", g_emmcDisk->disk_name, "p2") < 0) { - PRINT_ERR("Failed to get emmc userdata dev name!\n"); - return; - } - ret = mount(emmcUserdataDev, userdataDir, fsType, 0, "umask=000"); - if (ret == LOS_OK) { - return; - } - err = get_errno(); - if (err == ENOTSUP) { -#ifdef LOSCFG_FS_FAT - ret = format(emmcUserdataDev, 0, FM_FAT32); - if (ret != LOS_OK) { - PRINT_ERR("Failed to format %s\n", emmcUserdataDev); - return; - } -#endif - ret = mount(emmcUserdataDev, userdataDir, fsType, 0, "umask=000"); - if (ret != LOS_OK) { - err = get_errno(); - PRINT_ERR("Failed to mount /userdata, errno %d: %s\n", err, strerror(err)); - } - } else { - PRINT_ERR("Failed to mount /userdata, errno %d: %s\n", err, strerror(err)); - } - return; -} #endif -STATIC INT32 OsMountRootfsAndUserfs(const CHAR *rootDev, const CHAR *fsType) -{ - INT32 ret; - INT32 err; - if (strcmp(fsType, "vfat") == 0) { - ret = mount(rootDev, "/", fsType, MS_RDONLY, NULL); - if (ret != LOS_OK) { - err = get_errno(); - PRINT_ERR("Failed to mount vfat rootfs, errno %d: %s\n", err, strerror(err)); - return ret; - } -#ifdef LOSCFG_STORAGE_EMMC - ret = mkdir("/storage", VFAT_STORAGE_MOUNT_DIR_MODE); - if ((ret != LOS_OK) && ((err = get_errno()) != EEXIST)) { - PRINT_ERR("Failed to mkdir /storage, errno %d: %s\n", err, strerror(err)); - return ret; - } else { - CHAR emmcStorageDev[DISK_NAME] = {0}; - if (snprintf_s(emmcStorageDev, sizeof(emmcStorageDev), sizeof(emmcStorageDev) - 1, - "%s%s", g_emmcDisk->disk_name, "p1") < 0) { - PRINT_ERR("Failed to get emmc storage dev name!\n"); - } else { - ret = mount(emmcStorageDev, "/storage", fsType, 0, "umask=000"); - if (ret != LOS_OK) { - err = get_errno(); - PRINT_ERR("Failed to mount /storage, errno %d: %s\n", err, strerror(err)); - } - } - } - OsMountUserdata(fsType); -#endif - } else { - ret = mount(rootDev, "/", fsType, MS_RDONLY, NULL); - if (ret != LOS_OK) { - err = get_errno(); - PRINT_ERR("Failed to mount rootfs,rootDev %s, errno %d: %s\n", rootDev, err, strerror(err)); - return ret; - } #if defined(LOSCFG_STORAGE_SPINOR) || defined(LOSCFG_STORAGE_SPINAND) || defined(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7) - ret = mkdir("/storage", DEFAULT_STORAGE_MOUNT_DIR_MODE); - if ((ret != LOS_OK) && ((err = get_errno()) != EEXIST)) { - PRINT_ERR("Failed to mkdir /storage, errno %d: %s\n", err, strerror(err)); - return ret; - } else { - ret = mount(DEV_STORAGE_PATH, "/storage", fsType, 0, NULL); - if (ret != LOS_OK) { - err = get_errno(); - PRINT_ERR("Failed to mount /storage, errno %d: %s\n", err, strerror(err)); - } + INT32 ret; + INT32 blk0 = 0; + INT32 blk2 = 2; + if (strcmp(dev, "flash") == 0 || strcmp(dev, FLASH_TYPE) == 0) { + ret = add_mtd_partition(FLASH_TYPE, rootAddr, rootSize, blk0); + if (ret != LOS_OK) { + PRINT_ERR("Failed to add mtd root partition!\n"); + return LOS_NOK; } -#endif + + ret = add_mtd_partition(FLASH_TYPE, userAddr, userSize, blk2); + if (ret != LOS_OK) { + PRINT_ERR("Failed to add mtd storage partition!\n"); + return LOS_NOK; + } + + return LOS_OK; } +#endif + +#ifdef LOSCFG_STORAGE_EMMC + if (strcmp(dev, "emmc") == 0) { + return AddEmmcParts(rootAddr, rootSize, userAddr, userSize); + } +#endif + + PRINT_ERR("Unsupport dev type: %s\n", dev); + return LOS_NOK; +} + + +STATIC INT32 ParseRootArgs(CHAR **dev, CHAR **fstype, UINT64 *rootAddr, UINT64 *rootSize) { + INT32 ret; + CHAR *rootAddrStr; + CHAR *rootSizeStr; + + ret = LOS_GetArgValue("root", dev); + if (ret != LOS_OK) { + PRINT_ERR("Cannot find root!"); + return ret; + } + + ret = LOS_GetArgValue("fstype", fstype); + if (ret != LOS_OK) { + PRINT_ERR("Cannot find fstype!"); + return ret; + } + + ret = LOS_GetArgValue("rootaddr", &rootAddrStr); + if (ret != LOS_OK) { + *rootAddr = ROOTFS_ADDR; + } else { + *rootAddr = LOS_SizeStrToNum(rootAddrStr); + } + + ret = LOS_GetArgValue("rootsize", &rootSizeStr); + if (ret != LOS_OK) { + *rootSize = ROOTFS_SIZE; + } else { + *rootSize = LOS_SizeStrToNum(rootSizeStr); + } + return LOS_OK; } -INT32 OsMountRootfs(VOID) -{ - INT32 ret = LOS_OK; - INT32 err; - INT32 rootAddr = -1; - INT32 rootSize = -1; - INT32 userAddr = -1; - INT32 userSize = -1; - CHAR *rootType = NULL; - CHAR *fsType = NULL; - const CHAR *rootDev = NULL; +STATIC INT32 ParseUserArgs(UINT64 rootAddr, UINT64 rootSize, UINT64 *userAddr, UINT64 *userSize) { + INT32 ret; + CHAR *userAddrStr; + CHAR *userSizeStr; -#ifdef LOSCFG_SECURITY_BOOT - rootType = strdup(ROOTFS_ROOT_TYPE); - fsType = strdup(ROOTFS_FS_TYPE); - rootAddr = ROOTFS_FLASH_ADDR; - rootSize = ROOTFS_FLASH_SIZE; -#else - ret = GetRootType(&rootType, &fsType, &rootAddr, &rootSize, &userAddr, &userSize); + ret = LOS_GetArgValue("useraddr", &userAddrStr); + if (ret != LOS_OK) { + *userAddr = rootAddr + rootSize; + } else { + *userAddr = LOS_SizeStrToNum(userAddrStr); + } + + ret = LOS_GetArgValue("usersize", &userSizeStr); + if (ret != LOS_OK) { + *userSize = USERFS_SIZE; + } else { + *userSize = LOS_SizeStrToNum(userSizeStr); + } + + return LOS_OK; +} + +STATIC INT32 MountPartitions(CHAR *fsType) { + INT32 ret; + INT32 err; + + /* Mount rootfs */ + ret = mount(ROOT_DEV_NAME, ROOT_DIR_NAME, fsType, MS_RDONLY, NULL); + if (ret != LOS_OK) { + err = get_errno(); + PRINT_ERR("Failed to mount %s, rootDev %s, errno %d: %s\n", ROOT_DIR_NAME, ROOT_DEV_NAME, err, strerror(err)); + return ret; + } + + /* Mount userfs */ + ret = mkdir(STORAGE_DIR_NAME, DEFAULT_MOUNT_DIR_MODE); + if ((ret != LOS_OK) && ((err = get_errno()) != EEXIST)) { + PRINT_ERR("Failed to mkdir %s, errno %d: %s\n", STORAGE_DIR_NAME, err, strerror(err)); + return ret; + } + + ret = mount(USER_DEV_NAME, STORAGE_DIR_NAME, fsType, 0, DEFAULT_MOUNT_DATA); + if (ret != LOS_OK) { + err = get_errno(); + PRINT_ERR("Failed to mount %s, errno %d: %s\n", STORAGE_DIR_NAME, err, strerror(err)); + return ret; + } + +#ifdef LOSCFG_STORAGE_EMMC + /* Mount userdata */ + ret = mkdir(USERDATA_DIR_NAME, DEFAULT_MOUNT_DIR_MODE); + if ((ret != LOS_OK) && ((err = get_errno()) != EEXIST)) { + PRINT_ERR("Failed to mkdir %s, errno %d: %s\n", USERDATA_DIR_NAME, err, strerror(err)); + return ret; + } + + ret = mount(USERDATA_DEV_NAME, USERDATA_DIR_NAME, fsType, 0, DEFAULT_MOUNT_DATA); + if ((ret != LOS_OK) && ((err = get_errno()) == ENOTSUP)) { + ret = format(USERDATA_DEV_NAME, 0, FM_FAT32); + if (ret != LOS_OK) { + PRINT_ERR("Failed to format %s\n", USERDATA_DEV_NAME); + return ret; + } + + ret = mount(USERDATA_DEV_NAME, USERDATA_DIR_NAME, fsType, 0, DEFAULT_MOUNT_DATA); + if (ret != LOS_OK) { + err = get_errno(); + } + } + if (ret != LOS_OK) { + PRINT_ERR("Failed to mount %s, errno %d: %s\n", USERDATA_DIR_NAME, err, strerror(err)); + return ret; + } +#endif + return LOS_OK; +} + +STATIC INT32 CheckValidation(UINT64 rootAddr, UINT64 rootSize, UINT64 userAddr, UINT64 userSize) { + UINT64 alignSize = LOS_GetAlignsize(); + + if (alignSize == 0) { + return LOS_OK; + } + + if ((rootAddr & (alignSize - 1)) || (rootSize & (alignSize - 1)) || + (userAddr & (alignSize - 1)) || (userSize & (alignSize - 1))) { + PRINT_ERR("The address or size value should be 0x%x aligned!\n", alignSize); + return LOS_NOK; + } + + return LOS_OK; +} + +INT32 OsMountRootfs() { + INT32 ret; + CHAR *dev; + CHAR *fstype; + UINT64 rootAddr; + UINT64 rootSize; + UINT64 userAddr; + UINT64 userSize; + + ret = ParseRootArgs(&dev, &fstype, &rootAddr, &rootSize); if (ret != LOS_OK) { return ret; } - rootAddr = (rootAddr >= 0) ? rootAddr : ROOTFS_FLASH_ADDR; - rootSize = (rootSize >= 0) ? rootSize : ROOTFS_FLASH_SIZE; -#endif - userAddr = (userAddr >= 0) ? userAddr : rootAddr + rootSize; - userSize = (userSize >= 0) ? userSize : STORAGE_SIZE; - rootDev = GetDevName(rootType, rootAddr, rootSize, userAddr, userSize); - if (rootDev != NULL) { - ret = OsMountRootfsAndUserfs(rootDev, fsType); - if (ret != LOS_OK) { - err = get_errno(); - PRINT_ERR("Failed to mount rootfs, errno %d: %s\n", err, strerror(err)); - } + ret = ParseUserArgs(rootAddr, rootSize, &userAddr, &userSize); + if (ret != LOS_OK) { + return ret; } - free(rootType); - free(fsType); - return ret; -} + ret = CheckValidation(rootAddr, rootSize, userAddr, userSize); + if (ret != LOS_OK) { + return ret; + } + + ret = AddPartitions(dev, rootAddr, rootSize, userAddr, userSize); + if (ret != LOS_OK) { + return ret; + } + + ret = MountPartitions(fstype); + if (ret != LOS_OK) { + return ret; + } + + return LOS_OK; +} \ No newline at end of file diff --git a/kernel/common/los_rootfs.h b/kernel/common/los_rootfs.h index f2de0986..dc325541 100644 --- a/kernel/common/los_rootfs.h +++ b/kernel/common/los_rootfs.h @@ -32,45 +32,52 @@ #ifndef _LOS_ROOTFS_H #define _LOS_ROOTFS_H -#define BYTES_PER_MBYTE 0x100000 -#define BYTES_PER_KBYTE 0x400 - -#define COMMAND_LINE_ADDR LOSCFG_BOOTENV_ADDR * BYTES_PER_KBYTE -#define COMMAND_LINE_SIZE 1024 - -#ifdef LOSCFG_STORAGE_SPINOR -#define ROOTFS_ROOT_TYPE "flash" -#define ROOTFS_FS_TYPE "jffs2" -#elif defined(LOSCFG_STORAGE_SPINAND) -#define ROOTFS_ROOT_TYPE "nand" -#define ROOTFS_FS_TYPE "yaffs2" -#endif +#include "los_typedef.h" +#define ROOT_DIR_NAME "/" +#define STORAGE_DIR_NAME "/storage" #ifdef LOSCFG_STORAGE_EMMC -#define ROOTFS_ROOT_TYPE "emmc" -#define ROOTFS_FS_TYPE "vfat" -#endif - -#ifdef LOSCFG_TEE_ENABLE -#define ROOTFS_FLASH_ADDR 0x600000 -#define ROOTFS_FLASH_SIZE 0x800000 -#else -#define ROOTFS_FLASH_ADDR 0x400000 -#define ROOTFS_FLASH_SIZE 0xa00000 +#define USERDATA_DIR_NAME "/userdata" #endif +#define DEFAULT_MOUNT_DIR_MODE 0755 +#define DEFAULT_MOUNT_DATA NULL #ifdef LOSCFG_STORAGE_SPINOR #define FLASH_TYPE "spinor" -#define FLASH_DEV_NAME "/dev/spinorblk0" -#elif defined(LOSCFG_STORAGE_SPINAND) +#define ROOT_DEV_NAME "/dev/spinorblk0" +#define USER_DEV_NAME "/dev/spinorblk2" +#define ROOTFS_ADDR 0x600000 +#define ROOTFS_SIZE 0x800000 +#define USERFS_SIZE 0x80000 +#elif defined (LOSCFG_STORAGE_SPINAND) #define FLASH_TYPE "nand" -#define FLASH_DEV_NAME "/dev/nandblk0" +#define ROOT_DEV_NAME "/dev/nandblk0" +#define USER_DEV_NAME "/dev/nandblk2" +#define ROOTFS_ADDR 0x600000 +#define ROOTFS_SIZE 0x800000 +#define USERFS_SIZE 0x80000 +#elif defined (LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7) +#define ROOT_DEV_NAME "/dev/cfiflash0" +#define USER_DEV_NAME "/dev/cfiflash2" +#define ROOTFS_ADDR CFIFLASH_ROOT_ADDR +#define ROOTFS_SIZE 0x1B00000 +#define USERFS_SIZE (CFIFLASH_CAPACITY - ROOTFS_ADDR - ROOTFS_SIZE) +#elif defined (LOSCFG_STORAGE_EMMC) +#define ROOT_DEV_NAME "/dev/mmcblk0p0" +#define USER_DEV_NAME "/dev/mmcblk0p1" +#define USERDATA_DEV_NAME "/dev/mmcblk0p2" +#define ROOTFS_ADDR 0xA00000 +#define ROOTFS_SIZE 0x1400000 +#define USERFS_SIZE 0x3200000 +#ifdef DEFAULT_MOUNT_DIR_MODE +#undef DEFAULT_MOUNT_DIR_MODE +#endif +#ifdef DEFAULT_MOUNT_DATA +#undef DEFAULT_MOUNT_DATA +#endif +#define DEFAULT_MOUNT_DIR_MODE 0777 +#define DEFAULT_MOUNT_DATA "umask=000" #endif - -#define EMMC_SEC_SIZE 512 - -#define DEC_NUMBER_STRING "0123456789" -#define HEX_NUMBER_STRING "0123456789abcdefABCDEF" INT32 OsMountRootfs(VOID); VOID OsSetCmdLineAddr(UINT64 addr); diff --git a/platform/Makefile b/platform/Makefile index 940337fd..27934023 100644 --- a/platform/Makefile +++ b/platform/Makefile @@ -37,7 +37,7 @@ LOCAL_INCLUDE += -I $(LITEOSTOPDIR)/compat/posix/src \ -I $(LITEOSTOPDIR)/bsd/dev/random LOCAL_SRCS += $(wildcard ../kernel/common/*.c) -LOCAL_SRCS := $(filter-out ../kernel/common/los_rootfs.c, $(LOCAL_SRCS)) +LOCAL_SRCS := $(filter-out ../kernel/common/los_rootfs.c ../kernel/common/los_bootargs.c, $(LOCAL_SRCS)) ifneq ($(LOSCFG_FS_VFS), y) LOCAL_SRCS := $(filter-out ../kernel/common/console.c ../kernel/common/virtual_serial.c, $(LOCAL_SRCS)) endif From 51a50c95b4cd47b6931523926b728d1c0ff8988b Mon Sep 17 00:00:00 2001 From: Guangyao Ma Date: Tue, 20 Jul 2021 14:37:27 +0800 Subject: [PATCH 33/43] feat: support .mkshrc close #I3Y5KE Signed-off-by: Guangyao Ma Change-Id: Iea3cfe4da572b1a4e250f90cea24efa2c27ceddb --- Makefile | 2 +- apps/mksh/Makefile | 3 ++ tools/scripts/make_rootfs/rootfs.sh | 39 -------------------------- tools/scripts/make_rootfs/rootfsdir.sh | 18 ++++++++---- 4 files changed, 17 insertions(+), 45 deletions(-) delete mode 100755 tools/scripts/make_rootfs/rootfs.sh diff --git a/Makefile b/Makefile index ff3bf7c9..3ef0218e 100644 --- a/Makefile +++ b/Makefile @@ -181,7 +181,7 @@ endif $(ROOTFSDIR): prepare $(APPS) $(HIDE)$(MAKE) clean -C apps - $(HIDE)$(LITEOSTOPDIR)/tools/scripts/make_rootfs/rootfsdir.sh $(OUT)/bin $(OUT)/musl $(ROOTFS_DIR) $(LITEOS_TARGET_DIR) + $(HIDE)$(LITEOSTOPDIR)/tools/scripts/make_rootfs/rootfsdir.sh $(OUT) $(ROOTFS_DIR) $(LITEOS_TARGET_DIR) ifneq ($(VERSION),) $(HIDE)$(LITEOSTOPDIR)/tools/scripts/make_rootfs/releaseinfo.sh "$(VERSION)" $(ROOTFS_DIR) $(LITEOS_TARGET_DIR) endif diff --git a/apps/mksh/Makefile b/apps/mksh/Makefile index 182c7c01..43f215f1 100755 --- a/apps/mksh/Makefile +++ b/apps/mksh/Makefile @@ -34,6 +34,7 @@ LITEOSTOPDIR = $(MKSH_DIR)/../../ include $(MKSH_DIR)/../config.mk APPS_OUT := $(OUT)/bin +ETC_OUT := $(OUT)/etc BUILD_DIR := $(MKSH_DIR)/build BUILD_LOG := $(MKSH_DIR)/build.log TARGET_OS := OpenHarmony @@ -61,6 +62,8 @@ endif $(HIDE)$(STRIP) $(MKSH) $(HIDE)mkdir -p $(APPS_OUT) $(HIDE)$(CP) $(MKSH) $(APPS_OUT) + $(HIDE)mkdir -p $(ETC_OUT) + $(HIDE)$(CP) -rf $(BUILD_DIR)/.mkshrc $(ETC_OUT)/ clean: $(HIDE)$(RM) $(MKSH) $(BUILD_DIR) $(BUILD_LOG) diff --git a/tools/scripts/make_rootfs/rootfs.sh b/tools/scripts/make_rootfs/rootfs.sh deleted file mode 100755 index e1c46223..00000000 --- a/tools/scripts/make_rootfs/rootfs.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. -# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, -# are permitted provided that the following conditions are met: -# -# 1. Redistributions of source code must retain the above copyright notice, this list of -# conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright notice, this list -# of conditions and the following disclaimer in the documentation and/or other materials -# provided with the distribution. -# -# 3. Neither the name of the copyright holder nor the names of its contributors may be used -# to endorse or promote products derived from this software without specific prior written -# permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -set -e - -BIN_DIR=$1 -LIB_DIR=$2 -ROOTFS_DIR=$3 -FSTYPE=$4 -CUR_DIR=$(dirname $(readlink -f "$0")) -. ${CUR_DIR}/rootfsdir.sh ${BIN_DIR} ${LIB_DIR} ${ROOTFS_DIR} -. ${CUR_DIR}/rootfsimg.sh ${ROOTFS_DIR} ${FSTYPE} \ No newline at end of file diff --git a/tools/scripts/make_rootfs/rootfsdir.sh b/tools/scripts/make_rootfs/rootfsdir.sh index 35c553e4..a7c571e4 100755 --- a/tools/scripts/make_rootfs/rootfsdir.sh +++ b/tools/scripts/make_rootfs/rootfsdir.sh @@ -30,14 +30,17 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. set -e -BIN_DIR=$1 -LIB_DIR=$2 -ROOTFS_DIR=$3 -OUT_DIR=$4 +OUT=$1 +ROOTFS_DIR=$2 +OUT_DIR=$3 +BIN_DIR=${OUT}/bin +LIB_DIR=${OUT}/musl +ETC_DIR=${OUT}/etc NEED_COPYTO_OUTDIR=(shell toybox mksh tftp) + mkdir -p ${ROOTFS_DIR}/bin ${ROOTFS_DIR}/lib ${ROOTFS_DIR}/usr/bin ${ROOTFS_DIR}/usr/lib ${ROOTFS_DIR}/etc \ ${ROOTFS_DIR}/app ${ROOTFS_DIR}/data ${ROOTFS_DIR}/proc ${ROOTFS_DIR}/dev ${ROOTFS_DIR}/data/system ${ROOTFS_DIR}/data/system/param \ -${ROOTFS_DIR}/system ${ROOTFS_DIR}/system/internal ${ROOTFS_DIR}/system/external ${OUT_DIR}/bin ${OUT_DIR}/libs +${ROOTFS_DIR}/system ${ROOTFS_DIR}/system/internal ${ROOTFS_DIR}/system/external ${OUT_DIR}/bin ${OUT_DIR}/libs ${OUT_DIR}/etc if [ -d "${BIN_DIR}" ] && [ "$(ls -A "${BIN_DIR}")" != "" ]; then cp -f ${BIN_DIR}/* ${ROOTFS_DIR}/bin for el in ${NEED_COPYTO_OUTDIR[@]} @@ -49,3 +52,8 @@ if [ -d "${BIN_DIR}" ] && [ "$(ls -A "${BIN_DIR}")" != "" ]; then fi cp -f ${LIB_DIR}/* ${ROOTFS_DIR}/lib cp -f ${LIB_DIR}/* ${OUT_DIR}/libs + +if [ -e ${ETC_DIR} ]; then +cp -f ${ETC_DIR}/.mkshrc ${ROOTFS_DIR}/etc +cp -f ${ETC_DIR}/.mkshrc ${OUT_DIR}/etc +fi From 8729f6ee57ea57bc664d076ff112c8726fedded9 Mon Sep 17 00:00:00 2001 From: Far Date: Tue, 20 Jul 2021 15:12:58 +0800 Subject: [PATCH 34/43] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0mount=E7=9A=84M?= =?UTF-8?q?S=5FRDONLY=E6=A0=87=E5=BF=97=E7=9A=84=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增加mount的MS_RDONLY标志的支持,并修改vfs主要接口相关支持。 1. fatfs lseek接口在分区以MS_RDONLY方式和文件以只读打开时不再能够扩大文件的大小。 2. 直接在镜像中创建storage目录,而不是在挂载根文件系统时创建storage目录。 3. 增加了MS_RDONLY的测试用例。 Close #I3Z1W6 Signed-off-by: Far --- fs/fat/os_adapt/fatfs.c | 17 +++- fs/jffs2/src/vfs_jffs2.c | 2 +- fs/vfs/operation/fs_chattr.c | 7 ++ fs/vfs/operation/fs_utime.c | 8 ++ kernel/common/los_rootfs.c | 19 +++- testsuites/unittest/fs/BUILD.gn | 3 + testsuites/unittest/fs/jffs/It_vfs_jffs.h | 3 + .../full/It_vfs_test_mount_rdonly_001.cpp | 93 ++++++++++++++++++ .../full/It_vfs_test_mount_rdonly_002.cpp | 79 +++++++++++++++ .../full/It_vfs_test_mount_rdonly_003.cpp | 95 +++++++++++++++++++ testsuites/unittest/fs/jffs/vfs_jffs_test.cpp | 15 +++ 11 files changed, 333 insertions(+), 8 deletions(-) create mode 100644 testsuites/unittest/fs/jffs/full/It_vfs_test_mount_rdonly_001.cpp create mode 100644 testsuites/unittest/fs/jffs/full/It_vfs_test_mount_rdonly_002.cpp create mode 100644 testsuites/unittest/fs/jffs/full/It_vfs_test_mount_rdonly_003.cpp diff --git a/fs/fat/os_adapt/fatfs.c b/fs/fat/os_adapt/fatfs.c index 1876af94..b6c02f02 100644 --- a/fs/fat/os_adapt/fatfs.c +++ b/fs/fat/os_adapt/fatfs.c @@ -46,6 +46,7 @@ #include "los_tables.h" #include "user_copy.h" #include "los_vm_filemap.h" +#include "los_hash.h" #include #include #include @@ -53,7 +54,7 @@ #include #include #include -#include "los_hash.h" +#include struct VnodeOps fatfs_vops; /* forward define */ @@ -190,7 +191,7 @@ static int fatfs_sync(unsigned long mountflags, FATFS *fs) { #ifdef LOSCFG_FS_FAT_CACHE los_part *part = NULL; - if (mountflags != MS_NOSYNC) { + if (!(mountflags & (MS_NOSYNC | MS_RDONLY))) { part = get_part((INT)fs->pdrv); if (part == NULL) { return -ENODEV; @@ -736,6 +737,7 @@ off64_t fatfs_lseek64(struct file *filep, off64_t offset, int whence) struct Vnode *vp = filep->f_vnode; DIR_FILE *dfp = (DIR_FILE *)vp->data; FILINFO *finfo = &(dfp->fno); + struct Mount *mount = vp->originMount; FSIZE_t fpos; FRESULT result; int ret; @@ -773,6 +775,17 @@ off64_t fatfs_lseek64(struct file *filep, off64_t offset, int whence) if (ret == FALSE) { return -EBUSY; } + + if (fpos > finfo->fsize) { + if ((filep->f_oflags & O_ACCMODE) == O_RDONLY) { + result = FR_DENIED; + goto ERROR_EXIT; + } + if (mount->mountFlags & MS_RDONLY) { + result = FR_WRITE_PROTECTED; + goto ERROR_EXIT; + } + } fp->obj.sclust = finfo->sclst; fp->obj.objsize = finfo->fsize; diff --git a/fs/jffs2/src/vfs_jffs2.c b/fs/jffs2/src/vfs_jffs2.c index 234c435a..63cbf3c6 100644 --- a/fs/jffs2/src/vfs_jffs2.c +++ b/fs/jffs2/src/vfs_jffs2.c @@ -123,7 +123,7 @@ int VfsJffs2Bind(struct Mount *mnt, struct Vnode *blkDriver, const void *data) partNo = p->patitionnum; - ret = jffs2_mount(partNo, &rootNode); + ret = jffs2_mount(partNo, &rootNode, mnt->mountFlags); if (ret != 0) { LOS_MuxUnlock(&g_jffs2FsLock); return ret; diff --git a/fs/vfs/operation/fs_chattr.c b/fs/vfs/operation/fs_chattr.c index d01aee31..04caf82b 100644 --- a/fs/vfs/operation/fs_chattr.c +++ b/fs/vfs/operation/fs_chattr.c @@ -41,6 +41,8 @@ #include "stdlib.h" #include "sys/stat.h" #include "vnode.h" +#include "fs/mount.h" +#include /**************************************************************************** * Static Functions @@ -69,6 +71,11 @@ int chattr(const char *pathname, struct IATTR *attr) goto errout_with_lock; } + if ((vnode->originMount) && (vnode->originMount->mountFlags & MS_RDONLY)) { + ret = -EROFS; + goto errout_with_lock; + } + /* The way we handle the stat depends on the type of vnode that we * are dealing with. */ diff --git a/fs/vfs/operation/fs_utime.c b/fs/vfs/operation/fs_utime.c index 8bab3155..31cf98e2 100644 --- a/fs/vfs/operation/fs_utime.c +++ b/fs/vfs/operation/fs_utime.c @@ -37,9 +37,11 @@ #include "vfs_config.h" #include "sys/stat.h" #include "vnode.h" +#include "fs/mount.h" #include "string.h" #include "stdlib.h" #include "utime.h" +#include /**************************************************************************** * Global Functions @@ -79,6 +81,12 @@ int utime(const char *path, const struct utimbuf *ptimes) goto errout_with_path; } + if ((vnode->originMount) && (vnode->originMount->mountFlags & MS_RDONLY)) { + VnodeDrop(); + ret = -EROFS; + goto errout_with_path; + } + if (vnode->vop && vnode->vop->Chattr) { if (ptimes == NULL) { /* get current seconds */ diff --git a/kernel/common/los_rootfs.c b/kernel/common/los_rootfs.c index 8369f709..e9b19849 100644 --- a/kernel/common/los_rootfs.c +++ b/kernel/common/los_rootfs.c @@ -156,10 +156,11 @@ STATIC INT32 AddPartitions(CHAR *dev, UINT64 rootAddr, UINT64 rootSize, UINT64 u } -STATIC INT32 ParseRootArgs(CHAR **dev, CHAR **fstype, UINT64 *rootAddr, UINT64 *rootSize) { +STATIC INT32 ParseRootArgs(CHAR **dev, CHAR **fstype, UINT64 *rootAddr, UINT64 *rootSize, UINT32 *mountFlags) { INT32 ret; CHAR *rootAddrStr; CHAR *rootSizeStr; + CHAR *rwTag; ret = LOS_GetArgValue("root", dev); if (ret != LOS_OK) { @@ -186,6 +187,13 @@ STATIC INT32 ParseRootArgs(CHAR **dev, CHAR **fstype, UINT64 *rootAddr, UINT64 * } else { *rootSize = LOS_SizeStrToNum(rootSizeStr); } + + ret = LOS_GetArgValue("ro", &rwTag); + if (ret == LOS_OK) { + *mountFlags = MS_RDONLY; + } else { + *mountFlags = 0; + } return LOS_OK; } @@ -212,12 +220,12 @@ STATIC INT32 ParseUserArgs(UINT64 rootAddr, UINT64 rootSize, UINT64 *userAddr, U return LOS_OK; } -STATIC INT32 MountPartitions(CHAR *fsType) { +STATIC INT32 MountPartitions(CHAR *fsType, UINT32 mountFlags) { INT32 ret; INT32 err; /* Mount rootfs */ - ret = mount(ROOT_DEV_NAME, ROOT_DIR_NAME, fsType, MS_RDONLY, NULL); + ret = mount(ROOT_DEV_NAME, ROOT_DIR_NAME, fsType, mountFlags, NULL); if (ret != LOS_OK) { err = get_errno(); PRINT_ERR("Failed to mount %s, rootDev %s, errno %d: %s\n", ROOT_DIR_NAME, ROOT_DEV_NAME, err, strerror(err)); @@ -291,8 +299,9 @@ INT32 OsMountRootfs() { UINT64 rootSize; UINT64 userAddr; UINT64 userSize; + UINT32 mountFlags; - ret = ParseRootArgs(&dev, &fstype, &rootAddr, &rootSize); + ret = ParseRootArgs(&dev, &fstype, &rootAddr, &rootSize, &mountFlags); if (ret != LOS_OK) { return ret; } @@ -312,7 +321,7 @@ INT32 OsMountRootfs() { return ret; } - ret = MountPartitions(fstype); + ret = MountPartitions(fstype, mountFlags); if (ret != LOS_OK) { return ret; } diff --git a/testsuites/unittest/fs/BUILD.gn b/testsuites/unittest/fs/BUILD.gn index bc1b6d76..468b795e 100644 --- a/testsuites/unittest/fs/BUILD.gn +++ b/testsuites/unittest/fs/BUILD.gn @@ -790,6 +790,9 @@ sources_full = [ "jffs/full/It_vfs_test_symlink_002.cpp", "jffs/full/It_vfs_test_symlink_003.cpp", "jffs/full/It_vfs_test_symlinkat_001.cpp", + "jffs/full/It_vfs_test_mount_rdonly_001.cpp", + "jffs/full/It_vfs_test_mount_rdonly_002.cpp", + "jffs/full/It_vfs_test_mount_rdonly_003.cpp", ] if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) { diff --git a/testsuites/unittest/fs/jffs/It_vfs_jffs.h b/testsuites/unittest/fs/jffs/It_vfs_jffs.h index a64eddb8..41d89e57 100644 --- a/testsuites/unittest/fs/jffs/It_vfs_jffs.h +++ b/testsuites/unittest/fs/jffs/It_vfs_jffs.h @@ -962,6 +962,9 @@ VOID ItFsTestSymlink001(VOID); VOID ItFsTestSymlink002(VOID); VOID ItFsTestSymlink003(VOID); VOID ItFsTestSymlinkat001(VOID); +VOID ItFsTestMountRdonly001(VOID); +VOID ItFsTestMountRdonly002(VOID); +VOID ItFsTestMountRdonly003(VOID); #endif #if defined(LOSCFG_USER_TESTSUIT_SHELL) diff --git a/testsuites/unittest/fs/jffs/full/It_vfs_test_mount_rdonly_001.cpp b/testsuites/unittest/fs/jffs/full/It_vfs_test_mount_rdonly_001.cpp new file mode 100644 index 00000000..338927ad --- /dev/null +++ b/testsuites/unittest/fs/jffs/full/It_vfs_test_mount_rdonly_001.cpp @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "It_vfs_jffs.h" + +static UINT32 testcase(VOID) +{ + INT32 fd = -1; + INT32 ret; + CHAR pathname1[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME0 }; + CHAR pathname2[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME01 }; + + fd = creat(pathname1, 0777); + ICUNIT_GOTO_NOT_EQUAL(fd, JFFS_IS_ERROR, fd, EXIT); + + ret = close(fd); + ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT4); + + ret = umount(JFFS_MAIN_DIR0); + ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT3); + + ret = mount(JFFS_DEV_PATH0, JFFS_MAIN_DIR0, JFFS_FILESYS_TYPE, MS_RDONLY, NULL); + ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT2); + + fd = open(pathname1, O_RDWR); + ICUNIT_GOTO_EQUAL(fd, JFFS_IS_ERROR, fd, EXIT4); + + ret = symlink(pathname1, pathname2); + ICUNIT_GOTO_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT5); + + ret = rename(pathname1, pathname2); + ICUNIT_GOTO_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT5); + + ret = unlink(pathname1); + ICUNIT_GOTO_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT3); + + ret = umount(JFFS_MAIN_DIR0); + ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT3); + + ret = mount(JFFS_DEV_PATH0, JFFS_MAIN_DIR0, JFFS_FILESYS_TYPE, 0, NULL); + ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT2); + + ret = unlink(pathname1); + ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT1); + + return JFFS_NO_ERROR; + +EXIT5: + unlink(pathname2); + goto EXIT3; +EXIT4: + close(fd); +EXIT3: + umount(JFFS_MAIN_DIR0); +EXIT2: + mount(JFFS_DEV_PATH0, JFFS_MAIN_DIR0, JFFS_FILESYS_TYPE, 0, NULL); +EXIT1: + unlink(pathname1); +EXIT: + return JFFS_NO_ERROR; +} + +VOID ItFsTestMountRdonly001(VOID) +{ + TEST_ADD_CASE("IT_FS_TEST_MOUNT_RDONLY_001", testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL0, TEST_FUNCTION); +} \ No newline at end of file diff --git a/testsuites/unittest/fs/jffs/full/It_vfs_test_mount_rdonly_002.cpp b/testsuites/unittest/fs/jffs/full/It_vfs_test_mount_rdonly_002.cpp new file mode 100644 index 00000000..7fc30971 --- /dev/null +++ b/testsuites/unittest/fs/jffs/full/It_vfs_test_mount_rdonly_002.cpp @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "It_vfs_jffs.h" + +static UINT32 testcase(VOID) +{ + INT32 fd = -1; + INT32 ret; + CHAR pathname1[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME0 }; + + ret = umount(JFFS_MAIN_DIR0); + ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT); + + ret = mount(JFFS_DEV_PATH0, JFFS_MAIN_DIR0, JFFS_FILESYS_TYPE, MS_RDONLY, NULL); + ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT1); + + fd = creat(pathname1, 0755); + ICUNIT_GOTO_EQUAL(fd, JFFS_IS_ERROR, fd, EXIT3); + + fd = open(pathname1, O_CREAT | O_RDONLY, 0755); + ICUNIT_GOTO_EQUAL(fd, JFFS_IS_ERROR, fd, EXIT3); + + fd = open(pathname1, O_CREAT | O_RDWR, 0755); + ICUNIT_GOTO_EQUAL(fd, JFFS_IS_ERROR, fd, EXIT3); + + ret = mkdir(pathname1, 0755); + ICUNIT_GOTO_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT2); + + ret = umount(JFFS_MAIN_DIR0); + ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT1); + + ret = mount(JFFS_DEV_PATH0, JFFS_MAIN_DIR0, JFFS_FILESYS_TYPE, 0, NULL); + ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT1); + + return JFFS_NO_ERROR; + +EXIT3: + close(fd); +EXIT2: + remove(pathname1); +EXIT1: + umount(JFFS_MAIN_DIR0); + mount(JFFS_DEV_PATH0, JFFS_MAIN_DIR0, JFFS_FILESYS_TYPE, 0, NULL); +EXIT: + return JFFS_NO_ERROR; +} + +VOID ItFsTestMountRdonly002(VOID) +{ + TEST_ADD_CASE("IT_FS_TEST_MOUNT_RDONLY_002", testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL0, TEST_FUNCTION); +} \ No newline at end of file diff --git a/testsuites/unittest/fs/jffs/full/It_vfs_test_mount_rdonly_003.cpp b/testsuites/unittest/fs/jffs/full/It_vfs_test_mount_rdonly_003.cpp new file mode 100644 index 00000000..68cd07aa --- /dev/null +++ b/testsuites/unittest/fs/jffs/full/It_vfs_test_mount_rdonly_003.cpp @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "It_vfs_jffs.h" + +static UINT32 testcase(VOID) +{ + INT32 fd = -1; + INT32 ret; + CHAR readbuf[JFFS_STANDARD_NAME_LENGTH] = {0}; + const CHAR writebuf[JFFS_STANDARD_NAME_LENGTH] = "0123456789"; + CHAR pathname1[JFFS_STANDARD_NAME_LENGTH] = { JFFS_PATH_NAME0 }; + + fd = creat(pathname1, 0777); + ICUNIT_GOTO_NOT_EQUAL(fd, JFFS_IS_ERROR, fd, EXIT); + + ret = write(fd, writebuf, strlen(writebuf)); + ICUNIT_GOTO_EQUAL(ret, strlen(writebuf), ret, EXIT4); + + ret = close(fd); + ICUNIT_GOTO_EQUAL(ret, JFFS_NO_ERROR, ret, EXIT4); + + ret = umount(JFFS_MAIN_DIR0); + ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT3); + + ret = mount(JFFS_DEV_PATH0, JFFS_MAIN_DIR0, JFFS_FILESYS_TYPE, MS_RDONLY, NULL); + ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT2); + + fd = open(pathname1, O_RDWR); + ICUNIT_GOTO_EQUAL(fd, JFFS_IS_ERROR, fd, EXIT4); + + fd = open(pathname1, O_RDONLY); + ICUNIT_GOTO_NOT_EQUAL(fd, JFFS_IS_ERROR, fd, EXIT4); + + ret = read(fd, readbuf, strlen(writebuf)); + ICUNIT_GOTO_EQUAL(ret, strlen(writebuf), ret, EXIT4); + ICUNIT_GOTO_STRING_EQUAL(readbuf, writebuf, readbuf, EXIT4); + + ret = close(fd); + ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT4); + + ret = umount(JFFS_MAIN_DIR0); + ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT3); + + ret = mount(JFFS_DEV_PATH0, JFFS_MAIN_DIR0, JFFS_FILESYS_TYPE, 0, NULL); + ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT2); + + ret = unlink(pathname1); + ICUNIT_GOTO_NOT_EQUAL(ret, JFFS_IS_ERROR, ret, EXIT1); + + return JFFS_NO_ERROR; + +EXIT4: + close(fd); +EXIT3: + umount(JFFS_MAIN_DIR0); +EXIT2: + mount(JFFS_DEV_PATH0, JFFS_MAIN_DIR0, JFFS_FILESYS_TYPE, 0, NULL); +EXIT1: + unlink(pathname1); +EXIT: + return JFFS_NO_ERROR; +} + +VOID ItFsTestMountRdonly003(VOID) +{ + TEST_ADD_CASE("IT_FS_TEST_MOUNT_RDONLY_003", testcase, TEST_VFS, TEST_JFFS, TEST_LEVEL0, TEST_FUNCTION); +} \ No newline at end of file diff --git a/testsuites/unittest/fs/jffs/vfs_jffs_test.cpp b/testsuites/unittest/fs/jffs/vfs_jffs_test.cpp index ccd3ab4d..5c66f8ab 100644 --- a/testsuites/unittest/fs/jffs/vfs_jffs_test.cpp +++ b/testsuites/unittest/fs/jffs/vfs_jffs_test.cpp @@ -6885,6 +6885,21 @@ HWTEST_F(VfsJffsTest, ItFsTestSymlinkat001, TestSize.Level0) ItFsTestSymlinkat001(); } +HWTEST_F(VfsJffsTest, ItFsTestMountRdonly001, TestSize.Level0) +{ + ItFsTestMountRdonly001(); +} + +HWTEST_F(VfsJffsTest, ItFsTestMountRdonly002, TestSize.Level0) +{ + ItFsTestMountRdonly002(); +} + +HWTEST_F(VfsJffsTest, ItFsTestMountRdonly003, TestSize.Level0) +{ + ItFsTestMountRdonly003(); +} + #endif #if defined(LOSCFG_USER_TEST_SMOKE) /* * From 14bd753aa8beb49af887c8d0aedaefa446409760 Mon Sep 17 00:00:00 2001 From: chenjing Date: Tue, 20 Jul 2021 19:28:06 +0800 Subject: [PATCH 35/43] =?UTF-8?q?fix:=20OsGetArgsAddr=E5=A3=B0=E6=98=8E?= =?UTF-8?q?=E6=89=80=E5=9C=A8=E5=A4=B4=E6=96=87=E4=BB=B6=E4=B8=8D=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit close #I41MWM Signed-off-by: chenjing Change-Id: Iad136b3b8b63fed63fa69c594ec39bd90d5513b7 --- kernel/common/los_bootargs.c | 1 - kernel/common/los_bootargs.h | 3 +++ kernel/common/los_rootfs.h | 5 ----- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/kernel/common/los_bootargs.c b/kernel/common/los_bootargs.c index 03868dc7..815a27c4 100644 --- a/kernel/common/los_bootargs.c +++ b/kernel/common/los_bootargs.c @@ -200,7 +200,6 @@ INT32 LOS_GetArgValue(CHAR *argName, CHAR **argValue) { return LOS_NOK; } - UINT64 LOS_GetAlignsize() { return g_alignSize; } diff --git a/kernel/common/los_bootargs.h b/kernel/common/los_bootargs.h index caae9d70..3cb73d0c 100644 --- a/kernel/common/los_bootargs.h +++ b/kernel/common/los_bootargs.h @@ -55,4 +55,7 @@ INT32 LOS_GetArgValue(CHAR *argName, CHAR **argValue); UINT64 LOS_GetAlignsize(VOID); UINT64 LOS_SizeStrToNum(CHAR *value); +#ifdef LOSCFG_BOOTENV_RAM +CHAR *OsGetArgsAddr(VOID); +#endif #endif /* _LOS_BOOTARGS_H */ \ No newline at end of file diff --git a/kernel/common/los_rootfs.h b/kernel/common/los_rootfs.h index dc325541..9f3aebef 100644 --- a/kernel/common/los_rootfs.h +++ b/kernel/common/los_rootfs.h @@ -80,10 +80,5 @@ #endif INT32 OsMountRootfs(VOID); -VOID OsSetCmdLineAddr(UINT64 addr); -UINT64 OsGetCmdLineAddr(VOID); -#ifdef LOSCFG_BOOTENV_RAM -CHAR *OsGetArgsAddr(VOID); -#endif #endif /* _LOS_ROOTFS_H */ From 2ff44c4938d2e66ce60e9497c505eb6e97efc8c2 Mon Sep 17 00:00:00 2001 From: wangchen <253227059@qq.com> Date: Fri, 16 Jul 2021 19:26:47 +0800 Subject: [PATCH 36/43] =?UTF-8?q?fix:=20L1=20toybox=20=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【背景】 解决toybox已支持命令的遗留问题,新增命令功能。 【修改方案】 1. 在内核态对toybox的系统调用进行支持。 【影响】 对现有的产品编译不会有影响。 re #I41N2A Signed-off-by: wangchen <253227059@qq.com> --- compat/posix/src/misc.c | 16 ++- syscall/fs_syscall.c | 260 ++++++++++++++++++++++++++++++++++++--- syscall/los_syscall.c | 1 - syscall/los_syscall.h | 5 + syscall/syscall_lookup.h | 6 + syscall/syscall_pub.c | 65 ++++++++++ syscall/syscall_pub.h | 5 + 7 files changed, 337 insertions(+), 21 deletions(-) diff --git a/compat/posix/src/misc.c b/compat/posix/src/misc.c index e740930f..39337571 100644 --- a/compat/posix/src/misc.c +++ b/compat/posix/src/misc.c @@ -36,7 +36,7 @@ #include "sys/utsname.h" #include "mqueue.h" #include "semaphore.h" - +#include "los_hw.h" /* * Supply some suitable values for constants that may not be present @@ -52,17 +52,27 @@ int uname(struct utsname *name) { INT32 ret; + const char *cpuInfo = NULL; + if (name == NULL) { return -EFAULT; } (VOID)strncpy_s(name->sysname, sizeof(name->sysname), KERNEL_NAME, strlen(KERNEL_NAME) + 1); (VOID)strncpy_s(name->nodename, sizeof(name->nodename), "hisilicon", strlen("hisilicon") + 1); - ret = snprintf_s(name->version, sizeof(name->version), sizeof(name->version) - 1, "%s %u.%u.%u.%u %s %s\n", + ret = snprintf_s(name->version, sizeof(name->version), sizeof(name->version) - 1, "%s %u.%u.%u.%u %s %s", KERNEL_NAME, KERNEL_MAJOR, KERNEL_MINOR, KERNEL_PATCH, KERNEL_ITRE, __DATE__, __TIME__); if (ret < 0) { return -EIO; } - name->machine[0] = '\0'; + + cpuInfo = LOS_CpuInfo(); + (VOID)strncpy_s(name->machine, sizeof(name->machine), cpuInfo, sizeof(name->machine)); + ret = snprintf_s(name->release, sizeof(name->release), sizeof(name->release) - 1, "%u.%u.%u.%u", + KERNEL_MAJOR, KERNEL_MINOR, KERNEL_PATCH, KERNEL_ITRE); + if (ret < 0) { + return -EIO; + } + name->domainname[0] = '\0'; return 0; } diff --git a/syscall/fs_syscall.c b/syscall/fs_syscall.c index b424b05b..0aff7b7b 100644 --- a/syscall/fs_syscall.c +++ b/syscall/fs_syscall.c @@ -29,11 +29,13 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "syscall_pub.h" #ifdef LOSCFG_FS_VFS #include "errno.h" #include "unistd.h" #include "fs/fd_table.h" #include "fs/file.h" +#include "fs/fs.h" #include "fs/fs_operation.h" #include "sys/mount.h" #include "los_task_pri.h" @@ -56,29 +58,77 @@ #include "sys/statfs.h" #define HIGH_SHIFT_BIT 32 +#define TIMESPEC_TIMES_NUM 2 -static int UserPathCopy(const char *userPath, char **pathBuf) +static int CheckNewAttrTime(struct IATTR *attr, struct timespec times[TIMESPEC_TIMES_NUM]) +{ + int ret = ENOERR; + struct timespec stp = {0}; + + if (times) { + if (times[0].tv_nsec == UTIME_OMIT) { + attr->attr_chg_valid &= ~CHG_ATIME; + } else if (times[0].tv_nsec == UTIME_NOW) { + ret = clock_gettime(CLOCK_REALTIME, &stp); + if (ret < 0) { + return -get_errno(); + } + attr->attr_chg_atime = (unsigned int)stp.tv_sec; + attr->attr_chg_valid |= CHG_ATIME; + } else { + attr->attr_chg_atime = (unsigned int)times[0].tv_sec; + attr->attr_chg_valid |= CHG_ATIME; + } + + if (times[1].tv_nsec == UTIME_OMIT) { + attr->attr_chg_valid &= ~CHG_MTIME; + } else if (times[1].tv_nsec == UTIME_NOW) { + ret = clock_gettime(CLOCK_REALTIME, &stp); + if (ret < 0) { + return -get_errno(); + } + attr->attr_chg_mtime = (unsigned int)stp.tv_sec; + attr->attr_chg_valid |= CHG_MTIME; + } else { + attr->attr_chg_mtime = (unsigned int)times[1].tv_sec; + attr->attr_chg_valid |= CHG_MTIME; + } + } else { + ret = clock_gettime(CLOCK_REALTIME, &stp); + if (ret < 0) { + return -get_errno(); + } + attr->attr_chg_atime = (unsigned int)stp.tv_sec; + attr->attr_chg_mtime = (unsigned int)stp.tv_sec; + attr->attr_chg_valid |= CHG_ATIME; + attr->attr_chg_valid |= CHG_MTIME; + } + + return ret; +} + +static int GetFullpathNull(int fd, const char *path, char **filePath) { int ret; + char *fullPath = NULL; + struct file *file = NULL; - *pathBuf = (char *)LOS_MemAlloc(OS_SYS_MEM_ADDR, PATH_MAX + 1); - if (*pathBuf == NULL) { - return -ENOMEM; + if ((fd != AT_FDCWD) && (path == NULL)) { + fd = GetAssociatedSystemFd(fd); + ret = fs_getfilep(fd, &file); + if (ret < 0) { + return -get_errno(); + } + fullPath = file->f_path; + } else { + ret = GetFullpath(fd, path, &fullPath); + if (ret < 0) { + return ret; + } } - ret = LOS_StrncpyFromUser(*pathBuf, userPath, PATH_MAX + 1); - if (ret < 0) { - (void)LOS_MemFree(OS_SYS_MEM_ADDR, *pathBuf); - *pathBuf = NULL; - return ret; - } else if (ret > PATH_MAX) { - (void)LOS_MemFree(OS_SYS_MEM_ADDR, *pathBuf); - *pathBuf = NULL; - return -ENAMETOOLONG; - } - (*pathBuf)[ret] = '\0'; - - return 0; + *filePath = fullPath; + return ret; } static int UserIovItemCheck(const struct iovec *iov, const int iovcnt) @@ -2124,6 +2174,37 @@ OUT: return result; } +int SysUtimensat(int fd, const char *path, struct timespec times[TIMESPEC_TIMES_NUM], int flag) +{ + int ret; + int timeLen; + struct IATTR attr = {0}; + char *filePath = NULL; + + timeLen = TIMESPEC_TIMES_NUM * sizeof(struct timespec); + CHECK_ASPACE(times, timeLen); + DUP_FROM_USER(times, timeLen); + ret = CheckNewAttrTime(&attr, times); + FREE_DUP(times); + if (ret < 0) { + goto OUT; + } + + ret = GetFullpathNull(fd, path, &filePath); + if (ret < 0) { + goto OUT; + } + + ret = chattr(filePath, &attr); + if (ret < 0) { + ret = -get_errno(); + } + +OUT: + PointerFree(filePath); + return ret; +} + int SysChmod(const char *pathname, mode_t mode) { int ret; @@ -2148,6 +2229,112 @@ OUT: return ret; } +int SysFchmodat(int fd, const char *path, mode_t mode, int flag) +{ + int ret; + char *pathRet = NULL; + char *fullpath = NULL; + struct IATTR attr = { + .attr_chg_mode = mode, + .attr_chg_valid = CHG_MODE, + }; + + if (path != NULL) { + ret = UserPathCopy(path, &pathRet); + if (ret != 0) { + goto OUT; + } + } + + if (fd != AT_FDCWD) { + /* Process fd convert to system global fd */ + fd = GetAssociatedSystemFd(fd); + } + + ret = vfs_normalize_pathat(fd, pathRet, &fullpath); + if (ret < 0) { + goto OUT; + } + + ret = chattr(fullpath, &attr); + if (ret < 0) { + ret = -get_errno(); + } + +OUT: + PointerFree(pathRet); + PointerFree(fullpath); + + return ret; +} + +int SysFchownat(int fd, const char *path, uid_t owner, gid_t group, int flag) +{ + int ret; + char *fullpath = NULL; + struct IATTR attr = { + .attr_chg_valid = 0, + }; + + ret = GetFullpath(fd, path, &fullpath); + if (ret < 0) { + goto OUT; + } + + if (owner != (uid_t)-1) { + attr.attr_chg_uid = owner; + attr.attr_chg_valid |= CHG_UID; + } + if (group != (gid_t)-1) { + attr.attr_chg_gid = group; + attr.attr_chg_valid |= CHG_GID; + } + + ret = chattr(fullpath, &attr); + if (ret < 0) { + ret = -get_errno(); + } + +OUT: + PointerFree(fullpath); + + return ret; +} + +int SysFchown(int fd, uid_t owner, gid_t group) +{ + int ret; + int sysFd; + struct IATTR attr = {0}; + attr.attr_chg_valid = 0; + struct file *file = NULL; + + sysFd = GetAssociatedSystemFd(fd); + if (sysFd < 0) { + return -EBADF; + } + + ret = fs_getfilep(sysFd, &file); + if (ret < 0) { + return -get_errno(); + } + + if (owner != (uid_t)-1) { + attr.attr_chg_uid = owner; + attr.attr_chg_valid |= CHG_UID; + } + if (group != (gid_t)-1) { + attr.attr_chg_gid = group; + attr.attr_chg_valid |= CHG_GID; + } + ret = chattr(file->f_path, &attr); + if (ret < 0) { + ret = -get_errno(); + } + + return ret; +} + int SysChown(const char *pathname, uid_t owner, gid_t group) { int ret; @@ -2218,4 +2405,43 @@ OUT: } return ret; } + +int SysFaccessat(int fd, const char *filename, int amode, int flag) +{ + int ret; + struct stat buf; + struct statfs fsBuf; + char *fullDirectory = NULL; + + ret = GetFullpath(fd, filename, &fullDirectory); + if (ret < 0) { + goto OUT; + } + + ret = statfs(fullDirectory, &fsBuf); + if (ret != 0) { + ret = -get_errno(); + goto OUT; + } + + if ((fsBuf.f_flags & MS_RDONLY) && ((unsigned int)amode & W_OK)) { + ret = -EROFS; + goto OUT; + } + + ret = stat(fullDirectory, &buf); + if (ret != 0) { + ret = -get_errno(); + goto OUT; + } + + if (VfsPermissionCheck(buf.st_uid, buf.st_gid, buf.st_mode, amode)) { + ret = -EACCES; + } + +OUT: + PointerFree(fullDirectory); + + return ret; +} #endif diff --git a/syscall/los_syscall.c b/syscall/los_syscall.c index b590c97a..6761fff7 100644 --- a/syscall/los_syscall.c +++ b/syscall/los_syscall.c @@ -32,7 +32,6 @@ #define _GNU_SOURCE #ifdef LOSCFG_FS_VFS #include "fs/file.h" -#include "fs/file.h" #endif #include "los_init.h" #include "los_signal.h" diff --git a/syscall/los_syscall.h b/syscall/los_syscall.h index 37429b88..c756916f 100644 --- a/syscall/los_syscall.h +++ b/syscall/los_syscall.h @@ -230,7 +230,11 @@ extern ssize_t SysReadlinkat(int dirfd, const char *pathname, char *buf, size_t extern int SysUnlink( const char *pathname); extern int SysExecve(const char *fileName, char *const *argv, char *const *envp); extern int SysChdir(const char *path); +extern int SysUtimensat(int fd, const char *path, struct timespec times[2], int flag); +extern int SysFchmodat(int fd, const char *path, mode_t mode, int flag); extern int SysChmod(const char *path, mode_t mode); +extern int SysFchownat(int fd, const char *path, uid_t owner, gid_t group, int flag); +extern int SysFchown(int fd, uid_t owner, gid_t group); extern int SysChown(const char *pathname, uid_t owner, gid_t group); extern off_t SysLseek(int fd, off_t offset, int whence); extern off64_t SysLseek64(int fd, int offsetHigh, int offsetLow, off64_t *result, int whence); @@ -238,6 +242,7 @@ extern int SysMount(const char *source, const char *target, const char *filesyst const void *data); extern int SysUmount(const char *target); extern int SysAccess(const char *path, int amode); +extern int SysFaccessat(int fd, const char *filename, int amode, int flag); extern int SysRename(const char *oldpath, const char *newpath); extern int SysMkdir(const char *pathname, mode_t mode); extern int SysRmdir(const char *pathname); diff --git a/syscall/syscall_lookup.h b/syscall/syscall_lookup.h index 236f7a25..44190732 100644 --- a/syscall/syscall_lookup.h +++ b/syscall/syscall_lookup.h @@ -48,11 +48,15 @@ SYSCALL_HAND_DEF(__NR_execve, SysExecve, int, ARG_NUM_3) SYSCALL_HAND_DEF(__NR_sysinfo, SysInfo, int, ARG_NUM_1) SYSCALL_HAND_DEF(__NR_chdir, SysChdir, int, ARG_NUM_1) +SYSCALL_HAND_DEF(__NR_utimensat, SysUtimensat, int, ARG_NUM_4) +SYSCALL_HAND_DEF(__NR_fchmodat, SysFchmodat, int, ARG_NUM_4) +SYSCALL_HAND_DEF(__NR_utimensat, SysUtimensat, int, ARG_NUM_4) SYSCALL_HAND_DEF(__NR_chmod, SysChmod, int, ARG_NUM_2) SYSCALL_HAND_DEF(__NR_lseek, SysLseek, off_t, ARG_NUM_7) /* current only support 32bit max 4G file */ SYSCALL_HAND_DEF(__NR_mount, SysMount, int, ARG_NUM_5) SYSCALL_HAND_DEF(__NR_umount, SysUmount, int, ARG_NUM_1) SYSCALL_HAND_DEF(__NR_access, SysAccess, int, ARG_NUM_2) +SYSCALL_HAND_DEF(__NR_faccessat, SysFaccessat, int, ARG_NUM_4) SYSCALL_HAND_DEF(__NR_sync, SysSync, void, ARG_NUM_0) SYSCALL_HAND_DEF(__NR_rename, SysRename, int, ARG_NUM_2) SYSCALL_HAND_DEF(__NR_mkdir, SysMkdir, int, ARG_NUM_2) @@ -166,6 +170,8 @@ SYSCALL_HAND_DEF(__NR_rt_sigpending, SysSigPending, int, ARG_NUM_1) SYSCALL_HAND_DEF(__NR_rt_sigtimedwait, SysSigTimedWait, int, ARG_NUM_4) SYSCALL_HAND_DEF(__NR_rt_sigsuspend, SysSigSuspend, int, ARG_NUM_1) +SYSCALL_HAND_DEF(__NR_fchownat, SysFchownat, int, ARG_NUM_5) +SYSCALL_HAND_DEF(__NR_fchown32, SysFchown, int, ARG_NUM_3) SYSCALL_HAND_DEF(__NR_chown, SysChown, int, ARG_NUM_3) SYSCALL_HAND_DEF(__NR_chown32, SysChown, int, ARG_NUM_3) #ifdef LOSCFG_SECURITY_CAPABILITY diff --git a/syscall/syscall_pub.c b/syscall/syscall_pub.c index dbfd0f5a..759b74a3 100644 --- a/syscall/syscall_pub.c +++ b/syscall/syscall_pub.c @@ -60,3 +60,68 @@ void *DupUserMem(const void *ptr, size_t len, int needCopy) return p; } + +int GetFullpath(int fd, const char *path, char **fullpath) +{ + int ret = 0; + char *pathRet = NULL; + struct file *file = NULL; + struct stat bufRet = {0}; + + if (path != NULL) { + ret = UserPathCopy(path, &pathRet); + if (ret != 0) { + goto OUT; + } + } + + if ((pathRet != NULL) && (*pathRet == '/')) { + *fullpath = pathRet; + pathRet = NULL; + } else { + if (fd != AT_FDCWD) { + /* Process fd convert to system global fd */ + fd = GetAssociatedSystemFd(fd); + } + ret = fs_getfilep(fd, &file); + if (file) { + ret = stat(file->f_path, &bufRet); + if (!ret) { + if (!S_ISDIR(bufRet.st_mode)) { + set_errno(ENOTDIR); + ret = -ENOTDIR; + goto OUT; + } + } + } + ret = vfs_normalize_pathat(fd, pathRet, fullpath); + } + +OUT: + PointerFree(pathRet); + return ret; +} + +int UserPathCopy(const char *userPath, char **pathBuf) +{ + int ret; + + *pathBuf = (char *)LOS_MemAlloc(OS_SYS_MEM_ADDR, PATH_MAX + 1); + if (*pathBuf == NULL) { + return -ENOMEM; + } + + ret = LOS_StrncpyFromUser(*pathBuf, userPath, PATH_MAX + 1); + if (ret < 0) { + (void)LOS_MemFree(OS_SYS_MEM_ADDR, *pathBuf); + *pathBuf = NULL; + return ret; + } else if (ret > PATH_MAX) { + (void)LOS_MemFree(OS_SYS_MEM_ADDR, *pathBuf); + *pathBuf = NULL; + return -ENAMETOOLONG; + } + (*pathBuf)[ret] = '\0'; + + return 0; +} diff --git a/syscall/syscall_pub.h b/syscall/syscall_pub.h index 52993987..e784a510 100644 --- a/syscall/syscall_pub.h +++ b/syscall/syscall_pub.h @@ -36,9 +36,14 @@ #include "los_vm_lock.h" #include "los_vm_map.h" #include "user_copy.h" +#include "fs/fs.h" +#include "fcntl.h" +#include "los_strncpy_from_user.h" extern int CheckRegion(const LosVmSpace *space, VADDR_T ptr, size_t len); extern void *DupUserMem(const void *ptr, size_t len, int needCopy); +extern int GetFullpath(int fd, const char *path, char **fullpath); +extern int UserPathCopy(const char *userPath, char **pathBuf); #define CHECK_ASPACE(ptr, len, ...) \ do { \ From 35a2f3af33a5dba1e0ba36587efced8fead97223 Mon Sep 17 00:00:00 2001 From: YOUR_NAME Date: Tue, 20 Jul 2021 18:21:36 +0800 Subject: [PATCH 37/43] =?UTF-8?q?fix:=20init=E8=BF=9B=E7=A8=8B=E6=94=B6?= =?UTF-8?q?=E5=88=B0=E5=AD=90=E8=BF=9B=E7=A8=8B=E9=80=80=E5=87=BA=E4=BF=A1?= =?UTF-8?q?=E5=8F=B7=E5=90=8E=EF=BC=8C=E8=B0=83=E7=94=A8fork=E9=87=8D?= =?UTF-8?q?=E6=96=B0=E6=8B=89=E8=B5=B7=E8=BF=9B=E7=A8=8B=EF=BC=8C=E4=BC=9A?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E7=B3=BB=E7=BB=9F=E5=8D=A1=E6=AD=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 问题原因:init进程执行信号时,线程栈底预留了部分空间给信号上下文使用, 从而导致处理信号时线程栈底比线程控制块里面记录的大,这样在fork的过程中内核 从init线程栈底copy线程上下文给新进程时,copy的不是实际运行的栈底,以致于 新进程的线程上下文不对,在实际运行时跑飞,引发系统卡死。 解决方案:在fork过程copy线程上下文时,判断是否预留了信号上下文空间,如果预留 了,则copy的栈底要基于预留后的栈底去copy线程上下文。 close: #I41HOY Signed-off-by: zff Change-Id: I61cb05183c78919730e3a68c1c85b72fa1decd16 --- arch/arm/arm/src/los_hw.c | 10 +++++++++- kernel/base/ipc/los_signal.c | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/arch/arm/arm/src/los_hw.c b/arch/arm/arm/src/los_hw.c index 2db15a42..2c9584b9 100644 --- a/arch/arm/arm/src/los_hw.c +++ b/arch/arm/arm/src/los_hw.c @@ -105,7 +105,15 @@ LITE_OS_SEC_TEXT_INIT VOID *OsTaskStackInit(UINT32 taskID, UINT32 stackSize, VOI LITE_OS_SEC_TEXT VOID OsUserCloneParentStack(VOID *childStack, UINTPTR parentTopOfStack, UINT32 parentStackSize) { - VOID *cloneStack = (VOID *)(((UINTPTR)parentTopOfStack + parentStackSize) - sizeof(TaskContext)); + LosTaskCB *task = OsCurrTaskGet(); + sig_cb *sigcb = &task->sig; + VOID *cloneStack = NULL; + + if (sigcb->sigContext != NULL) { + cloneStack = (VOID *)((UINTPTR)sigcb->sigContext - sizeof(TaskContext)); + } else { + cloneStack = (VOID *)(((UINTPTR)parentTopOfStack + parentStackSize) - sizeof(TaskContext)); + } (VOID)memcpy_s(childStack, sizeof(TaskContext), cloneStack, sizeof(TaskContext)); ((TaskContext *)childStack)->R0 = 0; diff --git a/kernel/base/ipc/los_signal.c b/kernel/base/ipc/los_signal.c index 43285ad4..ec7c5d59 100644 --- a/kernel/base/ipc/los_signal.c +++ b/kernel/base/ipc/los_signal.c @@ -678,6 +678,7 @@ VOID *OsRestorSignalContext(VOID *sp) LosProcessCB *process = OsCurrProcessGet(); VOID *saveContext = sigcb->sigContext; + sigcb->sigContext = NULL; sigcb->count--; process->sigShare = 0; OsProcessExitCodeSignalClear(process); From 58d4366e1d5c3c6a1338665685837c9bca62c661 Mon Sep 17 00:00:00 2001 From: kenneth Date: Wed, 21 Jul 2021 08:47:41 +0800 Subject: [PATCH 38/43] chore: fix function and variable name spell issues fix some spell issues in files under folder kernel/base/core: change Recyle to Recycle, ilde to idle and Porcess to Process close #I3R28X Signed-off-by: kenneth --- kernel/base/core/los_process.c | 26 +++++++++++++------------- kernel/base/core/los_sortlink.c | 6 +++--- kernel/base/core/los_task.c | 14 +++++++------- kernel/base/include/los_process_pri.h | 2 +- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/kernel/base/core/los_process.c b/kernel/base/core/los_process.c index 8d00696b..a4bf395c 100644 --- a/kernel/base/core/los_process.c +++ b/kernel/base/core/los_process.c @@ -57,7 +57,7 @@ LITE_OS_SEC_BSS LosProcessCB *g_processCBArray = NULL; LITE_OS_SEC_DATA_INIT STATIC LOS_DL_LIST g_freeProcess; -LITE_OS_SEC_DATA_INIT STATIC LOS_DL_LIST g_processRecyleList; +LITE_OS_SEC_DATA_INIT STATIC LOS_DL_LIST g_processRecycleList; LITE_OS_SEC_BSS UINT32 g_userInitProcess = OS_INVALID_VALUE; LITE_OS_SEC_BSS UINT32 g_kernelInitProcess = OS_INVALID_VALUE; LITE_OS_SEC_BSS UINT32 g_kernelIdleProcess = OS_INVALID_VALUE; @@ -331,9 +331,9 @@ LITE_OS_SEC_TEXT STATIC VOID OsRecycleZombiesProcess(LosProcessCB *childCB, Proc LOS_ListDelete(&childCB->pendList); if (childCB->processStatus & OS_PROCESS_FLAG_EXIT) { - LOS_ListHeadInsert(&g_processRecyleList, &childCB->pendList); + LOS_ListHeadInsert(&g_processRecycleList, &childCB->pendList); } else if (childCB->processStatus & OS_PROCESS_FLAG_GROUP_LEADER) { - LOS_ListTailInsert(&g_processRecyleList, &childCB->pendList); + LOS_ListTailInsert(&g_processRecycleList, &childCB->pendList); } else { OsInsertPCBToFreeList(childCB); } @@ -413,7 +413,7 @@ STATIC VOID OsProcessNaturalExit(LosTaskCB *runTask, UINT32 status) #ifdef LOSCFG_KERNEL_VM (VOID)OsKill(processCB->parentProcessID, SIGCHLD, OS_KERNEL_KILL_PERMISSION); #endif - LOS_ListHeadInsert(&g_processRecyleList, &processCB->pendList); + LOS_ListHeadInsert(&g_processRecycleList, &processCB->pendList); OsRunTaskToDelete(runTask); return; } @@ -437,7 +437,7 @@ STATIC UINT32 OsProcessInit(VOID) (VOID)memset_s(g_processCBArray, size, 0, size); LOS_ListInit(&g_freeProcess); - LOS_ListInit(&g_processRecyleList); + LOS_ListInit(&g_processRecycleList); for (index = 0; index < g_processMaxNum; index++) { g_processCBArray[index].processID = index; @@ -457,14 +457,14 @@ STATIC UINT32 OsProcessInit(VOID) return LOS_OK; } -LITE_OS_SEC_TEXT VOID OsProcessCBRecyleToFree(VOID) +LITE_OS_SEC_TEXT VOID OsProcessCBRecycleToFree(VOID) { UINT32 intSave; LosProcessCB *processCB = NULL; SCHEDULER_LOCK(intSave); - while (!LOS_ListEmpty(&g_processRecyleList)) { - processCB = OS_PCB_FROM_PENDLIST(LOS_DL_LIST_FIRST(&g_processRecyleList)); + while (!LOS_ListEmpty(&g_processRecycleList)) { + processCB = OS_PCB_FROM_PENDLIST(LOS_DL_LIST_FIRST(&g_processRecycleList)); if (!(processCB->processStatus & OS_PROCESS_FLAG_EXIT)) { break; } @@ -487,7 +487,7 @@ LITE_OS_SEC_TEXT VOID OsProcessCBRecyleToFree(VOID) LOS_ListDelete(&processCB->pendList); if ((processCB->processStatus & OS_PROCESS_FLAG_GROUP_LEADER) || (processCB->processStatus & OS_PROCESS_STATUS_ZOMBIES)) { - LOS_ListTailInsert(&g_processRecyleList, &processCB->pendList); + LOS_ListTailInsert(&g_processRecycleList, &processCB->pendList); } else { /* Clear the bottom 4 bits of process status */ OsInsertPCBToFreeList(processCB); @@ -525,7 +525,7 @@ STATIC VOID OsDeInitPCB(LosProcessCB *processCB) processCB->processStatus &= ~OS_PROCESS_STATUS_INIT; processCB->processStatus |= OS_PROCESS_FLAG_EXIT; - LOS_ListHeadInsert(&g_processRecyleList, &processCB->pendList); + LOS_ListHeadInsert(&g_processRecycleList, &processCB->pendList); SCHEDULER_UNLOCK(intSave); (VOID)LOS_MemFree(m_aucSysMem1, group); @@ -1005,7 +1005,7 @@ WAIT_BACK: return LOS_OK; } -STATIC UINT32 OsWaitRecycleChildPorcess(const LosProcessCB *childCB, UINT32 intSave, INT32 *status) +STATIC UINT32 OsWaitRecycleChildProcess(const LosProcessCB *childCB, UINT32 intSave, INT32 *status) { ProcessGroup *group = NULL; UINT32 pid = childCB->processID; @@ -1081,7 +1081,7 @@ LITE_OS_SEC_TEXT INT32 LOS_Wait(INT32 pid, USER INT32 *status, UINT32 options, V } if (childCB != NULL) { - return (INT32)OsWaitRecycleChildPorcess(childCB, intSave, status); + return (INT32)OsWaitRecycleChildProcess(childCB, intSave, status); } if ((options & LOS_WAIT_WNOHANG) != 0) { @@ -1104,7 +1104,7 @@ LITE_OS_SEC_TEXT INT32 LOS_Wait(INT32 pid, USER INT32 *status, UINT32 options, V goto ERROR; } - return (INT32)OsWaitRecycleChildPorcess(childCB, intSave, status); + return (INT32)OsWaitRecycleChildProcess(childCB, intSave, status); ERROR: SCHEDULER_UNLOCK(intSave); diff --git a/kernel/base/core/los_sortlink.c b/kernel/base/core/los_sortlink.c index 6cb8b82b..2f818dfd 100644 --- a/kernel/base/core/los_sortlink.c +++ b/kernel/base/core/los_sortlink.c @@ -122,10 +122,10 @@ STATIC INLINE UINT64 OsGetSortLinkNextExpireTime(SortLinkAttribute *sortHeader, return expirTime; } -STATIC Percpu *OsFindIdleCpu(UINT16 *ildeCpuID) +STATIC Percpu *OsFindIdleCpu(UINT16 *idleCpuID) { Percpu *idleCpu = OsPercpuGetByID(0); - *ildeCpuID = 0; + *idleCpuID = 0; #ifdef LOSCFG_KERNEL_SMP UINT16 cpuID = 1; @@ -136,7 +136,7 @@ STATIC Percpu *OsFindIdleCpu(UINT16 *ildeCpuID) UINT32 temp = cpu->taskSortLink.nodeNum + cpu->swtmrSortLink.nodeNum; if (nodeNum > temp) { idleCpu = cpu; - *ildeCpuID = cpuID; + *idleCpuID = cpuID; } cpuID++; diff --git a/kernel/base/core/los_task.c b/kernel/base/core/los_task.c index f7b3b1a9..48e2e74d 100644 --- a/kernel/base/core/los_task.c +++ b/kernel/base/core/los_task.c @@ -67,7 +67,7 @@ LITE_OS_SEC_BSS LosTaskCB *g_taskCBArray; LITE_OS_SEC_BSS LOS_DL_LIST g_losFreeTask; -LITE_OS_SEC_BSS LOS_DL_LIST g_taskRecyleList; +LITE_OS_SEC_BSS LOS_DL_LIST g_taskRecycleList; LITE_OS_SEC_BSS UINT32 g_taskMaxNum; LITE_OS_SEC_BSS UINT32 g_taskScheduled; /* one bit for each cores */ LITE_OS_SEC_BSS EVENT_CB_S g_resourceEvent; @@ -201,7 +201,7 @@ LITE_OS_SEC_TEXT_INIT UINT32 OsTaskInit(VOID) (VOID)memset_s(g_taskCBArray, size, 0, size); LOS_ListInit(&g_losFreeTask); - LOS_ListInit(&g_taskRecyleList); + LOS_ListInit(&g_taskRecycleList); for (index = 0; index < g_taskMaxNum; index++) { g_taskCBArray[index].taskStatus = OS_TASK_STATUS_UNUSED; g_taskCBArray[index].taskID = index; @@ -450,8 +450,8 @@ LITE_OS_SEC_TEXT VOID OsTaskCBRecycleToFree() UINT32 intSave; SCHEDULER_LOCK(intSave); - while (!LOS_ListEmpty(&g_taskRecyleList)) { - taskCB = OS_TCB_FROM_PENDLIST(LOS_DL_LIST_FIRST(&g_taskRecyleList)); + while (!LOS_ListEmpty(&g_taskRecycleList)) { + taskCB = OS_TCB_FROM_PENDLIST(LOS_DL_LIST_FIRST(&g_taskRecycleList)); LOS_ListDelete(&taskCB->pendList); SCHEDULER_UNLOCK(intSave); @@ -888,7 +888,7 @@ LITE_OS_SEC_TEXT VOID OsRunTaskToDelete(LosTaskCB *runTask) LOS_ListDelete(&runTask->threadList); processCB->threadNumber--; - LOS_ListTailInsert(&g_taskRecyleList, &runTask->pendList); + LOS_ListTailInsert(&g_taskRecycleList, &runTask->pendList); OsEventWriteUnsafe(&g_resourceEvent, OS_RESOURCE_EVENT_FREE, FALSE, NULL); OsSchedResched(); @@ -962,7 +962,7 @@ STATIC VOID OsTaskDeleteInactive(LosProcessCB *processCB, LosTaskCB *taskCB) LOS_ListDelete(&taskCB->threadList); processCB->threadNumber--; - LOS_ListTailInsert(&g_taskRecyleList, &taskCB->pendList); + LOS_ListTailInsert(&g_taskRecycleList, &taskCB->pendList); return; } @@ -1650,7 +1650,7 @@ STATIC VOID OsResourceRecoveryTask(VOID) if (ret & (OS_RESOURCE_EVENT_FREE | OS_RESOURCE_EVENT_OOM)) { OsTaskCBRecycleToFree(); - OsProcessCBRecyleToFree(); + OsProcessCBRecycleToFree(); } #ifdef LOSCFG_ENABLE_OOM_LOOP_TASK diff --git a/kernel/base/include/los_process_pri.h b/kernel/base/include/los_process_pri.h index 8cf6b7c0..27e80cf4 100644 --- a/kernel/base/include/los_process_pri.h +++ b/kernel/base/include/los_process_pri.h @@ -441,7 +441,7 @@ extern UINTPTR __user_init_bss; extern UINTPTR __user_init_end; extern UINTPTR __user_init_load_addr; extern UINT32 OsSystemProcessCreate(VOID); -extern VOID OsProcessCBRecyleToFree(VOID); +extern VOID OsProcessCBRecycleToFree(VOID); extern VOID OsProcessResourcesToFree(LosProcessCB *processCB); extern VOID OsProcessExit(LosTaskCB *runTask, INT32 status); extern UINT32 OsUserInitProcess(VOID); From a8805a65aab9109b915364fccf36c8328f636e48 Mon Sep 17 00:00:00 2001 From: Caoruihong Date: Tue, 13 Jul 2021 23:57:39 +0800 Subject: [PATCH 39/43] feat: add support for gn build system add BUILD.gn for all kernel modules Signed-off-by: Caoruihong Change-Id: I018446427bf64615f2596d47862b219659b58b34 --- BUILD.gn | 321 ++++++++++++++++-- Kconfig | 13 +- Makefile | 18 +- apps/BUILD.gn | 50 +++ apps/init/BUILD.gn | 53 +++ apps/mksh/BUILD.gn | 40 +++ apps/shell/BUILD.gn | 58 ++++ apps/tftp/BUILD.gn | 55 +++ apps/toybox/BUILD.gn | 40 +++ arch/BUILD.gn | 44 +++ arch/arm/BUILD.gn | 47 +++ arch/arm/arm/BUILD.gn | 82 +++++ arch/arm/gic/BUILD.gn | 41 +++ bsd/BUILD.gn | 86 +++++ bsd/Kconfig | 8 + bsd/compat/linuxkpi/BUILD.gn | 57 ++++ bsd/dev/usb/BUILD.gn | 154 +++++++++ compat/BUILD.gn | 38 +++ compat/posix/BUILD.gn | 55 +++ drivers/BUILD.gn | 70 ++++ drivers/block/disk/BUILD.gn | 45 +++ drivers/char/bch/BUILD.gn | 52 +++ drivers/char/mem/BUILD.gn | 42 +++ drivers/char/quickstart/BUILD.gn | 42 +++ drivers/char/random/BUILD.gn | 46 +++ drivers/char/video/BUILD.gn | 42 +++ drivers/mtd/multi_partition/BUILD.gn | 54 +++ fs/BUILD.gn | 56 +++ fs/fat/BUILD.gn | 55 +++ fs/fat/virpart/BUILD.gn | 47 +++ fs/jffs2/BUILD.gn | 75 ++++ fs/nfs/BUILD.gn | 40 +++ fs/proc/BUILD.gn | 34 +- fs/ramfs/BUILD.gn | 36 ++ fs/romfs/BUILD.gn | 39 +++ fs/vfs/BUILD.gn | 116 +++++++ fs/vfs/bcache/BUILD.gn | 42 +++ fs/zpfs/BUILD.gn | 13 +- kernel/BUILD.gn | 38 +-- kernel/base/BUILD.gn | 54 +-- kernel/base/misc/panic_shellcmd.c | 2 +- kernel/common/BUILD.gn | 48 +++ kernel/common/blackbox/BUILD.gn | 47 +++ kernel/common/hidumper/BUILD.gn | 41 +++ kernel/common/patchfs/BUILD.gn | 44 +++ kernel/common/rootfs/BUILD.gn | 44 +++ kernel/common/{ => rootfs}/Kconfig | 0 kernel/common/{ => rootfs}/Makefile | 0 kernel/common/{ => rootfs}/los_bootargs.c | 0 kernel/common/{ => rootfs}/los_bootargs.h | 0 kernel/common/{ => rootfs}/los_rootfs.c | 0 kernel/common/{ => rootfs}/los_rootfs.h | 0 kernel/extended/BUILD.gn | 56 +++ kernel/extended/cppsupport/BUILD.gn | 36 ++ kernel/extended/cpup/BUILD.gn | 45 +++ .../extended/{include => cpup}/los_cpup_pri.h | 0 kernel/extended/dynload/BUILD.gn | 45 +++ kernel/extended/hilog/BUILD.gn | 45 +++ kernel/extended/liteipc/BUILD.gn | 41 +++ kernel/extended/power/BUILD.gn | 36 ++ kernel/extended/trace/BUILD.gn | 45 +++ .../{include => trace}/los_trace_pri.h | 0 kernel/extended/vdso/BUILD.gn | 53 +++ kernel/extended/vdso/src/Makefile | 2 +- kernel/extended/vdso/src/los_vdso_text.S | 2 +- kernel/extended/vdso/usr/BUILD.gn | 54 +++ kernel/extended/vdso/usr/Makefile | 2 +- kernel/user/BUILD.gn | 57 ++++ lib/BUILD.gn | 50 +++ lib/libc/BUILD.gn | 92 +++++ lib/libmbedtls/BUILD.gn | 122 +++++++ lib/libscrew/BUILD.gn | 46 +++ lib/libsec/BUILD.gn | 83 +++++ lib/zlib/BUILD.gn | 62 ++++ liteos.gni | 63 ++++ net/BUILD.gn | 44 +++ net/lwip-2.1/BUILD.gn | 63 ++++ net/lwip-2.1/lwip_porting.gni | 40 +++ net/telnet/BUILD.gn | 45 +++ platform/BUILD.gn | 101 ++++++ platform/Makefile | 7 +- platform/bsp.mk | 3 +- {kernel/common => platform}/console.c | 0 {kernel/common => platform}/console.h | 0 {kernel/common => platform}/hwi_shell.c | 0 {kernel/common => platform}/los_builddef.h | 0 {kernel/common => platform}/los_cir_buf.c | 0 {kernel/common => platform}/los_cir_buf_pri.h | 0 {kernel/common => platform}/los_config.c | 0 {kernel/common => platform}/los_config.h | 2 +- {kernel/common => platform}/los_excinfo.c | 0 {kernel/common => platform}/los_excinfo_pri.h | 0 {kernel/common => platform}/los_hilog.c | 0 {kernel/common => platform}/los_hilog.h | 0 {kernel/common => platform}/los_init.c | 0 {kernel/common => platform}/los_init.h | 0 {kernel/common => platform}/los_init_info.h | 0 {kernel/common => platform}/los_init_pri.h | 0 {kernel/common => platform}/los_magickey.c | 0 {kernel/common => platform}/los_magickey.h | 0 {kernel/common => platform}/los_printf.c | 0 {kernel/common => platform}/los_seq_buf.c | 0 {kernel/common => platform}/los_seq_buf.h | 0 {kernel/common => platform}/los_timer_pri.h | 0 {kernel/common => platform}/sys_config.h | 0 {kernel/common => platform}/virtual_serial.c | 0 {kernel/common => platform}/virtual_serial.h | 0 security/BUILD.gn | 44 +++ security/cap/BUILD.gn | 41 +++ security/vid/BUILD.gn | 41 +++ shell/BUILD.gn | 31 +- syscall/BUILD.gn | 46 +++ testsuites/BUILD.gn | 37 ++ tools/build/mk/los_config.mk | 12 +- 114 files changed, 3993 insertions(+), 125 deletions(-) create mode 100644 apps/BUILD.gn create mode 100644 apps/init/BUILD.gn create mode 100644 apps/mksh/BUILD.gn create mode 100644 apps/shell/BUILD.gn create mode 100644 apps/tftp/BUILD.gn create mode 100644 apps/toybox/BUILD.gn create mode 100644 arch/BUILD.gn create mode 100644 arch/arm/BUILD.gn create mode 100644 arch/arm/arm/BUILD.gn create mode 100644 arch/arm/gic/BUILD.gn create mode 100644 bsd/BUILD.gn create mode 100644 bsd/compat/linuxkpi/BUILD.gn create mode 100644 bsd/dev/usb/BUILD.gn create mode 100644 compat/BUILD.gn create mode 100644 compat/posix/BUILD.gn create mode 100644 drivers/BUILD.gn create mode 100644 drivers/block/disk/BUILD.gn create mode 100644 drivers/char/bch/BUILD.gn create mode 100644 drivers/char/mem/BUILD.gn create mode 100644 drivers/char/quickstart/BUILD.gn create mode 100644 drivers/char/random/BUILD.gn create mode 100644 drivers/char/video/BUILD.gn create mode 100644 drivers/mtd/multi_partition/BUILD.gn create mode 100644 fs/BUILD.gn create mode 100644 fs/fat/BUILD.gn create mode 100644 fs/fat/virpart/BUILD.gn create mode 100644 fs/jffs2/BUILD.gn create mode 100644 fs/nfs/BUILD.gn create mode 100644 fs/ramfs/BUILD.gn create mode 100644 fs/romfs/BUILD.gn create mode 100644 fs/vfs/BUILD.gn create mode 100644 fs/vfs/bcache/BUILD.gn create mode 100644 kernel/common/BUILD.gn create mode 100644 kernel/common/blackbox/BUILD.gn create mode 100644 kernel/common/hidumper/BUILD.gn create mode 100644 kernel/common/patchfs/BUILD.gn create mode 100644 kernel/common/rootfs/BUILD.gn rename kernel/common/{ => rootfs}/Kconfig (100%) rename kernel/common/{ => rootfs}/Makefile (100%) rename kernel/common/{ => rootfs}/los_bootargs.c (100%) rename kernel/common/{ => rootfs}/los_bootargs.h (100%) rename kernel/common/{ => rootfs}/los_rootfs.c (100%) rename kernel/common/{ => rootfs}/los_rootfs.h (100%) create mode 100644 kernel/extended/BUILD.gn create mode 100644 kernel/extended/cppsupport/BUILD.gn create mode 100644 kernel/extended/cpup/BUILD.gn rename kernel/extended/{include => cpup}/los_cpup_pri.h (100%) create mode 100644 kernel/extended/dynload/BUILD.gn create mode 100644 kernel/extended/hilog/BUILD.gn create mode 100644 kernel/extended/liteipc/BUILD.gn create mode 100644 kernel/extended/power/BUILD.gn create mode 100644 kernel/extended/trace/BUILD.gn rename kernel/extended/{include => trace}/los_trace_pri.h (100%) create mode 100644 kernel/extended/vdso/BUILD.gn create mode 100644 kernel/extended/vdso/usr/BUILD.gn create mode 100644 kernel/user/BUILD.gn create mode 100644 lib/BUILD.gn create mode 100644 lib/libc/BUILD.gn create mode 100644 lib/libmbedtls/BUILD.gn create mode 100644 lib/libscrew/BUILD.gn create mode 100644 lib/libsec/BUILD.gn create mode 100644 lib/zlib/BUILD.gn create mode 100644 liteos.gni create mode 100644 net/BUILD.gn create mode 100644 net/lwip-2.1/BUILD.gn create mode 100644 net/lwip-2.1/lwip_porting.gni create mode 100644 net/telnet/BUILD.gn create mode 100644 platform/BUILD.gn rename {kernel/common => platform}/console.c (100%) rename {kernel/common => platform}/console.h (100%) rename {kernel/common => platform}/hwi_shell.c (100%) rename {kernel/common => platform}/los_builddef.h (100%) rename {kernel/common => platform}/los_cir_buf.c (100%) rename {kernel/common => platform}/los_cir_buf_pri.h (100%) rename {kernel/common => platform}/los_config.c (100%) rename {kernel/common => platform}/los_config.h (99%) rename {kernel/common => platform}/los_excinfo.c (100%) rename {kernel/common => platform}/los_excinfo_pri.h (100%) rename {kernel/common => platform}/los_hilog.c (100%) rename {kernel/common => platform}/los_hilog.h (100%) rename {kernel/common => platform}/los_init.c (100%) rename {kernel/common => platform}/los_init.h (100%) rename {kernel/common => platform}/los_init_info.h (100%) rename {kernel/common => platform}/los_init_pri.h (100%) rename {kernel/common => platform}/los_magickey.c (100%) rename {kernel/common => platform}/los_magickey.h (100%) rename {kernel/common => platform}/los_printf.c (100%) rename {kernel/common => platform}/los_seq_buf.c (100%) rename {kernel/common => platform}/los_seq_buf.h (100%) rename {kernel/common => platform}/los_timer_pri.h (100%) rename {kernel/common => platform}/sys_config.h (100%) rename {kernel/common => platform}/virtual_serial.c (100%) rename {kernel/common => platform}/virtual_serial.h (100%) create mode 100644 security/BUILD.gn create mode 100644 security/cap/BUILD.gn create mode 100644 security/vid/BUILD.gn create mode 100644 syscall/BUILD.gn create mode 100644 testsuites/BUILD.gn diff --git a/BUILD.gn b/BUILD.gn index df7704a6..93965953 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -28,49 +28,310 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import("//build/lite/config/component/lite_component.gni") -import("//build/lite/config/subsystem/lite_subsystem.gni") + +declare_args() { + tee_enable = false +} + +LITEOS_MENUCONFIG_H = rebase_path("$root_out_dir/config.h") + +tee = "" +if (tee_enable) { + tee = "_tee" +} + +productName = get_path_info(product_path, "file") +config_file = "${productName}_release.config" +if (ohos_build_compiler == "clang") { + if (ohos_build_type == "debug") { + config_file = "debug/${productName}_${ohos_build_compiler}${tee}.config" + } else { + config_file = "${productName}_${ohos_build_compiler}_release${tee}.config" + } +} else if (ohos_build_compiler == "gcc") { + if (ohos_build_type == "debug") { + config_file = "${productName}_debug_shell${tee}.config" + } else { + config_file = "${productName}_release${tee}.config" + } +} + +liteos_config_file = rebase_path("tools/build/config/$config_file") + +# we prefer use product specified config file +f = "$product_path/config/${ohos_build_type}${tee}.config" +if (exec_script("//build/lite/run_shell_cmd.py", [ "if [ -f $f ]; then echo true; else echo false; fi" ], "value")) { + liteos_config_file = f +} + +print("liteos_config_file:", liteos_config_file) + +exec_script("//build/lite/run_shell_cmd.py", [ "which genconfig || pip install --user kconfiglib" ]) + +exec_script("//build/lite/run_shell_cmd.py", + [ + "env" + + " CONFIG_=LOSCFG_" + + " KCONFIG_CONFIG_HEADER='y=true'" + + " KCONFIG_CONFIG=$liteos_config_file" + + " DEVICE_PATH=$device_path" + + " srctree=" + rebase_path(".") + + " genconfig" + + " --header-path $LITEOS_MENUCONFIG_H" + + " --file-list kconfig_files.txt" + + " --env-list kconfig_env.txt" + + " --config-out config.gni", + ]) + +import("liteos.gni") generate_notice_file("kernel_notice_file") { module_name = "kernel" module_source_dir_list = [ - "//third_party/FreeBSD", - "//third_party/musl", - "//third_party/zlib", - "//third_party/FatFs", - "//third_party/Linux_Kernel", - "//third_party/lwip", - "//third_party/NuttX", - "//third_party/mtd-utils", + "$LITEOSTHIRDPARTY/FreeBSD", + "$LITEOSTHIRDPARTY/musl", + "$LITEOSTHIRDPARTY/zlib", + "$LITEOSTHIRDPARTY/FatFs", + "$LITEOSTHIRDPARTY/Linux_Kernel", + "$LITEOSTHIRDPARTY/lwip", + "$LITEOSTHIRDPARTY/NuttX", + "$LITEOSTHIRDPARTY/mtd-utils", ] } -declare_args() { - enable_ohos_kernel_liteos_a_ext_build = true - LOSCFG_TEST_APPS = false - tee_enable = "" +liteos_arch_cflags = [] +if (defined(LOSCFG_ARCH_ARM)) { + mcpu = LOSCFG_ARCH_CPU + if (defined(LOSCFG_ARCH_ARM_AARCH64) && defined(LOSCFG_ARCH_FPU_DISABLE)) { + mcpu += "+nofp" + } + liteos_arch_cflags += [ "-mcpu=$mcpu" ] + if (defined(LOSCFG_ARCH_ARM_AARCH32)) { + liteos_arch_cflags += [ + "-mfloat-abi=softfp", + "-mfpu=$LOSCFG_ARCH_FPU", + ] + } } -lite_subsystem("kernel") { - subsystem_components = [] +cc = "$ohos_current_cc_command " + string_join(" ", liteos_arch_cflags) +if (ohos_build_compiler == "clang") { + cc += " --target=$target_triple" +} - if (enable_ohos_kernel_liteos_a_ext_build == false) { - subsystem_components += [ - "//kernel/liteos_a/kernel", - "//kernel/liteos_a/net", - "//kernel/liteos_a/lib", - "//kernel/liteos_a/compat", - "//kernel/liteos_a/fs", - "//kernel/liteos_a/arch:platform_cpu", - ] - if (LOSCFG_SHELL) { - subsystem_components += [ "//kernel/liteos_a/shell" ] - } - } else { - deps = [ ":make" ] - deps += [ "//kernel/liteos_a/testsuites/unittest:unittest" ] +config("arch_config") { + cflags = liteos_arch_cflags + asmflags = cflags + ldflags = cflags +} + +config("as_objs_libc_flags") { + defines = [ "__ASSEMBLY__" ] + + # linux style macros + if (defined(LOSCFG_ARCH_ARM_V7A) || defined(LOSCFG_ARCH_ARM_V7R) || + defined(LOSCFG_ARCH_ARM_V7M)) { + defines += [ "__LINUX_ARM_ARCH__=7" ] + } else if (defined(LOSCFG_ARCH_ARM_V8A) || defined(LOSCFG_ARCH_ARM_V8R) || + defined(LOSCFG_ARCH_ARM_V8M)) { + defines += [ "__LINUX_ARM_ARCH__=8" ] } } +config("std_include") { + std_include = exec_script("//build/lite/run_shell_cmd.py", [ "$cc -print-file-name=include" ], "trim string") + include_dirs = [ std_include ] +} + +config("public") { + configs = [ + "arch:public", + "platform:public", + "kernel:public", + "compat:public", + "bsd:public", + "fs:public", + "drivers:public", + "security:public", + "net:public", + "shell:public", + "lib:public", + ":std_include", + ] +} + +config("los_config") { + cflags = [ + "-imacros", + "$LITEOS_MENUCONFIG_H", + ] + + defines = [ "__LITEOS__" ] + + configs = [ ":arch_config" ] + + ldflags = [ "-nostdlib" ] + + cflags_c = [ "-std=c99" ] + + cflags += [ + "-fno-pic", + "-fno-builtin", + "-nostdinc", + "-Wall", + "-Werror", + "-fms-extensions", + "-Wno-address-of-packed-member", + "-fno-strict-aliasing", + "-fno-common", + "-fsigned-char", + "-Wpointer-arith", + "-Wstrict-prototypes", + "-Winvalid-pch", + "-ffunction-sections", + "-fdata-sections", + "-fno-exceptions", + "-fno-omit-frame-pointer", + "-fno-short-enums", + ] + + if (defined(LOSCFG_QUICK_START)) { + cflags -= [ "-Werror" ] + } + + if (defined(LOSCFG_COMPILE_DEBUG)) { + cflags += [ + "-O0", + "-g", + "-gdwarf-2", + ] + } else { + if (defined(LOSCFG_COMPILER_CLANG_LLVM)) { + cflags += [ + "-Oz", + "-flto", + ] + } else { + cflags += [ "-O2" ] + } + } + + if (defined(LOSCFG_CC_STACKPROTECTOR_ALL)) { + cflags += [ "-fstack-protector-all" ] + } else if (defined(LOSCFG_CC_STACKPROTECTOR_STRONG)) { + cflags += [ "-fstack-protector-strong" ] + } else if (defined(LOSCFG_CC_STACKPROTECTOR)) { + cflags += [ + "-fstack-protector", + "--param", + "ssp-buffer-size=4", + ] + } else { + cflags += [ "-fno-stack-protector" ] + } + + if (!defined(LOSCFG_COMPILER_CLANG_LLVM)) { + cflags += [ "-fno-aggressive-loop-optimizations" ] + if (!defined(LOSCFG_ARCH_ARM_AARCH64)) { + cflags += [ + "-mno-unaligned-access", + "-mthumb-interwork", + ] + } + } + + if (defined(LOSCFG_THUMB)) { + cflags += [ + "-mthumb", + "-Wa,-mimplicit-it=thumb", + ] + } + + asmflags = cflags +} + +liteos_name = "liteos2" +liteos_out = rebase_path("$target_out_dir/$liteos_name") +executable(liteos_name) { + configs = [] # clear default configs + configs += [ ":los_config" ] + + ldflags = [ + "-static", + "-Wl,--gc-sections", + "-Wl,-Map=" + rebase_path("$liteos_out.map"), + "-Wl,--no-eh-frame-hdr", + "-Wl,--whole-archive", + ] + + libgcc = exec_script("//build/lite/run_shell_cmd.py", [ "$cc -print-libgcc-file-name" ], "trim string") + libs = [ libgcc ] + if (defined(LOSCFG_COMPILER_CLANG_LLVM)) { + libs += [ "tools/build/liteos_llvm.ld" ] + } else { + libs += [ "tools/build/liteos.ld" ] + ldflags += [ "-nostartfiles" ] + } + + deps = [ + ":modules", + ] +} + +build_ext_component("build_liteos_bin") { + deps = [ ":$liteos_name" ] + exec_path = rebase_path(target_out_dir) + + objcopy = "${compile_prefix}objcopy$toolchain_cmd_suffix" + objdump = "${compile_prefix}objdump$toolchain_cmd_suffix" + + liteos = rebase_path("$root_out_dir/unstripped/bin/$liteos_name") + + command = "$objcopy -O binary $liteos $liteos_out.bin" + command += " && sh -c '$objdump -t $liteos | sort >$liteos_out.sym.sorted'" + command += " && sh -c '$objdump -d $liteos >$liteos_out.asm'" +} + +group("modules") { + deps = [ + "arch", + "bsd", + "compat", + "drivers", + "fs", + "kernel", + "lib", + "net", + "platform", + "security", + "shell", + "syscall", + ] +} + +group("apps") { + deps = [ "apps" ] +} + +group("tests") { + deps = [ "testsuites" ] +} + +group("kernel") { + deps = [ + ":make", + ":tests", + ] +} + +group("liteos_a") { + deps = [ + ":apps", + ":kernel", + ":tests", + ] +} + build_ext_component("make") { exec_path = rebase_path(".", root_build_dir) outdir = rebase_path(get_path_info(".", "out_dir")) diff --git a/Kconfig b/Kconfig index 1b3a174e..8b8704e8 100644 --- a/Kconfig +++ b/Kconfig @@ -58,7 +58,7 @@ source "platform/Kconfig" source "arch/Kconfig" ######################### config options of rootfs ##################### -source "kernel/common/Kconfig" +source "kernel/common/rootfs/Kconfig" ######################### config options of patchfs ##################### source "kernel/common/patchfs/Kconfig" ######################### config options of blackbox ##################### @@ -93,6 +93,7 @@ source "fs/romfs/Kconfig" source "fs/nfs/Kconfig" source "fs/proc/Kconfig" source "fs/jffs2/Kconfig" +source "fs/zpfs/Kconfig" config ENABLE_READ_BUFFER bool "Enable read buffer Option" default n @@ -163,9 +164,16 @@ config ENABLE_MAGICKEY config THUMB bool "Enable Thumb" default n + select INTERWORK_THUMB help Answer Y to build thumb version. This will make LiteOS smaller. +config INTERWORK_THUMB + bool "Enable interwork Thumb" if THUMB + default n + help + Answer Y to enable interwork thumb. + config PLATFORM_DVFS bool "Enable Dvfs" default n @@ -295,8 +303,7 @@ source "bsd/dev/usb/Kconfig" source "../../drivers/adapter/khdf/liteos/Kconfig" # Device driver Kconfig import -osource "$(DEVICE_PATH)/Kconfig" -osource "$(DEVICE_PATH)/config/Kconfig" +osource "$(DEVICE_PATH)/drivers/Kconfig" source "drivers/char/mem/Kconfig" source "drivers/char/quickstart/Kconfig" diff --git a/Makefile b/Makefile index ff3bf7c9..72d7994b 100644 --- a/Makefile +++ b/Makefile @@ -51,13 +51,25 @@ LITEOS_PLATFORM_BASE = $(LITEOSTOPDIR)/platform export CONFIG_=LOSCFG_ ifeq ($(PRODUCT_PATH),) -export PRODUCT_PATH=$(LITEOSTOPDIR)/../../device/hisilicon/drivers +export PRODUCT_PATH=$(shell hb env|grep "product path:"|sed 's/.*: //g') +endif +ifeq ($(DEVICE_PATH),) +export DEVICE_PATH=$(shell hb env|grep "device path:"|sed 's/.*: //g') +endif + +ifeq ($(TEE:1=y),y) +tee = _tee +endif +ifeq ($(RELEASE:1=y),y) +CONFIG ?= $(PRODUCT_PATH)/config/release$(tee).config +else +CONFIG ?= $(PRODUCT_PATH)/config/debug$(tee).config endif ifeq ($(shell which menuconfig),) $(shell pip install --user kconfiglib >/dev/null) endif -$(shell env CONFIG_=$(CONFIG_) PRODUCT_PATH=$(PRODUCT_PATH) olddefconfig >/dev/null) +$(shell env CONFIG_=$(CONFIG_) DEVICE_PATH=$(DEVICE_PATH) olddefconfig >/dev/null) -include $(LITEOSTOPDIR)/tools/build/config.mk @@ -217,7 +229,7 @@ update_all_config: done update_config: - $(HIDE)test -f "$(CONFIG)" && cp "$(CONFIG)" .config && menuconfig && savedefconfig --out "$(CONFIG)" + $(HIDE)test -f "$(CONFIG)" && cp -v "$(CONFIG)" .config && menuconfig && savedefconfig --out "$(CONFIG)" .PHONY: all lib clean cleanall $(LITEOS_TARGET) debug release help update_all_config update_config .PHONY: prepare sysroot cleanrootfs $(ROOTFS) $(ROOTFSDIR) $(APPS) menuconfig $(LITEOS_LIBS_TARGET) $(__LIBS) $(OUT) diff --git a/apps/BUILD.gn b/apps/BUILD.gn new file mode 100644 index 00000000..3e197007 --- /dev/null +++ b/apps/BUILD.gn @@ -0,0 +1,50 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +group("apps") { + deps = [] + + if (defined(LOSCFG_SHELL)) { + deps += [ + "shell", + #"mksh", + #"toybox", + ] + } + + if (defined(LOSCFG_USER_INIT_DEBUG)) { + #deps += [ "init" ] + } + + if (defined(LOSCFG_NET_LWIP_SACK_TFTP)) { + deps += [ "tftp" ] + } +} diff --git a/apps/init/BUILD.gn b/apps/init/BUILD.gn new file mode 100644 index 00000000..3b8b4f5a --- /dev/null +++ b/apps/init/BUILD.gn @@ -0,0 +1,53 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +executable("init") { + sources = [ "src/init.c" ] + + cflags = [ "-fPIE" ] + + if (defined(LOSCFG_COMPILER_CLANG_LLVM)) { + cflags += [ + "-Wno-shift-op-parentheses", + "-Wno-bitwise-op-parentheses", + "-Wnonnull", + ] + } + + ldflags = [ + "-pie", + "-s", + ] + + if (defined(LOSCFG_QUICK_START)) { + ldflags += [ "--static" ] + } +} diff --git a/apps/mksh/BUILD.gn b/apps/mksh/BUILD.gn new file mode 100644 index 00000000..a09888e5 --- /dev/null +++ b/apps/mksh/BUILD.gn @@ -0,0 +1,40 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//build/lite/config/component/lite_component.gni") +import("//kernel/liteos_a/liteos.gni") + +group("mksh") { + deps = [ ":build_mksh" ] +} + +build_ext_component("build_mksh") { + exec_path = rebase_path(target_out_dir) + command = "make -C $LITEOSTHIRDPARTY/mksh" +} diff --git a/apps/shell/BUILD.gn b/apps/shell/BUILD.gn new file mode 100644 index 00000000..7afbbf6f --- /dev/null +++ b/apps/shell/BUILD.gn @@ -0,0 +1,58 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +executable("shell") { + sources = [ + "builtin/cd.c", + "src/main.c", + "src/shcmd.c", + "src/shcmdparse.c", + "src/shmsg.c", + ] + + deps = [ "$LITEOSTHIRDPARTY/bounds_checking_function:libsec_static" ] + + include_dirs = [ "include" ] + + cflags = [ "-fPIE" ] + + if (defined(LOSCFG_COMPILER_CLANG_LLVM)) { + cflags += [ + "-Wno-shift-op-parentheses", + "-Wno-bitwise-op-parentheses", + ] + } + + ldflags = [ + "-pie", + "-s", + ] +} diff --git a/apps/tftp/BUILD.gn b/apps/tftp/BUILD.gn new file mode 100644 index 00000000..eef0d82a --- /dev/null +++ b/apps/tftp/BUILD.gn @@ -0,0 +1,55 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +executable("tftp") { + sources = [ + "src/main.c", + "src/tftpc.c", + ] + + deps = [ "$LITEOSTHIRDPARTY/bounds_checking_function:libsec_static" ] + + include_dirs = [ "include" ] + + cflags = [ "-fPIE" ] + + if (defined(LOSCFG_COMPILER_CLANG_LLVM)) { + cflags += [ + "-Wno-shift-op-parentheses", + "-Wno-bitwise-op-parentheses", + ] + } + + ldflags = [ + "-pie", + "-s", + ] +} diff --git a/apps/toybox/BUILD.gn b/apps/toybox/BUILD.gn new file mode 100644 index 00000000..8438e89e --- /dev/null +++ b/apps/toybox/BUILD.gn @@ -0,0 +1,40 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//build/lite/config/component/lite_component.gni") +import("//kernel/liteos_a/liteos.gni") + +group("toybox") { + deps = [ ":build_toybox" ] +} + +build_ext_component("build_toybox") { + exec_path = rebase_path(target_out_dir) + command = "make -C $LITEOSTHIRDPARTY/toybox" +} diff --git a/arch/BUILD.gn b/arch/BUILD.gn new file mode 100644 index 00000000..75517815 --- /dev/null +++ b/arch/BUILD.gn @@ -0,0 +1,44 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +group("arch") { + deps = [] + if (defined(LOSCFG_ARCH_ARM)) { + deps += [ "arm" ] + } +} + +config("public") { + configs = [] + if (defined(LOSCFG_ARCH_ARM)) { + configs += [ "arm:public" ] + } +} diff --git a/arch/arm/BUILD.gn b/arch/arm/BUILD.gn new file mode 100644 index 00000000..6a797c10 --- /dev/null +++ b/arch/arm/BUILD.gn @@ -0,0 +1,47 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +group("arm") { + deps = [ "gic" ] + if (defined(LOSCFG_ARCH_ARM_AARCH32)) { + deps += [ "arm" ] + } +} + +config("public") { + include_dirs = [ "include" ] + configs = [] + if (defined(LOSCFG_ARCH_ARM_AARCH32)) { + configs += [ "arm:public" ] + } else if (defined(LOSCFG_ARCH_ARM_AARCH64)) { + configs += [ "aarch64:public" ] + } +} diff --git a/arch/arm/arm/BUILD.gn b/arch/arm/arm/BUILD.gn new file mode 100644 index 00000000..f2ef7610 --- /dev/null +++ b/arch/arm/arm/BUILD.gn @@ -0,0 +1,82 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +module_name = LOSCFG_ARCH_CPU +kernel_module(module_name) { + sources = [ + "src/arm_generic_timer.c", + "src/clear_user.S", + "src/hw_user_get.S", + "src/hw_user_put.S", + "src/jmp.S", + "src/los_arch_mmu.c", + "src/los_asid.c", + "src/los_dispatch.S", + "src/los_exc.c", + "src/los_hw.c", + "src/los_hw_exc.S", + "src/los_hw_runstop.S", + "src/los_hw_tick.c", + "src/los_hwi.c", + "src/strncpy_from_user.c", + "src/strnlen_user.c", + "src/user_copy.c", + ] + + if (LOSCFG_ARCH_ARM_VER == "armv7-a") { + sources += [ "src/armv7a/cache.S" ] + } + + if (defined(LOSCFG_KERNEL_SMP)) { + sources += [ "src/startup/reset_vector_mp.S" ] + } else { + sources += [ "src/startup/reset_vector_up.S" ] + } + + include_dirs = [ "src/include" ] + + if (defined(LOSCFG_GDB)) { + configs += [ "$LITEOSTOPDIR:as_objs_libc_flags" ] + } + + public_configs = [ ":public" ] +} + +group("arm") { + public_deps = [ ":$module_name" ] +} + +config("public") { + include_dirs = [ + "include", + "src/include", + ] +} diff --git a/arch/arm/gic/BUILD.gn b/arch/arm/gic/BUILD.gn new file mode 100644 index 00000000..127100f5 --- /dev/null +++ b/arch/arm/gic/BUILD.gn @@ -0,0 +1,41 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +module_name = get_path_info(rebase_path("."), "name") +kernel_module(module_name) { + sources = [] + + if (defined(LOSCFG_ARCH_GIC_V2)) { + sources += [ "gic_v2.c" ] + } else if (defined(LOSCFG_ARCH_GIC_V3)) { + sources += [ "gic_v3.c" ] + } +} diff --git a/bsd/BUILD.gn b/bsd/BUILD.gn new file mode 100644 index 00000000..fac70d00 --- /dev/null +++ b/bsd/BUILD.gn @@ -0,0 +1,86 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +module_switch = defined(LOSCFG_COMPAT_BSD) +module_name = "libbsd" +kernel_module(module_name) { + sources = [ + "kern/bus_if.c", + "kern/device_if.c", + "kern/kern_condvar.c", + "kern/kern_timeout.c", + "kern/subr_bus.c", + "kern/subr_kobj.c", + ] + + if (defined(LOSCFG_ARCH_ARM_AARCH32)) { + sources += [ + "arm/autoconf.c", + "arm/hw_user_copy.S", + "arm/in_cksum.c", + "arm/in_cksum_arm.S", + "arm/nexus.c", + ] + } + + if (defined(LOSCFG_DRIVERS_RANDOM)) { + sources += [ + "crypto/rijndael/rijndael-alg-fst.c", + "crypto/rijndael/rijndael-api-fst.c", + "crypto/sha2/sha256c.c", + "dev/random/hash.c", + "dev/random/yarrow.c", + "libkern/explicit_bzero.c", + ] + } + + public_configs = [ ":public" ] +} + +group("bsd") { + public_deps = [ ":$module_name" ] + + deps = [ + "compat/linuxkpi", + "dev/usb", + ] +} + +config("public") { + include_dirs = [ + ".", + "kern", + ] + configs = [ + "compat/linuxkpi:public", + "dev/usb:public", + ] +} diff --git a/bsd/Kconfig b/bsd/Kconfig index 53c2816a..c19d8cd8 100644 --- a/bsd/Kconfig +++ b/bsd/Kconfig @@ -1,6 +1,14 @@ config COMPAT_BSD bool "Enable FreeBSD" default y + select COMPAT_LINUXKPI help Answer Y to enable LiteOS support FreeBSD. + +config COMPAT_LINUXKPI + bool "Enable linuxkpi" if COMPAT_BSD + default y + + help + Answer Y to enable LiteOS support compatible layer for linuxkpi. diff --git a/bsd/compat/linuxkpi/BUILD.gn b/bsd/compat/linuxkpi/BUILD.gn new file mode 100644 index 00000000..01c73efb --- /dev/null +++ b/bsd/compat/linuxkpi/BUILD.gn @@ -0,0 +1,57 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +module_switch = defined(LOSCFG_COMPAT_BSD) +module_name = get_path_info(rebase_path("."), "name") +kernel_module(module_name) { + sources = [ + "src/adp.c", + "src/linux_completion.c", + "src/linux_interrupt.c", + "src/linux_sched.c", + "src/linux_semaphore.c", + "src/linux_timer.c", + "src/linux_wakelock.c", + "src/linux_workqueue.c", + "src/prctl.c", + "src/tzdst.c", + ] + + if (defined(LOSCFG_HRTIMER_ENABLE)) { + sources += [ "src/linux_hrtimer.c" ] + } + + public_configs = [ ":public" ] +} + +config("public") { + include_dirs = [ "include" ] +} diff --git a/bsd/dev/usb/BUILD.gn b/bsd/dev/usb/BUILD.gn new file mode 100644 index 00000000..c2cb6c1d --- /dev/null +++ b/bsd/dev/usb/BUILD.gn @@ -0,0 +1,154 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +module_switch = defined(LOSCFG_DRIVERS_USB) +module_name = "usb_base" +kernel_module(module_name) { + sources = [ + "implementation/bsd_busspace.c", + "implementation/bsd_kernel.c", + "implementation/usb_btree.c", + "implementation/usb_busdma_loader.c", + "implementation/usb_init.c", + "implementation/usb_version.c", + "usb_debug.c", + ] + + if (defined(LOSCFG_DRIVERS_USB)) { + sources += [ + "controller/usb_controller.c", + "quirk/usb_quirk.c", + "usb_dev.c", + "usb_device.c", + "usb_dynamic.c", + "usb_error.c", + "usb_generic.c", + "usb_handle_request.c", + "usb_hub.c", + "usb_if.c", + "usb_lookup.c", + "usb_mbuf.c", + "usb_parse.c", + "usb_process.c", + "usb_request.c", + "usb_transfer.c", + "usb_util.c", + ] + } + + if (defined(LOSCFG_DRIVERS_USB_4G_MODEM)) { + sources += [ "net/if_cdce.c" ] + } + + if (defined(LOSCFG_DRIVERS_USB_ETHERNET)) { + sources += [ + "net/if_axe.c", + "net/if_axge.c", + ] + } + + if (defined(LOSCFG_DRIVERS_USB_RNDIS_HOST)) { + sources += [ "net/if_urndis.c" ] + } + + if (defined(LOSCFG_DRIVERS_USB_4G_MODEM) || + defined(LOSCFG_DRIVERS_USB_ETHERNET) || + defined(LOSCFG_DRIVERS_USB_RNDIS_HOST)) { + sources += [ + "net/usb_eth_drv.c", + "net/usb_ethernet.c", + ] + } + + if (defined(LOSCFG_DRIVERS_USB_4G_MODEM) || + defined(LOSCFG_DRIVERS_USB_SERIAL)) { + sources += [ + "serial/u3g.c", + "serial/usb_serial.c", + ] + } + + if (defined(LOSCFG_DRIVERS_USB_HOST_EHCI)) { + sources += [ + "controller/ehci.c", + "controller/ehci_pci.c", + ] + } + + if (defined(LOSCFG_DRIVERS_USB_HOST_XHCI) || + defined(LOSCFG_DRIVERS_USB_HOST_XHCI_FOR_PORT2)) { + sources += [ + "controller/xhci.c", + "controller/xhci_pci.c", + ] + } + + if (defined(LOSCFG_DRIVERS_USB_WIRELESS)) { + sources += [ "linux_usb.c" ] + } + + if (defined(LOSCFG_DRIVERS_USB_MASS_STORAGE)) { + sources += [ "storage/umass.c" ] + } + + if (defined(LOSCFG_DRIVERS_USB_HID_CLASS) && + defined(LOSCFG_DRIVERS_HDF_INPUT)) { + sources += [ + "input/uhid.c", + "usb_hid.c", + ] + + include_dirs = [ + "//drivers/framework/model/input/driver", + "//drivers/framework/include/core", + "//drivers/framework/core/common/include/host", + "//drivers/framework/utils", + "//drivers/framework/osal", + "//drivers/framework/ability/sbuf/include", + "//drivers/framework/include/osal", + ] + } + + configs += [ + "$HDFTOPDIR:hdf_config" + ] + + public_configs = [ ":public" ] +} + +group("usb") { + public_deps = [ ":$module_name" ] +} + +config("public") { + include_dirs = [ "." ] + include_dirs += [ "$LITEOSTHIRDPARTY/FreeBSD/sys/dev/evdev" ] +} diff --git a/compat/BUILD.gn b/compat/BUILD.gn new file mode 100644 index 00000000..300dcf3e --- /dev/null +++ b/compat/BUILD.gn @@ -0,0 +1,38 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +group("compat") { + deps = [ "posix" ] +} + +config("public") { + configs = [ "posix:public" ] +} diff --git a/compat/posix/BUILD.gn b/compat/posix/BUILD.gn new file mode 100644 index 00000000..d145e64f --- /dev/null +++ b/compat/posix/BUILD.gn @@ -0,0 +1,55 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +module_switch = defined(LOSCFG_COMPAT_POSIX) +module_name = get_path_info(rebase_path("."), "name") +kernel_module(module_name) { + sources = [ + "src/map_error.c", + "src/misc.c", + "src/mqueue.c", + "src/posix_memalign.c", + "src/pthread.c", + "src/pthread_attr.c", + "src/pthread_cond.c", + "src/pthread_mutex.c", + "src/sched.c", + "src/semaphore.c", + "src/socket.c", + "src/time.c", + ] + + public_configs = [ ":public" ] +} + +config("public") { + include_dirs = [ "include" ] +} diff --git a/drivers/BUILD.gn b/drivers/BUILD.gn new file mode 100644 index 00000000..4926f959 --- /dev/null +++ b/drivers/BUILD.gn @@ -0,0 +1,70 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +cmd = "if [ -f $device_path/drivers/BUILD.gn ]; then echo true; else echo false; fi" +HAVE_DEVICE_DRIVERS = exec_script("//build/lite/run_shell_cmd.py", [ cmd ], "value") + +module_switch = defined(LOSCFG_DRIVERS) +group("drivers") { + if (module_switch) { + deps = [ + "block/disk", + "char/bch", + "char/mem", + "char/quickstart", + "char/random", + "char/video", + "mtd/multi_partition", + "//drivers/adapter/khdf/liteos", + "//drivers/liteos", + ] + if (HAVE_DEVICE_DRIVERS) { + deps += [ "$device_path/drivers" ] + } + } +} + +config("public") { + configs = [ + "block/disk:public", + "char/bch:public", + "char/mem:public", + "char/quickstart:public", + "char/random:public", + "char/video:public", + "mtd/multi_partition:public", + "//drivers/adapter/khdf/liteos:public", + "//drivers/liteos:public", + ] + if (HAVE_DEVICE_DRIVERS) { + configs += [ "$device_path/drivers:public" ] + } +} diff --git a/drivers/block/disk/BUILD.gn b/drivers/block/disk/BUILD.gn new file mode 100644 index 00000000..48e42b06 --- /dev/null +++ b/drivers/block/disk/BUILD.gn @@ -0,0 +1,45 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +module_switch = defined(LOSCFG_FS_FAT_DISK) +module_name = get_path_info(rebase_path("."), "name") +kernel_module(module_name) { + sources = [ + "src/disk.c", + "src/disk_shellcmd.c", + ] + + public_configs = [ ":public" ] +} + +config("public") { + include_dirs = [ "include" ] +} diff --git a/drivers/char/bch/BUILD.gn b/drivers/char/bch/BUILD.gn new file mode 100644 index 00000000..cc684575 --- /dev/null +++ b/drivers/char/bch/BUILD.gn @@ -0,0 +1,52 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +module_switch = defined(LOSCFG_FS_VFS_BLOCK_DEVICE) +module_name = get_path_info(rebase_path("."), "name") +kernel_module(module_name) { + sources = [ + "$LITEOSTHIRDPARTY/NuttX/drivers/bch/bchdev_driver.c", + "$LITEOSTHIRDPARTY/NuttX/drivers/bch/bchdev_register.c", + "$LITEOSTHIRDPARTY/NuttX/drivers/bch/bchdev_unregister.c", + "$LITEOSTHIRDPARTY/NuttX/drivers/bch/bchlib_cache.c", + "$LITEOSTHIRDPARTY/NuttX/drivers/bch/bchlib_read.c", + "$LITEOSTHIRDPARTY/NuttX/drivers/bch/bchlib_sem.c", + "$LITEOSTHIRDPARTY/NuttX/drivers/bch/bchlib_setup.c", + "$LITEOSTHIRDPARTY/NuttX/drivers/bch/bchlib_teardown.c", + "$LITEOSTHIRDPARTY/NuttX/drivers/bch/bchlib_write.c", + ] + + public_configs = [ ":public" ] +} + +config("public") { + include_dirs = [ "include" ] +} diff --git a/drivers/char/mem/BUILD.gn b/drivers/char/mem/BUILD.gn new file mode 100644 index 00000000..aad2d717 --- /dev/null +++ b/drivers/char/mem/BUILD.gn @@ -0,0 +1,42 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +module_switch = defined(LOSCFG_DRIVERS_MEM) +module_name = get_path_info(rebase_path("."), "name") +kernel_module(module_name) { + sources = [ "src/mem.c" ] + + public_configs = [ ":public" ] +} + +config("public") { + include_dirs = [ "include" ] +} diff --git a/drivers/char/quickstart/BUILD.gn b/drivers/char/quickstart/BUILD.gn new file mode 100644 index 00000000..9f2cb98d --- /dev/null +++ b/drivers/char/quickstart/BUILD.gn @@ -0,0 +1,42 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +module_switch = defined(LOSCFG_DRIVERS_QUICKSTART) +module_name = get_path_info(rebase_path("."), "name") +kernel_module(module_name) { + sources = [ "src/quickstart.c" ] + + public_configs = [ ":public" ] +} + +config("public") { + include_dirs = [ "include" ] +} diff --git a/drivers/char/random/BUILD.gn b/drivers/char/random/BUILD.gn new file mode 100644 index 00000000..0410df5b --- /dev/null +++ b/drivers/char/random/BUILD.gn @@ -0,0 +1,46 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +module_switch = defined(LOSCFG_DRIVERS_RANDOM) +module_name = get_path_info(rebase_path("."), "name") +kernel_module(module_name) { + sources = [ "src/random.c" ] + + if (defined(LOSCFG_HW_RANDOM_ENABLE)) { + sources += [ "src/random_hw.c" ] + } + + public_configs = [ ":public" ] +} + +config("public") { + include_dirs = [ "include" ] +} diff --git a/drivers/char/video/BUILD.gn b/drivers/char/video/BUILD.gn new file mode 100644 index 00000000..1470983e --- /dev/null +++ b/drivers/char/video/BUILD.gn @@ -0,0 +1,42 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +module_switch = defined(LOSCFG_DRIVERS_VIDEO) +module_name = get_path_info(rebase_path("."), "name") +kernel_module(module_name) { + sources = [ "$LITEOSTHIRDPARTY/NuttX/drivers/video/fb.c" ] + + public_configs = [ ":public" ] +} + +config("public") { + include_dirs = [ "$LITEOSTHIRDPARTY/NuttX/include/nuttx/video" ] +} diff --git a/drivers/mtd/multi_partition/BUILD.gn b/drivers/mtd/multi_partition/BUILD.gn new file mode 100644 index 00000000..625a89d5 --- /dev/null +++ b/drivers/mtd/multi_partition/BUILD.gn @@ -0,0 +1,54 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +module_switch = defined(LOSCFG_FS_VFS) +module_name = get_path_info(rebase_path("."), "name") +kernel_module(module_name) { + sources = [ + "src/mtd_partition.c", + "src/mtd_shellcmd.c", + ] + + include_dirs = [ + "$LITEOSTOPDIR/fs/jffs2/include", + "//device/hisilicon/drivers/include/mtd/common/include", + ] + + if (defined(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7)) { + include_dirs += [ "//device/qemu/drivers/cfiflash" ] + } + + public_configs = [ ":public" ] +} + +config("public") { + include_dirs = [ "include" ] +} diff --git a/fs/BUILD.gn b/fs/BUILD.gn new file mode 100644 index 00000000..f148c269 --- /dev/null +++ b/fs/BUILD.gn @@ -0,0 +1,56 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +group("fs") { + deps = [ + "fat", + "fat/virpart", + "jffs2", + "nfs", + "proc", + "ramfs", + "romfs", + "vfs", + "vfs/bcache", + "zpfs", + ] +} + +config("public") { + include_dirs = [ "include" ] + configs = [ + "vfs:public", + "vfs/bcache:public", + "fat:public", + "fat/virpart:public", + "proc:public", + ] +} diff --git a/fs/fat/BUILD.gn b/fs/fat/BUILD.gn new file mode 100644 index 00000000..34abc034 --- /dev/null +++ b/fs/fat/BUILD.gn @@ -0,0 +1,55 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +module_switch = defined(LOSCFG_FS_FAT) +module_name = get_path_info(rebase_path("."), "name") +kernel_module(module_name) { + sources = [ + "os_adapt/fat_shellcmd.c", + "os_adapt/fatfs.c", + "os_adapt/format.c", + ] + + sources += [ + "$LITEOSTHIRDPARTY/FatFs/source/diskio.c", + "$LITEOSTHIRDPARTY/FatFs/source/ff.c", + "$LITEOSTHIRDPARTY/FatFs/source/ffsystem.c", + "$LITEOSTHIRDPARTY/FatFs/source/ffunicode.c", + ] + + include_dirs = [ "os_adapt" ] + + public_configs = [ ":public" ] +} + +config("public") { + include_dirs = [ "$LITEOSTHIRDPARTY/FatFs/source" ] +} diff --git a/fs/fat/virpart/BUILD.gn b/fs/fat/virpart/BUILD.gn new file mode 100644 index 00000000..08178e2d --- /dev/null +++ b/fs/fat/virpart/BUILD.gn @@ -0,0 +1,47 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +module_switch = defined(LOSCFG_FS_FAT_VIRTUAL_PARTITION) +module_name = get_path_info(rebase_path("."), "name") +kernel_module(module_name) { + sources = [ + "src/virpart.c", + "src/virpartff.c", + ] + + include_dirs = [ "../os_adapt" ] + + public_configs = [ ":public" ] +} + +config("public") { + include_dirs = [ "include" ] +} diff --git a/fs/jffs2/BUILD.gn b/fs/jffs2/BUILD.gn new file mode 100644 index 00000000..bf5eecc1 --- /dev/null +++ b/fs/jffs2/BUILD.gn @@ -0,0 +1,75 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +module_switch = defined(LOSCFG_FS_JFFS) +module_name = get_path_info(rebase_path("."), "name") +kernel_module(module_name) { + sources = [ + "src/jffs2_hash.c", + "src/vfs_jffs2.c", + ] + + sources += [ + "$LITEOSTHIRDPARTY/Linux_Kernel/fs/jffs2/background.c", + "$LITEOSTHIRDPARTY/Linux_Kernel/fs/jffs2/build.c", + "$LITEOSTHIRDPARTY/Linux_Kernel/fs/jffs2/compr.c", + "$LITEOSTHIRDPARTY/Linux_Kernel/fs/jffs2/compr_rtime.c", + "$LITEOSTHIRDPARTY/Linux_Kernel/fs/jffs2/compr_rubin.c", + "$LITEOSTHIRDPARTY/Linux_Kernel/fs/jffs2/compr_zlib.c", + "$LITEOSTHIRDPARTY/Linux_Kernel/fs/jffs2/debug.c", + "$LITEOSTHIRDPARTY/Linux_Kernel/fs/jffs2/dir.c", + "$LITEOSTHIRDPARTY/Linux_Kernel/fs/jffs2/erase.c", + "$LITEOSTHIRDPARTY/Linux_Kernel/fs/jffs2/file.c", + "$LITEOSTHIRDPARTY/Linux_Kernel/fs/jffs2/fs.c", + "$LITEOSTHIRDPARTY/Linux_Kernel/fs/jffs2/gc.c", + "$LITEOSTHIRDPARTY/Linux_Kernel/fs/jffs2/malloc.c", + "$LITEOSTHIRDPARTY/Linux_Kernel/fs/jffs2/nodelist.c", + "$LITEOSTHIRDPARTY/Linux_Kernel/fs/jffs2/nodemgmt.c", + "$LITEOSTHIRDPARTY/Linux_Kernel/fs/jffs2/read.c", + "$LITEOSTHIRDPARTY/Linux_Kernel/fs/jffs2/readinode.c", + "$LITEOSTHIRDPARTY/Linux_Kernel/fs/jffs2/scan.c", + "$LITEOSTHIRDPARTY/Linux_Kernel/fs/jffs2/summary.c", + "$LITEOSTHIRDPARTY/Linux_Kernel/fs/jffs2/super.c", + "$LITEOSTHIRDPARTY/Linux_Kernel/fs/jffs2/write.c", + "$LITEOSTHIRDPARTY/Linux_Kernel/fs/jffs2/writev.c", + ] + + include_dirs = [ + "$LITEOSTHIRDPARTY/Linux_Kernel/fs/jffs2", + "$LITEOSTHIRDPARTY/Linux_Kernel/fs", + ] + + public_configs = [ ":public" ] +} + +config("public") { + include_dirs = [ "include" ] +} diff --git a/fs/nfs/BUILD.gn b/fs/nfs/BUILD.gn new file mode 100644 index 00000000..8f987f9d --- /dev/null +++ b/fs/nfs/BUILD.gn @@ -0,0 +1,40 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +module_switch = defined(LOSCFG_FS_NFS) +module_name = get_path_info(rebase_path("."), "name") +kernel_module(module_name) { + sources = [ + "$LITEOSTHIRDPARTY/NuttX/fs/nfs/nfs_adapter.c", + "$LITEOSTHIRDPARTY/NuttX/fs/nfs/nfs_util.c", + "$LITEOSTHIRDPARTY/NuttX/fs/nfs/rpc_clnt.c", + ] +} diff --git a/fs/proc/BUILD.gn b/fs/proc/BUILD.gn index 122e956e..2c133512 100644 --- a/fs/proc/BUILD.gn +++ b/fs/proc/BUILD.gn @@ -25,23 +25,31 @@ # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -static_library("fs_proc") { +import("//kernel/liteos_a/liteos.gni") + +module_switch = defined(LOSCFG_FS_PROC) +module_name = get_path_info(rebase_path("."), "name") +kernel_module(module_name) { sources = [ + "os_adapt/fd_proc.c", + "os_adapt/fs_cache_proc.c", + "os_adapt/kernel_trace_proc.c", + "os_adapt/mounts_proc.c", + "os_adapt/power_proc.c", "os_adapt/proc_init.c", - "os_adapt/vfs_proc.c", + "os_adapt/proc_vfs.c", + "os_adapt/process_proc.c", + "os_adapt/uptime_proc.c", + "os_adapt/vmm_proc.c", + "src/proc_file.c", "src/proc_shellcmd.c", - "src/pseudofs.c", - "src/seq_file.c", ] - include_dirs = [ "include" ] - - if (LOSCFG_LLTREPORT) { - cflags += [ - "-fprofile-arcs", - "-ftest-coverage", - ] - } + public_configs = [ ":public" ] +} + +config("public") { + include_dirs = [ "include" ] } diff --git a/fs/ramfs/BUILD.gn b/fs/ramfs/BUILD.gn new file mode 100644 index 00000000..5b593f83 --- /dev/null +++ b/fs/ramfs/BUILD.gn @@ -0,0 +1,36 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +module_switch = defined(LOSCFG_FS_RAMFS) +module_name = get_path_info(rebase_path("."), "name") +kernel_module(module_name) { + sources = [ "$LITEOSTHIRDPARTY/NuttX/fs/tmpfs/fs_tmpfs.c" ] +} diff --git a/fs/romfs/BUILD.gn b/fs/romfs/BUILD.gn new file mode 100644 index 00000000..eef06c08 --- /dev/null +++ b/fs/romfs/BUILD.gn @@ -0,0 +1,39 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +module_switch = defined(LOSCFG_FS_ROMFS) +module_name = get_path_info(rebase_path("."), "name") +kernel_module(module_name) { + sources = [ + "$LITEOSTHIRDPARTY/NuttX/fs/romfs/fs_romfs.c", + "$LITEOSTHIRDPARTY/NuttX/fs/romfs/fs_romfsutil.c", + ] +} diff --git a/fs/vfs/BUILD.gn b/fs/vfs/BUILD.gn new file mode 100644 index 00000000..1cd4859e --- /dev/null +++ b/fs/vfs/BUILD.gn @@ -0,0 +1,116 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +module_switch = defined(LOSCFG_FS_VFS) +module_name = get_path_info(rebase_path("."), "name") +kernel_module(module_name) { + sources = [ + "operation/fs_chattr.c", + "operation/fs_check.c", + "operation/fs_fallocate.c", + "operation/fs_fallocate64.c", + "operation/fs_file.c", + "operation/fs_file_mapping.c", + "operation/fs_init.c", + "operation/fs_other.c", + "operation/fs_preadv.c", + "operation/fs_pwritev.c", + "operation/fs_readv.c", + "operation/fs_utime.c", + "operation/fs_writev.c", + "operation/fullpath.c", + "vfs_cmd/vfs_shellcmd.c", + ] + + sources += [ + "$LITEOSTHIRDPARTY/NuttX/fs/dirent/fs_closedir.c", + "$LITEOSTHIRDPARTY/NuttX/fs/dirent/fs_opendir.c", + "$LITEOSTHIRDPARTY/NuttX/fs/dirent/fs_readdir.c", + "$LITEOSTHIRDPARTY/NuttX/fs/dirent/fs_rewinddir.c", + "$LITEOSTHIRDPARTY/NuttX/fs/dirent/fs_seekdir.c", + "$LITEOSTHIRDPARTY/NuttX/fs/dirent/fs_telldir.c", + "$LITEOSTHIRDPARTY/NuttX/fs/driver/fs_blockproxy.c", + "$LITEOSTHIRDPARTY/NuttX/fs/driver/fs_closeblockdriver.c", + "$LITEOSTHIRDPARTY/NuttX/fs/driver/fs_findblockdriver.c", + "$LITEOSTHIRDPARTY/NuttX/fs/driver/fs_openblockdriver.c", + "$LITEOSTHIRDPARTY/NuttX/fs/driver/fs_registerblockdriver.c", + "$LITEOSTHIRDPARTY/NuttX/fs/driver/fs_registerdriver.c", + "$LITEOSTHIRDPARTY/NuttX/fs/driver/fs_unregisterblockdriver.c", + "$LITEOSTHIRDPARTY/NuttX/fs/driver/fs_unregisterdriver.c", + "$LITEOSTHIRDPARTY/NuttX/fs/inode/fs_files.c", + "$LITEOSTHIRDPARTY/NuttX/fs/mount/fs_foreachmountpoint.c", + "$LITEOSTHIRDPARTY/NuttX/fs/mount/fs_mount.c", + "$LITEOSTHIRDPARTY/NuttX/fs/mount/fs_umount.c", + "$LITEOSTHIRDPARTY/NuttX/fs/vfs/fs_close.c", + "$LITEOSTHIRDPARTY/NuttX/fs/vfs/fs_dup.c", + "$LITEOSTHIRDPARTY/NuttX/fs/vfs/fs_dup2.c", + "$LITEOSTHIRDPARTY/NuttX/fs/vfs/fs_dupfd.c", + "$LITEOSTHIRDPARTY/NuttX/fs/vfs/fs_dupfd2.c", + "$LITEOSTHIRDPARTY/NuttX/fs/vfs/fs_fcntl.c", + "$LITEOSTHIRDPARTY/NuttX/fs/vfs/fs_fsync.c", + "$LITEOSTHIRDPARTY/NuttX/fs/vfs/fs_getfilep.c", + "$LITEOSTHIRDPARTY/NuttX/fs/vfs/fs_ioctl.c", + "$LITEOSTHIRDPARTY/NuttX/fs/vfs/fs_link.c", + "$LITEOSTHIRDPARTY/NuttX/fs/vfs/fs_lseek.c", + "$LITEOSTHIRDPARTY/NuttX/fs/vfs/fs_lseek64.c", + "$LITEOSTHIRDPARTY/NuttX/fs/vfs/fs_mkdir.c", + "$LITEOSTHIRDPARTY/NuttX/fs/vfs/fs_open.c", + "$LITEOSTHIRDPARTY/NuttX/fs/vfs/fs_poll.c", + "$LITEOSTHIRDPARTY/NuttX/fs/vfs/fs_pread.c", + "$LITEOSTHIRDPARTY/NuttX/fs/vfs/fs_pread64.c", + "$LITEOSTHIRDPARTY/NuttX/fs/vfs/fs_pwrite.c", + "$LITEOSTHIRDPARTY/NuttX/fs/vfs/fs_pwrite64.c", + "$LITEOSTHIRDPARTY/NuttX/fs/vfs/fs_read.c", + "$LITEOSTHIRDPARTY/NuttX/fs/vfs/fs_readlink.c", + "$LITEOSTHIRDPARTY/NuttX/fs/vfs/fs_rename.c", + "$LITEOSTHIRDPARTY/NuttX/fs/vfs/fs_rmdir.c", + "$LITEOSTHIRDPARTY/NuttX/fs/vfs/fs_select.c", + "$LITEOSTHIRDPARTY/NuttX/fs/vfs/fs_sendfile.c", + "$LITEOSTHIRDPARTY/NuttX/fs/vfs/fs_stat.c", + "$LITEOSTHIRDPARTY/NuttX/fs/vfs/fs_statfs.c", + "$LITEOSTHIRDPARTY/NuttX/fs/vfs/fs_symlink.c", + "$LITEOSTHIRDPARTY/NuttX/fs/vfs/fs_truncate.c", + "$LITEOSTHIRDPARTY/NuttX/fs/vfs/fs_truncate64.c", + "$LITEOSTHIRDPARTY/NuttX/fs/vfs/fs_unlink.c", + "$LITEOSTHIRDPARTY/NuttX/fs/vfs/fs_write.c", + "$LITEOSTOPDIR/fs/vfs/mount.c", + "$LITEOSTOPDIR/fs/vfs/path_cache.c", + "$LITEOSTOPDIR/fs/vfs/vnode.c", + "$LITEOSTOPDIR/fs/vfs/vnode_hash.c", + ] + + include_dirs = [ "$LITEOSTOPDIR/syscall" ] + public_configs = [ ":public" ] +} + +config("public") { + include_dirs = [ "include" ] +} diff --git a/fs/vfs/bcache/BUILD.gn b/fs/vfs/bcache/BUILD.gn new file mode 100644 index 00000000..6f52a9bc --- /dev/null +++ b/fs/vfs/bcache/BUILD.gn @@ -0,0 +1,42 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +module_switch = defined(LOSCFG_FS_FAT_CACHE) +module_name = get_path_info(rebase_path("."), "name") +kernel_module(module_name) { + sources = [ "src/bcache.c" ] + + public_configs = [ ":public" ] +} + +config("public") { + include_dirs = [ "../include/bcache" ] +} diff --git a/fs/zpfs/BUILD.gn b/fs/zpfs/BUILD.gn index e8094f4f..e0cc31e2 100644 --- a/fs/zpfs/BUILD.gn +++ b/fs/zpfs/BUILD.gn @@ -27,16 +27,13 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -static_library("fs_zpfs") { +import("//kernel/liteos_a/liteos.gni") + +module_switch = defined(LOSCFG_FS_ZPFS) +module_name = get_path_info(rebase_path("."), "name") +kernel_module(module_name) { sources = [ "vfs_zpfs.c", "zpfs.c", ] - - if (LOSCFG_LLTREPORT) { - cflags += [ - "-fprofile-arcs", - "-ftest-coverage", - ] - } } diff --git a/kernel/BUILD.gn b/kernel/BUILD.gn index 34a26649..504db26b 100644 --- a/kernel/BUILD.gn +++ b/kernel/BUILD.gn @@ -25,32 +25,24 @@ # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -import("//build/lite/config/component/lite_component.gni") +import("//kernel/liteos_a/liteos.gni") -lite_component("kernel") { - features = [ +group("kernel") { + deps = [ "base", - "syscall", + "common", + "extended", "user", ] - if (LOSCFG_KERNEL_CPUP) { - features += [ "extended/cpup" ] - } - if (LOSCFG_KERNEL_MPU) { - features += [ "extended/mpu" ] - } - if (LOSCFG_KERNEL_CPPSUPPORT) { - features += [ "extended/cppsupport" ] - } - if (LOSCFG_KERNEL_DYNLOAD) { - features += [ "extended/dynload" ] - } - if (LOSCFG_KERNEL_TRACE) { - features += [ "extended/trace" ] - } - if (LOSCFG_KERNEL_VDSO) { - features += [ "extended/vdso" ] - } +} + +config("public") { + include_dirs = [ "include" ] + configs = [ + "base:public", + "common:public", + "extended:public", + ] } diff --git a/kernel/base/BUILD.gn b/kernel/base/BUILD.gn index 67cb2543..b231ed27 100644 --- a/kernel/base/BUILD.gn +++ b/kernel/base/BUILD.gn @@ -25,9 +25,12 @@ # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -static_library("base") { +import("//kernel/liteos_a/liteos.gni") + +module_name = get_path_info(rebase_path("."), "name") +kernel_module(module_name) { sources = [ "core/los_bitmap.c", "core/los_process.c", @@ -36,22 +39,24 @@ static_library("base") { "core/los_sys.c", "core/los_task.c", "core/los_tick.c", - "core/los_timeslice.c", "ipc/los_event.c", + "ipc/los_futex.c", "ipc/los_ipcdebug.c", "ipc/los_mux.c", - "ipc/los_mux_debug.c", "ipc/los_queue.c", "ipc/los_queue_debug.c", + "ipc/los_rwlock.c", "ipc/los_sem.c", "ipc/los_sem_debug.c", - "mem/bestfit/los_memory.c", - "mem/bestfit/los_multipledlinkhead.c", + "ipc/los_signal.c", "mem/common/los_memstat.c", "mem/membox/los_membox.c", + "mem/tlsf/los_memory.c", + "misc/kill_shellcmd.c", "misc/los_misc.c", "misc/los_stackinfo.c", "misc/mempt_shellcmd.c", + "misc/panic_shellcmd.c", "misc/swtmr_shellcmd.c", "misc/sysinfo_shellcmd.c", "misc/task_shellcmd.c", @@ -59,22 +64,33 @@ static_library("base") { "mp/los_lockdep.c", "mp/los_mp.c", "mp/los_percpu.c", + "mp/los_spinlock.c", "mp/los_stat.c", "om/los_err.c", - "sched/sched_sq/los_priqueue.c", "sched/sched_sq/los_sched.c", - "vm/filemap.c", - "vm/pmm.c", - "vm/vm.c", - "vm/vmm.c", + "vm/los_vm_boot.c", + "vm/los_vm_dump.c", + "vm/los_vm_fault.c", + "vm/los_vm_filemap.c", + "vm/los_vm_iomap.c", + "vm/los_vm_map.c", + "vm/los_vm_page.c", + "vm/los_vm_phys.c", + "vm/los_vm_scan.c", + "vm/los_vm_syscall.c", + "vm/oom.c", + "vm/shm.c", ] - include_dirs = [ - "include", - "../extended/include", - "../extended/vdso/include", - "../extended/dynload/include", - "../include", - "mem", - ] + if (defined(LOSCFG_SHELL_CMD_DEBUG)) { + configs += [ + "$HDFTOPDIR:hdf_config" + ] + } + + public_configs = [ ":public" ] +} + +config("public") { + include_dirs = [ "include" ] } diff --git a/kernel/base/misc/panic_shellcmd.c b/kernel/base/misc/panic_shellcmd.c index 0829a7e7..1923c625 100644 --- a/kernel/base/misc/panic_shellcmd.c +++ b/kernel/base/misc/panic_shellcmd.c @@ -35,7 +35,6 @@ #include "shell.h" #endif #include "los_swtmr_pri.h" -#include "watchdog_if.h" #ifdef LOSCFG_SHELL_CMD_DEBUG @@ -46,6 +45,7 @@ LITE_OS_SEC_TEXT_MINOR BOOL OsSystemExcIsReset(VOID) return systemExcReset; } #ifdef LOSCFG_DRIVERS_HDF_PLATFORM_WATCHDOG +#include "watchdog_if.h" #define WATCHDOG_TIMER_INTERVAL 5 // 5 seconds #define WATCHDOG_TIMER_INTERVAL_HALF (WATCHDOG_TIMER_INTERVAL / 2) diff --git a/kernel/common/BUILD.gn b/kernel/common/BUILD.gn new file mode 100644 index 00000000..02da36bc --- /dev/null +++ b/kernel/common/BUILD.gn @@ -0,0 +1,48 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +group("common") { + deps = [ + "blackbox", + "hidumper", + "patchfs", + "rootfs", + ] +} + +config("public") { + configs = [ + "blackbox:public", + "hidumper:public", + "patchfs:public", + "rootfs:public", + ] +} diff --git a/kernel/common/blackbox/BUILD.gn b/kernel/common/blackbox/BUILD.gn new file mode 100644 index 00000000..b1327cf3 --- /dev/null +++ b/kernel/common/blackbox/BUILD.gn @@ -0,0 +1,47 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +module_switch = defined(LOSCFG_BLACKBOX) +module_name = get_path_info(rebase_path("."), "name") +kernel_module(module_name) { + sources = [ + "los_blackbox_common.c", + "los_blackbox_core.c", + "los_blackbox_detector.c", + "los_blackbox_system_adapter.c", + ] + include_dirs = [ "$LITEOSTOPDIR/syscall" ] + public_configs = [ ":public" ] +} + +config("public") { + include_dirs = [ "." ] +} diff --git a/kernel/common/hidumper/BUILD.gn b/kernel/common/hidumper/BUILD.gn new file mode 100644 index 00000000..93f74119 --- /dev/null +++ b/kernel/common/hidumper/BUILD.gn @@ -0,0 +1,41 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +module_switch = defined(LOSCFG_HIDUMPER) +module_name = get_path_info(rebase_path("."), "name") +kernel_module(module_name) { + sources = [ "los_hidumper.c" ] + public_configs = [ ":public" ] +} + +config("public") { + include_dirs = [ "." ] +} diff --git a/kernel/common/patchfs/BUILD.gn b/kernel/common/patchfs/BUILD.gn new file mode 100644 index 00000000..28d5e761 --- /dev/null +++ b/kernel/common/patchfs/BUILD.gn @@ -0,0 +1,44 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +module_switch = defined(LOSCFG_PLATFORM_PATCHFS) +module_name = get_path_info(rebase_path("."), "name") +kernel_module(module_name) { + sources = [ + "los_partition_utils.c", + "los_patchfs.c", + ] + public_configs = [ ":public" ] +} + +config("public") { + include_dirs = [ "." ] +} diff --git a/kernel/common/rootfs/BUILD.gn b/kernel/common/rootfs/BUILD.gn new file mode 100644 index 00000000..e69ae93e --- /dev/null +++ b/kernel/common/rootfs/BUILD.gn @@ -0,0 +1,44 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +module_switch = defined(LOSCFG_PLATFORM_ROOTFS) +module_name = get_path_info(rebase_path("."), "name") +kernel_module(module_name) { + sources = [ + "los_bootargs.c", + "los_rootfs.c", + ] + public_configs = [ ":public" ] +} + +config("public") { + include_dirs = [ "." ] +} diff --git a/kernel/common/Kconfig b/kernel/common/rootfs/Kconfig similarity index 100% rename from kernel/common/Kconfig rename to kernel/common/rootfs/Kconfig diff --git a/kernel/common/Makefile b/kernel/common/rootfs/Makefile similarity index 100% rename from kernel/common/Makefile rename to kernel/common/rootfs/Makefile diff --git a/kernel/common/los_bootargs.c b/kernel/common/rootfs/los_bootargs.c similarity index 100% rename from kernel/common/los_bootargs.c rename to kernel/common/rootfs/los_bootargs.c diff --git a/kernel/common/los_bootargs.h b/kernel/common/rootfs/los_bootargs.h similarity index 100% rename from kernel/common/los_bootargs.h rename to kernel/common/rootfs/los_bootargs.h diff --git a/kernel/common/los_rootfs.c b/kernel/common/rootfs/los_rootfs.c similarity index 100% rename from kernel/common/los_rootfs.c rename to kernel/common/rootfs/los_rootfs.c diff --git a/kernel/common/los_rootfs.h b/kernel/common/rootfs/los_rootfs.h similarity index 100% rename from kernel/common/los_rootfs.h rename to kernel/common/rootfs/los_rootfs.h diff --git a/kernel/extended/BUILD.gn b/kernel/extended/BUILD.gn new file mode 100644 index 00000000..d171bc1f --- /dev/null +++ b/kernel/extended/BUILD.gn @@ -0,0 +1,56 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +group("extended") { + deps = [ + "cppsupport", + "cpup", + "dynload", + "hilog", + "liteipc", + "pipes", + "power", + "trace", + "vdso", + ] +} + +config("public") { + configs = [ + "cpup:public", + "dynload:public", + "vdso:public", + "trace:public", + "liteipc:public", + "pipes:public", + "hilog:public", + ] +} diff --git a/kernel/extended/cppsupport/BUILD.gn b/kernel/extended/cppsupport/BUILD.gn new file mode 100644 index 00000000..d264cd20 --- /dev/null +++ b/kernel/extended/cppsupport/BUILD.gn @@ -0,0 +1,36 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +module_switch = defined(LOSCFG_KERNEL_CPPSUPPORT) +module_name = get_path_info(rebase_path("."), "name") +kernel_module(module_name) { + sources = [ "los_cppsupport.c" ] +} diff --git a/kernel/extended/cpup/BUILD.gn b/kernel/extended/cpup/BUILD.gn new file mode 100644 index 00000000..2482774f --- /dev/null +++ b/kernel/extended/cpup/BUILD.gn @@ -0,0 +1,45 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +module_switch = defined(LOSCFG_KERNEL_CPUP) +module_name = get_path_info(rebase_path("."), "name") +kernel_module(module_name) { + sources = [ + "cpup_shellcmd.c", + "los_cpup.c", + ] + + public_configs = [ ":public" ] +} + +config("public") { + include_dirs = [ "." ] +} diff --git a/kernel/extended/include/los_cpup_pri.h b/kernel/extended/cpup/los_cpup_pri.h similarity index 100% rename from kernel/extended/include/los_cpup_pri.h rename to kernel/extended/cpup/los_cpup_pri.h diff --git a/kernel/extended/dynload/BUILD.gn b/kernel/extended/dynload/BUILD.gn new file mode 100644 index 00000000..110abc4c --- /dev/null +++ b/kernel/extended/dynload/BUILD.gn @@ -0,0 +1,45 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +module_switch = defined(LOSCFG_KERNEL_DYNLOAD) +module_name = get_path_info(rebase_path("."), "name") +kernel_module(module_name) { + sources = [ + "src/los_exec_elf.c", + "src/los_load_elf.c", + ] + + public_configs = [ ":public" ] +} + +config("public") { + include_dirs = [ "include" ] +} diff --git a/kernel/extended/hilog/BUILD.gn b/kernel/extended/hilog/BUILD.gn new file mode 100644 index 00000000..16e05fe9 --- /dev/null +++ b/kernel/extended/hilog/BUILD.gn @@ -0,0 +1,45 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +module_switch = defined(LOSCFG_BASE_CORE_HILOG) +module_name = get_path_info(rebase_path("."), "name") +kernel_module(module_name) { + sources = [ "//base/hiviewdfx/hilog_lite/frameworks/featured/hiview_log.c" ] + + public_configs = [ ":public" ] +} + +config("public") { + include_dirs = [ + "//base/hiviewdfx/hilog_lite/interfaces/native/kits", + "//base/hiviewdfx/hilog_lite/interfaces/native/kits/hilog", + ] +} diff --git a/kernel/extended/liteipc/BUILD.gn b/kernel/extended/liteipc/BUILD.gn new file mode 100644 index 00000000..5074fe3a --- /dev/null +++ b/kernel/extended/liteipc/BUILD.gn @@ -0,0 +1,41 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +module_switch = defined(LOSCFG_KERNEL_LITEIPC) +module_name = get_path_info(rebase_path("."), "name") +kernel_module(module_name) { + sources = [ "hm_liteipc.c" ] + public_configs = [ ":public" ] +} + +config("public") { + include_dirs = [ "." ] +} diff --git a/kernel/extended/power/BUILD.gn b/kernel/extended/power/BUILD.gn new file mode 100644 index 00000000..d21ffda6 --- /dev/null +++ b/kernel/extended/power/BUILD.gn @@ -0,0 +1,36 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +module_switch = defined(LOSCFG_KERNEL_PM) +module_name = get_path_info(rebase_path("."), "name") +kernel_module(module_name) { + sources = [ "los_pm.c" ] +} diff --git a/kernel/extended/trace/BUILD.gn b/kernel/extended/trace/BUILD.gn new file mode 100644 index 00000000..ac772b6e --- /dev/null +++ b/kernel/extended/trace/BUILD.gn @@ -0,0 +1,45 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +module_switch = defined(LOSCFG_KERNEL_TRACE) +module_name = get_path_info(rebase_path("."), "name") +kernel_module(module_name) { + sources = [ + "los_trace.c", + "los_trace_frame.c", + ] + + public_configs = [ ":public" ] +} + +config("public") { + include_dirs = [ "." ] +} diff --git a/kernel/extended/include/los_trace_pri.h b/kernel/extended/trace/los_trace_pri.h similarity index 100% rename from kernel/extended/include/los_trace_pri.h rename to kernel/extended/trace/los_trace_pri.h diff --git a/kernel/extended/vdso/BUILD.gn b/kernel/extended/vdso/BUILD.gn new file mode 100644 index 00000000..82062c17 --- /dev/null +++ b/kernel/extended/vdso/BUILD.gn @@ -0,0 +1,53 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +module_switch = defined(LOSCFG_KERNEL_VDSO) +module_name = get_path_info(rebase_path("."), "name") +kernel_module(module_name) { + sources = [ + "src/los_vdso.c", + "src/los_vdso_text.S", + ] + + asmflags = [ "-DOHOS_VDSO_SO=\"OHOS-vdso.so\"" ] + deps = [ ":copy_ohos_vdso" ] + public_configs = [ ":public" ] +} + +config("public") { + include_dirs = [ "include" ] +} + +copy("copy_ohos_vdso") { + deps = [ "usr:OHOS-vdso" ] + sources = [ "$root_out_dir/libOHOS-vdso.so" ] + outputs = [ "$root_out_dir/OHOS-vdso.so" ] +} diff --git a/kernel/extended/vdso/src/Makefile b/kernel/extended/vdso/src/Makefile index 90e2c714..f5de37ee 100644 --- a/kernel/extended/vdso/src/Makefile +++ b/kernel/extended/vdso/src/Makefile @@ -35,6 +35,6 @@ LOCAL_SRCS := $(wildcard *.c) $(wildcard *.S) LOCAL_INCLUDE := -I $(LITEOSTOPDIR)/kernel/base/include -I $(LITEOSTOPDIR)/kernel/extended/include -I $(LITEOSTOPDIR)/kernel/extended/vdso/include -LOCAL_FLAGS := $(LOCAL_INCLUDE) +LOCAL_FLAGS := $(LOCAL_INCLUDE) -DOHOS_VDSO_SO=\"../usr/OHOS-vdso.so\" include $(MODULE) \ No newline at end of file diff --git a/kernel/extended/vdso/src/los_vdso_text.S b/kernel/extended/vdso/src/los_vdso_text.S index fcf8224e..c8e1f268 100644 --- a/kernel/extended/vdso/src/los_vdso_text.S +++ b/kernel/extended/vdso/src/los_vdso_text.S @@ -31,4 +31,4 @@ .globl __vdso_text_start .section .data.vdso.text __vdso_text_start: - .incbin "../usr/OHOS-vdso.so" \ No newline at end of file + .incbin OHOS_VDSO_SO \ No newline at end of file diff --git a/kernel/extended/vdso/usr/BUILD.gn b/kernel/extended/vdso/usr/BUILD.gn new file mode 100644 index 00000000..db79bb3a --- /dev/null +++ b/kernel/extended/vdso/usr/BUILD.gn @@ -0,0 +1,54 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +shared_library("OHOS-vdso") { + sources = [ "los_vdso_sys.c" ] + + include_dirs = [ + "$LITEOSTOPDIR/kernel/extended/vdso/include", + "$LITEOSTOPDIR/kernel/include", + "$LITEOSTOPDIR/platform", + "$LITEOSTOPDIR/bsd/compat/linuxkpi/include", + ] + + cflags = [ + "-nostdlib", + "-fPIC", + "-fno-common", + "-fno-strict-aliasing", + ] + + ldflags = [ + "-s", + "-Bsymbolic", + "-Tlos_vdso.ld", + ] +} diff --git a/kernel/extended/vdso/usr/Makefile b/kernel/extended/vdso/usr/Makefile index dde4d96d..68819e19 100644 --- a/kernel/extended/vdso/usr/Makefile +++ b/kernel/extended/vdso/usr/Makefile @@ -34,7 +34,7 @@ VDSO_SO = OHOS-vdso VDSO_SRCS := los_vdso_sys.c VDSO_INCLUDE := -I $(LITEOSTOPDIR)/kernel/extended/vdso/include \ -I $(LITEOSTOPDIR)/kernel/include \ - -I $(LITEOSTOPDIR)/kernel/common \ + -I $(LITEOSTOPDIR)/platform \ -I $(LITEOSTOPDIR)/bsd/compat/linuxkpi/include VDSO_CCFLAGS := -nostdlib -fPIC -fno-common -fno-strict-aliasing \ diff --git a/kernel/user/BUILD.gn b/kernel/user/BUILD.gn new file mode 100644 index 00000000..42efa259 --- /dev/null +++ b/kernel/user/BUILD.gn @@ -0,0 +1,57 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +module_name = "userinit" +shared_library(module_name) { + sources = [ "src/los_user_init.c" ] + + include_dirs = [ + "include", + "$LITEOSTOPDIR/syscall", + ] + + configs = [] + configs += [ + "$LITEOSTOPDIR:public", + "$LITEOSTOPDIR:los_config", + ] + + ldflags = [ + "-static", + "-r", + ] + + output_extension = "O" +} + +group("user") { + public_deps = [ ":$module_name" ] +} diff --git a/lib/BUILD.gn b/lib/BUILD.gn new file mode 100644 index 00000000..03142ff2 --- /dev/null +++ b/lib/BUILD.gn @@ -0,0 +1,50 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +group("lib") { + deps = [ + "libc", + "libmbedtls", + "libscrew", + "libsec", + "zlib", + ] +} + +config("public") { + configs = [ + "libc:public", + "libmbedtls:public", + "libscrew:public", + "libsec:public", + "zlib:public", + ] +} diff --git a/lib/libc/BUILD.gn b/lib/libc/BUILD.gn new file mode 100644 index 00000000..d7087821 --- /dev/null +++ b/lib/libc/BUILD.gn @@ -0,0 +1,92 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +MUSLDIR = "$LITEOSTHIRDPARTY/musl" +OPTRTDIR = "$LITEOSTHIRDPARTY/optimized-routines" + +import("$MUSLDIR/porting/liteos_a/kernel/musl.gni") + +module_switch = defined(LOSCFG_LIB_LIBC) +module_name = get_path_info(rebase_path("."), "name") +kernel_module(module_name) { + sources = MUSL_SRC_COMMON + + if (defined(LOSCFG_ARCH_ARM_AARCH32)) { + sources += MUSL_SRC_ARM + foreach(f, MUSL_SRC_ARM) { + sources -= [ string_replace(f, "/arm/", "/") ] + } + } + + if (LOSCFG_ARCH_ARM_VER == "armv7-a") { + sources -= [ + "$MUSLPORTINGDIR/src/string/memchr.c", + "$MUSLPORTINGDIR/src/string/memcpy.c", + "$MUSLPORTINGDIR/src/string/strcmp.c", + "$MUSLPORTINGDIR/src/string/strcpy.c", + "$MUSLPORTINGDIR/src/string/strlen.c", + ] + sources += [ + "$OPTRTDIR/string/arm/memchr.S", + "$OPTRTDIR/string/arm/memcpy.S", + "$OPTRTDIR/string/arm/strcmp.S", + "$OPTRTDIR/string/arm/strcpy.c", + "$OPTRTDIR/string/arm/strlen-armv6t2.S", + ] + } + + public_configs = [ ":public" ] + configs += [ ":private" ] +} + +config("public") { + include_dirs = [ "$MUSLPORTINGDIR/include" ] +} + +config("private") { + if (defined(LOSCFG_COMPILER_CLANG_LLVM)) { + cflags = [ + "-Wno-char-subscripts", + "-Wno-unknown-pragmas", + ] + } else { + cflags = [ + "-frounding-math", + "-Wno-unused-but-set-variable", + "-Wno-unknown-pragmas", + ] + } + + include_dirs = [ + "$MUSLPORTINGDIR/src/include", + "$MUSLPORTINGDIR/src/internal", + ] +} diff --git a/lib/libmbedtls/BUILD.gn b/lib/libmbedtls/BUILD.gn new file mode 100644 index 00000000..d9aa20af --- /dev/null +++ b/lib/libmbedtls/BUILD.gn @@ -0,0 +1,122 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +module_switch = defined(LOSCFG_DRIVERS_TZDRIVER) +module_name = get_path_info(rebase_path("."), "name") +kernel_module(module_name) { + sources = [ + "$LITEOSTHIRDPARTY/mbedtls/library/aes.c", + "$LITEOSTHIRDPARTY/mbedtls/library/aesni.c", + "$LITEOSTHIRDPARTY/mbedtls/library/arc4.c", + "$LITEOSTHIRDPARTY/mbedtls/library/aria.c", + "$LITEOSTHIRDPARTY/mbedtls/library/asn1parse.c", + "$LITEOSTHIRDPARTY/mbedtls/library/asn1write.c", + "$LITEOSTHIRDPARTY/mbedtls/library/base64.c", + "$LITEOSTHIRDPARTY/mbedtls/library/bignum.c", + "$LITEOSTHIRDPARTY/mbedtls/library/blowfish.c", + "$LITEOSTHIRDPARTY/mbedtls/library/camellia.c", + "$LITEOSTHIRDPARTY/mbedtls/library/ccm.c", + "$LITEOSTHIRDPARTY/mbedtls/library/certs.c", + "$LITEOSTHIRDPARTY/mbedtls/library/chacha20.c", + "$LITEOSTHIRDPARTY/mbedtls/library/chachapoly.c", + "$LITEOSTHIRDPARTY/mbedtls/library/cipher.c", + "$LITEOSTHIRDPARTY/mbedtls/library/cipher_wrap.c", + "$LITEOSTHIRDPARTY/mbedtls/library/cmac.c", + "$LITEOSTHIRDPARTY/mbedtls/library/ctr_drbg.c", + "$LITEOSTHIRDPARTY/mbedtls/library/debug.c", + "$LITEOSTHIRDPARTY/mbedtls/library/des.c", + "$LITEOSTHIRDPARTY/mbedtls/library/dhm.c", + "$LITEOSTHIRDPARTY/mbedtls/library/ecdh.c", + "$LITEOSTHIRDPARTY/mbedtls/library/ecdsa.c", + "$LITEOSTHIRDPARTY/mbedtls/library/ecjpake.c", + "$LITEOSTHIRDPARTY/mbedtls/library/ecp.c", + "$LITEOSTHIRDPARTY/mbedtls/library/ecp_curves.c", + "$LITEOSTHIRDPARTY/mbedtls/library/entropy.c", + "$LITEOSTHIRDPARTY/mbedtls/library/entropy_poll.c", + "$LITEOSTHIRDPARTY/mbedtls/library/error.c", + "$LITEOSTHIRDPARTY/mbedtls/library/gcm.c", + "$LITEOSTHIRDPARTY/mbedtls/library/havege.c", + "$LITEOSTHIRDPARTY/mbedtls/library/hkdf.c", + "$LITEOSTHIRDPARTY/mbedtls/library/hmac_drbg.c", + "$LITEOSTHIRDPARTY/mbedtls/library/md.c", + "$LITEOSTHIRDPARTY/mbedtls/library/md2.c", + "$LITEOSTHIRDPARTY/mbedtls/library/md4.c", + "$LITEOSTHIRDPARTY/mbedtls/library/md5.c", + "$LITEOSTHIRDPARTY/mbedtls/library/md_wrap.c", + "$LITEOSTHIRDPARTY/mbedtls/library/memory_buffer_alloc.c", + "$LITEOSTHIRDPARTY/mbedtls/library/net_sockets.c", + "$LITEOSTHIRDPARTY/mbedtls/library/nist_kw.c", + "$LITEOSTHIRDPARTY/mbedtls/library/oid.c", + "$LITEOSTHIRDPARTY/mbedtls/library/padlock.c", + "$LITEOSTHIRDPARTY/mbedtls/library/pem.c", + "$LITEOSTHIRDPARTY/mbedtls/library/pk.c", + "$LITEOSTHIRDPARTY/mbedtls/library/pk_wrap.c", + "$LITEOSTHIRDPARTY/mbedtls/library/pkcs11.c", + "$LITEOSTHIRDPARTY/mbedtls/library/pkcs12.c", + "$LITEOSTHIRDPARTY/mbedtls/library/pkcs5.c", + "$LITEOSTHIRDPARTY/mbedtls/library/pkparse.c", + "$LITEOSTHIRDPARTY/mbedtls/library/pkwrite.c", + "$LITEOSTHIRDPARTY/mbedtls/library/platform.c", + "$LITEOSTHIRDPARTY/mbedtls/library/platform_util.c", + "$LITEOSTHIRDPARTY/mbedtls/library/poly1305.c", + "$LITEOSTHIRDPARTY/mbedtls/library/ripemd160.c", + "$LITEOSTHIRDPARTY/mbedtls/library/rsa.c", + "$LITEOSTHIRDPARTY/mbedtls/library/rsa_internal.c", + "$LITEOSTHIRDPARTY/mbedtls/library/sha1.c", + "$LITEOSTHIRDPARTY/mbedtls/library/sha256.c", + "$LITEOSTHIRDPARTY/mbedtls/library/sha512.c", + "$LITEOSTHIRDPARTY/mbedtls/library/ssl_cache.c", + "$LITEOSTHIRDPARTY/mbedtls/library/ssl_ciphersuites.c", + "$LITEOSTHIRDPARTY/mbedtls/library/ssl_cli.c", + "$LITEOSTHIRDPARTY/mbedtls/library/ssl_cookie.c", + "$LITEOSTHIRDPARTY/mbedtls/library/ssl_srv.c", + "$LITEOSTHIRDPARTY/mbedtls/library/ssl_ticket.c", + "$LITEOSTHIRDPARTY/mbedtls/library/ssl_tls.c", + "$LITEOSTHIRDPARTY/mbedtls/library/threading.c", + "$LITEOSTHIRDPARTY/mbedtls/library/timing.c", + "$LITEOSTHIRDPARTY/mbedtls/library/version.c", + "$LITEOSTHIRDPARTY/mbedtls/library/version_features.c", + "$LITEOSTHIRDPARTY/mbedtls/library/x509.c", + "$LITEOSTHIRDPARTY/mbedtls/library/x509_create.c", + "$LITEOSTHIRDPARTY/mbedtls/library/x509_crl.c", + "$LITEOSTHIRDPARTY/mbedtls/library/x509_crt.c", + "$LITEOSTHIRDPARTY/mbedtls/library/x509_csr.c", + "$LITEOSTHIRDPARTY/mbedtls/library/x509write_crt.c", + "$LITEOSTHIRDPARTY/mbedtls/library/x509write_csr.c", + "$LITEOSTHIRDPARTY/mbedtls/library/xtea.c", + ] + + public_configs = [ ":public" ] +} + +config("public") { + include_dirs = [ "$LITEOSTHIRDPARTY/mbedtls/include" ] +} diff --git a/lib/libscrew/BUILD.gn b/lib/libscrew/BUILD.gn new file mode 100644 index 00000000..87b4cae6 --- /dev/null +++ b/lib/libscrew/BUILD.gn @@ -0,0 +1,46 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +module_name = get_path_info(rebase_path("."), "name") +kernel_module(module_name) { + sources = [ + "src/los_crc32.c", + "src/los_rbtree.c", + ] + + sources += [ "$LITEOSTHIRDPARTY/FreeBSD/sys/libkern/crc32.c" ] + + public_configs = [ ":public" ] +} + +config("public") { + include_dirs = [ "include" ] +} diff --git a/lib/libsec/BUILD.gn b/lib/libsec/BUILD.gn new file mode 100644 index 00000000..f93a7652 --- /dev/null +++ b/lib/libsec/BUILD.gn @@ -0,0 +1,83 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +module_switch = defined(LOSCFG_LIB_LIBC) +module_name = get_path_info(rebase_path("."), "name") +kernel_module(module_name) { + sources = [ + "$LITEOSTHIRDPARTY/bounds_checking_function/src/fscanf_s.c", + "$LITEOSTHIRDPARTY/bounds_checking_function/src/fwscanf_s.c", + "$LITEOSTHIRDPARTY/bounds_checking_function/src/gets_s.c", + "$LITEOSTHIRDPARTY/bounds_checking_function/src/memcpy_s.c", + "$LITEOSTHIRDPARTY/bounds_checking_function/src/memmove_s.c", + "$LITEOSTHIRDPARTY/bounds_checking_function/src/memset_s.c", + "$LITEOSTHIRDPARTY/bounds_checking_function/src/scanf_s.c", + "$LITEOSTHIRDPARTY/bounds_checking_function/src/securecutil.c", + "$LITEOSTHIRDPARTY/bounds_checking_function/src/secureinput_a.c", + "$LITEOSTHIRDPARTY/bounds_checking_function/src/secureinput_w.c", + "$LITEOSTHIRDPARTY/bounds_checking_function/src/secureprintoutput_a.c", + "$LITEOSTHIRDPARTY/bounds_checking_function/src/secureprintoutput_w.c", + "$LITEOSTHIRDPARTY/bounds_checking_function/src/snprintf_s.c", + "$LITEOSTHIRDPARTY/bounds_checking_function/src/sprintf_s.c", + "$LITEOSTHIRDPARTY/bounds_checking_function/src/sscanf_s.c", + "$LITEOSTHIRDPARTY/bounds_checking_function/src/strcat_s.c", + "$LITEOSTHIRDPARTY/bounds_checking_function/src/strcpy_s.c", + "$LITEOSTHIRDPARTY/bounds_checking_function/src/strncat_s.c", + "$LITEOSTHIRDPARTY/bounds_checking_function/src/strncpy_s.c", + "$LITEOSTHIRDPARTY/bounds_checking_function/src/strtok_s.c", + "$LITEOSTHIRDPARTY/bounds_checking_function/src/swprintf_s.c", + "$LITEOSTHIRDPARTY/bounds_checking_function/src/swscanf_s.c", + "$LITEOSTHIRDPARTY/bounds_checking_function/src/vfscanf_s.c", + "$LITEOSTHIRDPARTY/bounds_checking_function/src/vfwscanf_s.c", + "$LITEOSTHIRDPARTY/bounds_checking_function/src/vscanf_s.c", + "$LITEOSTHIRDPARTY/bounds_checking_function/src/vsnprintf_s.c", + "$LITEOSTHIRDPARTY/bounds_checking_function/src/vsprintf_s.c", + "$LITEOSTHIRDPARTY/bounds_checking_function/src/vsscanf_s.c", + "$LITEOSTHIRDPARTY/bounds_checking_function/src/vswprintf_s.c", + "$LITEOSTHIRDPARTY/bounds_checking_function/src/vswscanf_s.c", + "$LITEOSTHIRDPARTY/bounds_checking_function/src/vwscanf_s.c", + "$LITEOSTHIRDPARTY/bounds_checking_function/src/wcscat_s.c", + "$LITEOSTHIRDPARTY/bounds_checking_function/src/wcscpy_s.c", + "$LITEOSTHIRDPARTY/bounds_checking_function/src/wcsncat_s.c", + "$LITEOSTHIRDPARTY/bounds_checking_function/src/wcsncpy_s.c", + "$LITEOSTHIRDPARTY/bounds_checking_function/src/wcstok_s.c", + "$LITEOSTHIRDPARTY/bounds_checking_function/src/wmemcpy_s.c", + "$LITEOSTHIRDPARTY/bounds_checking_function/src/wmemmove_s.c", + "$LITEOSTHIRDPARTY/bounds_checking_function/src/wscanf_s.c", + ] + + public_configs = [ ":public" ] +} + +config("public") { + include_dirs = [ "$LITEOSTHIRDPARTY/bounds_checking_function/include" ] + defines = [ "SECUREC_IN_KERNEL=0" ] +} diff --git a/lib/zlib/BUILD.gn b/lib/zlib/BUILD.gn new file mode 100644 index 00000000..5b75164e --- /dev/null +++ b/lib/zlib/BUILD.gn @@ -0,0 +1,62 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +module_switch = defined(LOSCFG_LIB_ZLIB) +module_name = "z" +kernel_module(module_name) { + sources = [ + "$LITEOSTHIRDPARTY/zlib/adler32.c", + "$LITEOSTHIRDPARTY/zlib/compress.c", + "$LITEOSTHIRDPARTY/zlib/crc32.c", + "$LITEOSTHIRDPARTY/zlib/deflate.c", + "$LITEOSTHIRDPARTY/zlib/gzclose.c", + "$LITEOSTHIRDPARTY/zlib/gzlib.c", + "$LITEOSTHIRDPARTY/zlib/gzread.c", + "$LITEOSTHIRDPARTY/zlib/gzwrite.c", + "$LITEOSTHIRDPARTY/zlib/infback.c", + "$LITEOSTHIRDPARTY/zlib/inffast.c", + "$LITEOSTHIRDPARTY/zlib/inflate.c", + "$LITEOSTHIRDPARTY/zlib/inftrees.c", + "$LITEOSTHIRDPARTY/zlib/trees.c", + "$LITEOSTHIRDPARTY/zlib/uncompr.c", + "$LITEOSTHIRDPARTY/zlib/zutil.c", + ] + + public_configs = [ ":public" ] +} + +config("public") { + include_dirs = [ "$LITEOSTHIRDPARTY/zlib" ] +} + +group("zlib") { + public_deps = [ ":$module_name" ] +} diff --git a/liteos.gni b/liteos.gni new file mode 100644 index 00000000..5e2e723c --- /dev/null +++ b/liteos.gni @@ -0,0 +1,63 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("$root_out_dir/config.gni") + +LITEOSTOPDIR = "//kernel/liteos_a" +LITEOSTHIRDPARTY = "//third_party" +HDFTOPDIR = "//drivers/adapter/khdf/liteos" + +template("kernel_module") { + if (defined(invoker.module_switch) && !invoker.module_switch) { + group(target_name) { + not_needed(invoker, "*") + } + } else { + static_library(target_name) { + forward_variables_from(invoker, "*") + } + } +} + +template("config") { + config(target_name) { + if (defined(invoker.module_switch) && !invoker.module_switch && target_name == "public") { + not_needed(invoker, "*") + } else { + forward_variables_from(invoker, "*") + } + } +} + +set_defaults("kernel_module") { + configs = [ + "$LITEOSTOPDIR:public", + "$LITEOSTOPDIR:los_config", + ] +} diff --git a/net/BUILD.gn b/net/BUILD.gn new file mode 100644 index 00000000..9dcb78a2 --- /dev/null +++ b/net/BUILD.gn @@ -0,0 +1,44 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +group("net") { + deps = [ + "lwip-2.1", + "telnet", + ] +} + +config("public") { + configs = [ + "lwip-2.1:public", + "telnet:public", + ] +} diff --git a/net/lwip-2.1/BUILD.gn b/net/lwip-2.1/BUILD.gn new file mode 100644 index 00000000..f4009b22 --- /dev/null +++ b/net/lwip-2.1/BUILD.gn @@ -0,0 +1,63 @@ +# Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") +import("$LITEOSTHIRDPARTY/lwip/lwip.gni") +import("lwip_porting.gni") + +module_switch = defined(LOSCFG_NET_LWIP_SACK_2_1) +module_name = "lwip" +kernel_module(module_name) { + include_dirs = [ "$LWIP_PORTING_DIR/enhancement/include" ] + + sources = LWIP_PORTING_FILES + LWIPNOAPPSFILES + + sources -= [ + "$LWIPDIR/api/sockets.c", + "$LWIPDIR/core/ipv4/dhcp.c", + "$LWIPDIR/core/ipv4/etharp.c", + ] + + public_configs = [ ":public" ] + + defines = [ + "__LWIP__", + "LWIP_NOASSERT", + "_BSD_SOURCE=1", + ] +} + +config("public") { + include_dirs = [ "../mac" ] + include_dirs += LWIP_PORTING_INCLUDE_DIRS + include_dirs += LWIP_INCLUDE_DIRS +} + +group("lwip-2.1") { + public_deps = [ ":$module_name" ] +} diff --git a/net/lwip-2.1/lwip_porting.gni b/net/lwip-2.1/lwip_porting.gni new file mode 100644 index 00000000..1f373670 --- /dev/null +++ b/net/lwip-2.1/lwip_porting.gni @@ -0,0 +1,40 @@ +# Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +LWIP_PORTING_DIR = get_path_info(".", "abspath") + +LWIP_PORTING_INCLUDE_DIRS = [ "$LWIP_PORTING_DIR/porting/include" ] + +LWIP_PORTING_FILES = [ + "$LWIP_PORTING_DIR/porting/src/driverif.c", + "$LWIP_PORTING_DIR/porting/src/sockets.c", + "$LWIP_PORTING_DIR/porting/src/sys_arch.c", + "$LWIP_PORTING_DIR/enhancement/src/api_shell.c", + "$LWIP_PORTING_DIR/enhancement/src/fixme.c", + "$LWIP_PORTING_DIR/enhancement/src/dhcps.c", +] diff --git a/net/telnet/BUILD.gn b/net/telnet/BUILD.gn new file mode 100644 index 00000000..0601c60a --- /dev/null +++ b/net/telnet/BUILD.gn @@ -0,0 +1,45 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +module_switch = defined(LOSCFG_NET_TELNET) +module_name = get_path_info(rebase_path("."), "name") +kernel_module(module_name) { + sources = [ + "src/telnet_dev.c", + "src/telnet_loop.c", + ] + + public_configs = [ ":public" ] +} + +config("public") { + include_dirs = [ "include" ] +} diff --git a/platform/BUILD.gn b/platform/BUILD.gn new file mode 100644 index 00000000..13c15ef1 --- /dev/null +++ b/platform/BUILD.gn @@ -0,0 +1,101 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +cmd = "if [ -f " + rebase_path("//$LOSCFG_BOARD_CONFIG_PATH/BUILD.gn") + " ]; then echo true; else echo false; fi" +HAVE_BOARD_CONFIG = exec_script("//build/lite/run_shell_cmd.py", [ cmd ], "value") + +module_name = "bsp" +kernel_module(module_name) { + sources = [ "main.c" ] + + sources += [ + "hwi_shell.c", + "los_cir_buf.c", + "los_config.c", + "los_excinfo.c", + "los_init.c", + "los_magickey.c", + "los_printf.c", + "los_seq_buf.c", + ] + + if (defined(LOSCFG_FS_VFS)) { + sources += [ + "console.c", + "virtual_serial.c", + ] + } + + if (defined(LOSCFG_BASE_CORE_HILOG)) { + sources += [ "los_hilog.c" ] + } + + public_configs = [ ":public" ] +} + +group("platform") { + public_deps = [ ":$module_name" ] + deps = [ ":board.ld" ] + if (HAVE_BOARD_CONFIG) { + deps += [ "//$LOSCFG_BOARD_CONFIG_PATH" ] + } +} + +config("public") { + include_dirs = [ + ".", + ] + if (HAVE_BOARD_CONFIG) { + configs = [ "//$LOSCFG_BOARD_CONFIG_PATH:public" ] + } +} + +source_set("board") { + sources = [ "board.ld.S" ] + + configs = [] + configs += [ + "$LITEOSTOPDIR:los_config", + "$LITEOSTOPDIR/kernel/base:public", + ":public", + ] + + asmflags = [ + "-P", + "-E", + ] +} + +copy("board.ld") { + deps = [ ":board" ] + sources = [ "$target_out_dir/board.board.ld.o" ] + outputs = [ "$root_out_dir/board.ld" ] +} diff --git a/platform/Makefile b/platform/Makefile index 27934023..94f9dd24 100644 --- a/platform/Makefile +++ b/platform/Makefile @@ -36,13 +36,12 @@ LOCAL_SRCS = $(wildcard ./main.c) LOCAL_INCLUDE += -I $(LITEOSTOPDIR)/compat/posix/src \ -I $(LITEOSTOPDIR)/bsd/dev/random -LOCAL_SRCS += $(wildcard ../kernel/common/*.c) -LOCAL_SRCS := $(filter-out ../kernel/common/los_rootfs.c ../kernel/common/los_bootargs.c, $(LOCAL_SRCS)) +LOCAL_SRCS += $(wildcard *.c) ifneq ($(LOSCFG_FS_VFS), y) -LOCAL_SRCS := $(filter-out ../kernel/common/console.c ../kernel/common/virtual_serial.c, $(LOCAL_SRCS)) +LOCAL_SRCS := $(filter-out console.c virtual_serial.c, $(LOCAL_SRCS)) endif ifneq ($(LOSCFG_BASE_CORE_HILOG), y) -LOCAL_SRCS := $(filter-out ../kernel/common/los_hilog.c, $(LOCAL_SRCS)) +LOCAL_SRCS := $(filter-out los_hilog.c, $(LOCAL_SRCS)) endif ifeq ($(LOSCFG_KERNEL_TICKLESS), y) diff --git a/platform/bsp.mk b/platform/bsp.mk index c937f81a..0d1fe022 100644 --- a/platform/bsp.mk +++ b/platform/bsp.mk @@ -49,7 +49,8 @@ PLATFORM_BSP_BASE := $(LITEOSTOPDIR)/platform PLATFORM_INCLUDE := -I $(LITEOSTOPDIR)/../../$(LOSCFG_BOARD_CONFIG_PATH) \ -I $(LITEOSTOPDIR)/../../$(LOSCFG_BOARD_CONFIG_PATH)/include \ - -I $(PLATFORM_BSP_BASE)/../kernel/common \ + -I $(PLATFORM_BSP_BASE)/../kernel/common/rootfs \ + -I $(PLATFORM_BSP_BASE) \ -I $(PLATFORM_BSP_BASE)/../../../drivers/liteos/platform/pm \ -I $(PLATFORM_BSP_BASE)/hw/include \ -I $(PLATFORM_BSP_BASE)/include diff --git a/kernel/common/console.c b/platform/console.c similarity index 100% rename from kernel/common/console.c rename to platform/console.c diff --git a/kernel/common/console.h b/platform/console.h similarity index 100% rename from kernel/common/console.h rename to platform/console.h diff --git a/kernel/common/hwi_shell.c b/platform/hwi_shell.c similarity index 100% rename from kernel/common/hwi_shell.c rename to platform/hwi_shell.c diff --git a/kernel/common/los_builddef.h b/platform/los_builddef.h similarity index 100% rename from kernel/common/los_builddef.h rename to platform/los_builddef.h diff --git a/kernel/common/los_cir_buf.c b/platform/los_cir_buf.c similarity index 100% rename from kernel/common/los_cir_buf.c rename to platform/los_cir_buf.c diff --git a/kernel/common/los_cir_buf_pri.h b/platform/los_cir_buf_pri.h similarity index 100% rename from kernel/common/los_cir_buf_pri.h rename to platform/los_cir_buf_pri.h diff --git a/kernel/common/los_config.c b/platform/los_config.c similarity index 100% rename from kernel/common/los_config.c rename to platform/los_config.c diff --git a/kernel/common/los_config.h b/platform/los_config.h similarity index 99% rename from kernel/common/los_config.h rename to platform/los_config.h index 3ce31935..36c3c4d5 100644 --- a/kernel/common/los_config.h +++ b/platform/los_config.h @@ -115,7 +115,7 @@ extern UINT32 __heap_end; * @ingroup los_config * External configuration item for timer tailoring */ -#ifndef LOSCFG_BASE_CORE_TICK_HW_TIME +#if defined(LOSCFG_BASE_CORE_TICK_HW_TIME) && (LOSCFG_BASE_CORE_TICK_HW_TIME == 0) #undef LOSCFG_BASE_CORE_TICK_HW_TIME #endif /****************************** Hardware interrupt module configuration ******************************/ diff --git a/kernel/common/los_excinfo.c b/platform/los_excinfo.c similarity index 100% rename from kernel/common/los_excinfo.c rename to platform/los_excinfo.c diff --git a/kernel/common/los_excinfo_pri.h b/platform/los_excinfo_pri.h similarity index 100% rename from kernel/common/los_excinfo_pri.h rename to platform/los_excinfo_pri.h diff --git a/kernel/common/los_hilog.c b/platform/los_hilog.c similarity index 100% rename from kernel/common/los_hilog.c rename to platform/los_hilog.c diff --git a/kernel/common/los_hilog.h b/platform/los_hilog.h similarity index 100% rename from kernel/common/los_hilog.h rename to platform/los_hilog.h diff --git a/kernel/common/los_init.c b/platform/los_init.c similarity index 100% rename from kernel/common/los_init.c rename to platform/los_init.c diff --git a/kernel/common/los_init.h b/platform/los_init.h similarity index 100% rename from kernel/common/los_init.h rename to platform/los_init.h diff --git a/kernel/common/los_init_info.h b/platform/los_init_info.h similarity index 100% rename from kernel/common/los_init_info.h rename to platform/los_init_info.h diff --git a/kernel/common/los_init_pri.h b/platform/los_init_pri.h similarity index 100% rename from kernel/common/los_init_pri.h rename to platform/los_init_pri.h diff --git a/kernel/common/los_magickey.c b/platform/los_magickey.c similarity index 100% rename from kernel/common/los_magickey.c rename to platform/los_magickey.c diff --git a/kernel/common/los_magickey.h b/platform/los_magickey.h similarity index 100% rename from kernel/common/los_magickey.h rename to platform/los_magickey.h diff --git a/kernel/common/los_printf.c b/platform/los_printf.c similarity index 100% rename from kernel/common/los_printf.c rename to platform/los_printf.c diff --git a/kernel/common/los_seq_buf.c b/platform/los_seq_buf.c similarity index 100% rename from kernel/common/los_seq_buf.c rename to platform/los_seq_buf.c diff --git a/kernel/common/los_seq_buf.h b/platform/los_seq_buf.h similarity index 100% rename from kernel/common/los_seq_buf.h rename to platform/los_seq_buf.h diff --git a/kernel/common/los_timer_pri.h b/platform/los_timer_pri.h similarity index 100% rename from kernel/common/los_timer_pri.h rename to platform/los_timer_pri.h diff --git a/kernel/common/sys_config.h b/platform/sys_config.h similarity index 100% rename from kernel/common/sys_config.h rename to platform/sys_config.h diff --git a/kernel/common/virtual_serial.c b/platform/virtual_serial.c similarity index 100% rename from kernel/common/virtual_serial.c rename to platform/virtual_serial.c diff --git a/kernel/common/virtual_serial.h b/platform/virtual_serial.h similarity index 100% rename from kernel/common/virtual_serial.h rename to platform/virtual_serial.h diff --git a/security/BUILD.gn b/security/BUILD.gn new file mode 100644 index 00000000..1a7f6f3f --- /dev/null +++ b/security/BUILD.gn @@ -0,0 +1,44 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +group("security") { + deps = [ + "cap", + "vid", + ] +} + +config("public") { + configs = [ + "cap:public", + "vid:public", + ] +} diff --git a/security/cap/BUILD.gn b/security/cap/BUILD.gn new file mode 100644 index 00000000..a4e95342 --- /dev/null +++ b/security/cap/BUILD.gn @@ -0,0 +1,41 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +module_switch = defined(LOSCFG_SECURITY_CAPABILITY) +module_name = get_path_info(rebase_path("."), "name") +kernel_module(module_name) { + sources = [ "capability.c" ] + public_configs = [ ":public" ] +} + +config("public") { + include_dirs = [ "." ] +} diff --git a/security/vid/BUILD.gn b/security/vid/BUILD.gn new file mode 100644 index 00000000..7b53edc7 --- /dev/null +++ b/security/vid/BUILD.gn @@ -0,0 +1,41 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +module_switch = defined(LOSCFG_SECURITY_VID) +module_name = get_path_info(rebase_path("."), "name") +kernel_module(module_name) { + sources = [ "vid.c" ] + public_configs = [ ":public" ] +} + +config("public") { + include_dirs = [ "." ] +} diff --git a/shell/BUILD.gn b/shell/BUILD.gn index 6e8dc0bb..c3b8e522 100644 --- a/shell/BUILD.gn +++ b/shell/BUILD.gn @@ -25,19 +25,28 @@ # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -import("//build/lite/config/component/lite_component.gni") +import("//kernel/liteos_a/liteos.gni") -lite_component("shell") { - version = "1.0.0" - dependences = [ - "fs:^1.0.0", - "kernel:^1.0.0", +module_switch = defined(LOSCFG_SHELL) +module_name = get_path_info(rebase_path("."), "name") +kernel_module(module_name) { + sources = [ + "full/src/base/shcmd.c", + "full/src/base/shcmdparse.c", + "full/src/base/shell_lk.c", + "full/src/base/shmsg.c", + "full/src/base/show.c", + "full/src/cmds/date_shell.c", + "full/src/cmds/dmesg.c", + "full/src/cmds/shell_shellcmd.c", + "full/src/cmds/watch_shell.c", ] - features = [] - if (LOSCFG_SHELL) { - features += [ "full:shell_full" ] - } + public_configs = [ ":public" ] +} + +config("public") { + include_dirs = [ "full/include" ] } diff --git a/syscall/BUILD.gn b/syscall/BUILD.gn new file mode 100644 index 00000000..b3f2b3e9 --- /dev/null +++ b/syscall/BUILD.gn @@ -0,0 +1,46 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +module_switch = defined(LOSCFG_KERNEL_SYSCALL) +module_name = get_path_info(rebase_path("."), "name") +kernel_module(module_name) { + sources = [ + "fs_syscall.c", + "ipc_syscall.c", + "los_syscall.c", + "misc_syscall.c", + "net_syscall.c", + "process_syscall.c", + "syscall_pub.c", + "time_syscall.c", + "vm_syscall.c", + ] +} diff --git a/testsuites/BUILD.gn b/testsuites/BUILD.gn new file mode 100644 index 00000000..17bddbfe --- /dev/null +++ b/testsuites/BUILD.gn @@ -0,0 +1,37 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//kernel/liteos_a/liteos.gni") + +group("testsuites") { + deps = [ + #"kernel", + "unittest", + ] +} diff --git a/tools/build/mk/los_config.mk b/tools/build/mk/los_config.mk index b332f723..840f64b2 100644 --- a/tools/build/mk/los_config.mk +++ b/tools/build/mk/los_config.mk @@ -27,7 +27,8 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --include $(LITEOSTOPDIR)/.config +CONFIG_FILE ?= $(LITEOSTOPDIR)/.config +-include $(CONFIG_FILE) ifeq ($(LOSCFG_COMPILER_HIMIX_32), y) CROSS_COMPILE := arm-linux-ohoseabi- else ifeq ($(LOSCFG_COMPILER_CLANG_LLVM), y) @@ -121,8 +122,8 @@ CXX_PATH = $(LITEOSTOPDIR)/lib/cxxstl JFFS_PATH = $(LITEOSTOPDIR)/fs/jffs2 LITEOS_SCRIPTPATH ?= $(LITEOSTOPDIR)/tools/scripts LITEOS_LIB_BIGODIR = $(OUT)/lib/obj -LITEOS_MENUCONFIG_H = $(LITEOSTOPDIR)/config.h -LOSCFG_ENTRY_SRC = $(LITEOSTOPDIR)/kernel/common/los_config.c +LITEOS_MENUCONFIG_H ?= $(LITEOSTOPDIR)/config.h +LOSCFG_ENTRY_SRC = $(LITEOSTOPDIR)/platform/los_config.c ### include variable MODULE = $(MK_PATH)/module.mk @@ -158,7 +159,7 @@ include $(LITEOSTOPDIR)/platform/bsp.mk ifeq ($(LOSCFG_PLATFORM_ROOTFS), y) LITEOS_BASELIB += -lrootfs - LIB_SUBDIRS += $(LITEOSTOPDIR)/kernel/common + LIB_SUBDIRS += $(LITEOSTOPDIR)/kernel/common/rootfs endif ifeq ($(LOSCFG_PLATFORM_PATCHFS), y) @@ -703,7 +704,8 @@ endif # temporary LITEOS_PLATFORM_INCLUDE += \ -I $(LITEOSTOPDIR)/kernel/base/include \ - -I $(LITEOSTOPDIR)/kernel/extended/include + -I $(LITEOSTOPDIR)/kernel/extended/cpup \ + -I $(LITEOSTOPDIR)/kernel/extended/trace LITEOS_CXXINCLUDE += \ $(LITEOS_NET_INCLUDE) \ From 8f6a1dd33c59164070e8d2fb5abbd3e76ef8ac8e Mon Sep 17 00:00:00 2001 From: pcwlno1 Date: Thu, 22 Jul 2021 09:29:03 +0800 Subject: [PATCH 40/43] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E6=9F=90?= =?UTF-8?q?=E4=BA=9B=E5=B9=B3=E5=8F=B0=E4=BF=9D=E5=AD=98bbox=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1、在日志写如完成之后执行fsync确保落盘。 Close #I41UTP Signed-off-by: qidechun --- kernel/common/blackbox/los_blackbox_common.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/common/blackbox/los_blackbox_common.c b/kernel/common/blackbox/los_blackbox_common.c index c7ae0795..813ab8d9 100644 --- a/kernel/common/blackbox/los_blackbox_common.c +++ b/kernel/common/blackbox/los_blackbox_common.c @@ -78,6 +78,7 @@ int FullWriteFile(const char *filePath, const char *buf, size_t bufSize, int isA totalToWrite -= writeThisTime; totalWrite += writeThisTime; } + (void)fsync(fd); (void)close(fd); return (totalWrite == (int)bufSize) ? 0 : -1; @@ -124,4 +125,4 @@ bool IsLogPartReady(void) { return TRUE; } -#endif \ No newline at end of file +#endif From 3b5268f02a6fbc5f356c36cb69808a83aace111d Mon Sep 17 00:00:00 2001 From: Caoruihong Date: Thu, 22 Jul 2021 18:52:24 +0800 Subject: [PATCH 41/43] chore: output liteos binaries to target_out_dir liteos binaries no need pack to rootfs. Signed-off-by: Caoruihong Change-Id: Iba650c9d09302902c108760163eca55b4ec40221 --- BUILD.gn | 32 ++++++++++++++++++++++--------- kernel/BUILD.gn | 1 + kernel/extended/vdso/BUILD.gn | 2 +- kernel/extended/vdso/usr/BUILD.gn | 16 ++++++++++++---- kernel/user/BUILD.gn | 10 ++++++++-- 5 files changed, 45 insertions(+), 16 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 93965953..f0ab922f 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -160,7 +160,15 @@ config("public") { ] } -config("los_config") { +config("los_nostdinc") { + cflags = [ "-nostdinc" ] +} + +config("los_nostdlib") { + ldflags = [ "-nostdlib" ] +} + +config("los_common") { cflags = [ "-imacros", "$LITEOS_MENUCONFIG_H", @@ -168,16 +176,11 @@ config("los_config") { defines = [ "__LITEOS__" ] - configs = [ ":arch_config" ] - - ldflags = [ "-nostdlib" ] - cflags_c = [ "-std=c99" ] cflags += [ "-fno-pic", "-fno-builtin", - "-nostdinc", "-Wall", "-Werror", "-fms-extensions", @@ -250,6 +253,15 @@ config("los_config") { asmflags = cflags } +config("los_config") { + configs = [ + ":los_common", + ":arch_config", + ":los_nostdinc", + ":los_nostdlib", + ] +} + liteos_name = "liteos2" liteos_out = rebase_path("$target_out_dir/$liteos_name") executable(liteos_name) { @@ -267,12 +279,14 @@ executable(liteos_name) { libgcc = exec_script("//build/lite/run_shell_cmd.py", [ "$cc -print-libgcc-file-name" ], "trim string") libs = [ libgcc ] if (defined(LOSCFG_COMPILER_CLANG_LLVM)) { - libs += [ "tools/build/liteos_llvm.ld" ] + ldflags += [ "-Wl,-T" + rebase_path("tools/build/liteos_llvm.ld", root_build_dir) ] } else { - libs += [ "tools/build/liteos.ld" ] + ldflags += [ "-Wl,-T" + rebase_path("tools/build/liteos.ld", root_build_dir) ] ldflags += [ "-nostartfiles" ] } + output_dir = target_out_dir + deps = [ ":modules", ] @@ -285,7 +299,7 @@ build_ext_component("build_liteos_bin") { objcopy = "${compile_prefix}objcopy$toolchain_cmd_suffix" objdump = "${compile_prefix}objdump$toolchain_cmd_suffix" - liteos = rebase_path("$root_out_dir/unstripped/bin/$liteos_name") + liteos = rebase_path("$target_out_dir/unstripped/bin/$liteos_name") command = "$objcopy -O binary $liteos $liteos_out.bin" command += " && sh -c '$objdump -t $liteos | sort >$liteos_out.sym.sorted'" diff --git a/kernel/BUILD.gn b/kernel/BUILD.gn index 504db26b..e0a1da6d 100644 --- a/kernel/BUILD.gn +++ b/kernel/BUILD.gn @@ -44,5 +44,6 @@ config("public") { "base:public", "common:public", "extended:public", + "user:public", ] } diff --git a/kernel/extended/vdso/BUILD.gn b/kernel/extended/vdso/BUILD.gn index 82062c17..fd7608f5 100644 --- a/kernel/extended/vdso/BUILD.gn +++ b/kernel/extended/vdso/BUILD.gn @@ -48,6 +48,6 @@ config("public") { copy("copy_ohos_vdso") { deps = [ "usr:OHOS-vdso" ] - sources = [ "$root_out_dir/libOHOS-vdso.so" ] + sources = [ get_path_info("usr/", "out_dir") + "/libOHOS-vdso.so" ] outputs = [ "$root_out_dir/OHOS-vdso.so" ] } diff --git a/kernel/extended/vdso/usr/BUILD.gn b/kernel/extended/vdso/usr/BUILD.gn index db79bb3a..2c6edf94 100644 --- a/kernel/extended/vdso/usr/BUILD.gn +++ b/kernel/extended/vdso/usr/BUILD.gn @@ -40,15 +40,23 @@ shared_library("OHOS-vdso") { ] cflags = [ - "-nostdlib", "-fPIC", "-fno-common", "-fno-strict-aliasing", ] + configs = [] + configs += [ "$LITEOSTOPDIR:los_common" ] + configs += [ "$LITEOSTOPDIR:los_nostdlib" ] + configs += [ "$LITEOSTOPDIR:arch_config" ] + + defines = [ "_XOPEN_SOURCE=700" ] + ldflags = [ - "-s", - "-Bsymbolic", - "-Tlos_vdso.ld", + "-Wl,-s", + "-Wl,-Bsymbolic", + "-Wl,-T" + rebase_path("los_vdso.ld", root_build_dir), ] + + output_dir = target_out_dir } diff --git a/kernel/user/BUILD.gn b/kernel/user/BUILD.gn index 42efa259..975b37e4 100644 --- a/kernel/user/BUILD.gn +++ b/kernel/user/BUILD.gn @@ -30,7 +30,7 @@ import("//kernel/liteos_a/liteos.gni") module_name = "userinit" -shared_library(module_name) { +executable(module_name) { sources = [ "src/los_user_init.c" ] include_dirs = [ @@ -46,12 +46,18 @@ shared_library(module_name) { ldflags = [ "-static", - "-r", + "-Wl,-r", ] + output_dir = target_out_dir + output_name = "lib$module_name" output_extension = "O" } group("user") { public_deps = [ ":$module_name" ] } + +config("public") { + lib_dirs = [ "$target_out_dir/unstripped/bin" ] +} From 76f45b3fb2783d1cab45a6ba08787c29dfa2c948 Mon Sep 17 00:00:00 2001 From: Kiita Date: Mon, 19 Jul 2021 19:20:52 +0800 Subject: [PATCH 42/43] =?UTF-8?q?fix:=20toybox=E5=91=BD=E4=BB=A4=E5=8D=87?= =?UTF-8?q?=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【背景】liteos_a toybox 命令升级升级 【修改方案】 1、help命令列表不支持命令删除。 2、cp命令和mv命令拷贝文件失败和文件损坏等问题修复。 3、修复du命令统计nfs文件大小为0问题修复。 4、修复ls命令nfs文件时间打印信息有误问题。 5、更新命令不支持入参列表。 re #I41N2A Signed-off-by: yansira Change-Id: I5f5b82e33ba9193ae06e9547182d5b7bac0a3b44 --- apps/toybox/liteos_a_custom.config | 12 +++++++++--- fs/fat/os_adapt/fatfs.c | 3 +++ fs/jffs2/src/vfs_jffs2.c | 5 +++++ syscall/fs_syscall.c | 8 ++++---- syscall/los_syscall.h | 5 +++-- 5 files changed, 24 insertions(+), 9 deletions(-) diff --git a/apps/toybox/liteos_a_custom.config b/apps/toybox/liteos_a_custom.config index 03dbae41..7628c2fa 100644 --- a/apps/toybox/liteos_a_custom.config +++ b/apps/toybox/liteos_a_custom.config @@ -1,7 +1,6 @@ -CONFIG_GETTY=y -CONFIG_MDEV=y -CONFIG_MDEV_CONF=y +# CONFIG_BASENAME is not set # CONFIG_CAL is not set +# CONFIG_CAT is not set # CONFIG_CATV is not set # CONFIG_CKSUM is not set # CONFIG_CRC32 is not set @@ -13,6 +12,7 @@ CONFIG_MDEV_CONF=y # CONFIG_CUT is not set # CONFIG_DF is not set # CONFIG_DIRNAME is not set +# CONFIG_ECHO is not set # CONFIG_ENV is not set # CONFIG_EXPAND is not set # CONFIG_FALSE is not set @@ -178,3 +178,9 @@ CONFIG_MDEV_CONF=y # CONFIG_SEQ is not set # CONFIG_SU is not set # CONFIG_SYNC is not set +# +# pending (see toys/pending/README) +# +# CONFIG_GETTY is not set +# CONFIG_MDEV is not set +# CONFIG_MDEV_CONF is not set diff --git a/fs/fat/os_adapt/fatfs.c b/fs/fat/os_adapt/fatfs.c index b6c02f02..8df522ab 100644 --- a/fs/fat/os_adapt/fatfs.c +++ b/fs/fat/os_adapt/fatfs.c @@ -1416,6 +1416,9 @@ int fatfs_stat(struct Vnode *vp, struct stat* sp) time = fattime_transfer(finfo->fdate, finfo->ftime); sp->st_mtime = time; + /* Adapt to kstat member "long tv_sec" */ + sp->__st_mtim32.tv_sec = (long)time; + unlock_fs(fs, FR_OK); return 0; } diff --git a/fs/jffs2/src/vfs_jffs2.c b/fs/jffs2/src/vfs_jffs2.c index 63cbf3c6..43922953 100644 --- a/fs/jffs2/src/vfs_jffs2.c +++ b/fs/jffs2/src/vfs_jffs2.c @@ -807,6 +807,11 @@ int VfsJffs2Stat(struct Vnode *pVnode, struct stat *buf) buf->st_mtime = node->i_mtime; buf->st_ctime = node->i_ctime; + /* Adapt to kstat member long tv_sec */ + buf->__st_atim32.tv_sec = (long)node->i_atime; + buf->__st_mtim32.tv_sec = (long)node->i_mtime; + buf->__st_ctim32.tv_sec = (long)node->i_ctime; + LOS_MuxUnlock(&g_jffs2FsLock); return 0; diff --git a/syscall/fs_syscall.c b/syscall/fs_syscall.c index b424b05b..c4f0af49 100644 --- a/syscall/fs_syscall.c +++ b/syscall/fs_syscall.c @@ -1206,7 +1206,7 @@ OUT: return ret; } -int SysStat(const char *path, struct stat *buf) +int SysStat(const char *path, struct kstat *buf) { int ret; char *pathRet = NULL; @@ -1225,7 +1225,7 @@ int SysStat(const char *path, struct stat *buf) goto OUT; } - ret = LOS_ArchCopyToUser(buf, &bufRet, sizeof(struct stat)); + ret = LOS_ArchCopyToUser(buf, &bufRet, sizeof(struct kstat)); if (ret != 0) { ret = -EFAULT; } @@ -1237,7 +1237,7 @@ OUT: return ret; } -int SysLstat(const char *path, struct stat *buffer) +int SysLstat(const char *path, struct kstat *buffer) { int ret; char *pathRet = NULL; @@ -1256,7 +1256,7 @@ int SysLstat(const char *path, struct stat *buffer) goto OUT; } - ret = LOS_ArchCopyToUser(buffer, &bufRet, sizeof(struct stat)); + ret = LOS_ArchCopyToUser(buffer, &bufRet, sizeof(struct kstat)); if (ret != 0) { ret = -EFAULT; } diff --git a/syscall/los_syscall.h b/syscall/los_syscall.h index 37429b88..1934673d 100644 --- a/syscall/los_syscall.h +++ b/syscall/los_syscall.h @@ -55,6 +55,7 @@ #include "time.h" #include "sys/time.h" #include "sys/stat.h" +#include "sys/kstat.h" #ifdef LOSCFG_FS_VFS #include "sys/socket.h" #include "dirent.h" @@ -252,8 +253,8 @@ extern int SysFtruncate(int fd, off_t length); extern int SysStatfs(const char *path, struct statfs *buf); extern int SysStatfs64(const char *path, size_t sz, struct statfs *buf); -extern int SysStat(const char *path, struct stat *buf); -extern int SysLstat(const char *path, struct stat *buffer); +extern int SysStat(const char *path, struct kstat *buf); +extern int SysLstat(const char *path, struct kstat *buffer); extern int SysFstat(int fildes, struct stat *buf); extern int SysStatx(int fd, const char *restrict path, int flag, unsigned mask, struct statx *restrict stx); extern int SysFsync(int fd); From 9458de9ac664cd75540c8b638b9a6caf82812fc8 Mon Sep 17 00:00:00 2001 From: zhushengle Date: Thu, 22 Jul 2021 19:56:01 +0800 Subject: [PATCH 43/43] =?UTF-8?q?fix:=20nanosleep=20=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E7=9A=84rmtp=E5=8F=82=E6=95=B0=E8=A2=AB=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E6=B8=85=E9=9B=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit posix/linux 标准: nanosleep 使线程进入到了可被信号中断的状态,当线程睡眠被信号 中断,线程回复运行态时,若rmtp不为NULL,则会将sleep剩余的时间 记录在rmtp参数中返回,但是如果线程sleep过程中未被信号唤醒, 则忽略该参数。 由于鸿蒙中nanosleep是不可被打断的,即rmtp应该被忽略,而不是清零。 Close #I41U0R Signed-off-by: zhushengle Change-Id: I6622eb43d6782c2b53b99d9df5cfff5f5e1ed79c --- syscall/time_syscall.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/syscall/time_syscall.c b/syscall/time_syscall.c index e433e2de..ea87f298 100644 --- a/syscall/time_syscall.c +++ b/syscall/time_syscall.c @@ -356,13 +356,18 @@ int SysNanoSleep(const struct timespec *rqtp, struct timespec *rmtp) { int ret; struct timespec srqtp; - struct timespec srmtp = { 0 }; + struct timespec srmtp; if (!rqtp || LOS_ArchCopyFromUser(&srqtp, rqtp, sizeof(struct timespec))) { errno = EFAULT; return -EFAULT; } + if (rmtp && LOS_ArchCopyFromUser(&srmtp, rmtp, sizeof(struct timespec))) { + errno = EFAULT; + return -EFAULT; + } + ret = nanosleep(&srqtp, rmtp ? &srmtp : NULL); if (ret < 0) { return -get_errno();