Compare commits

...

16 Commits

Author SHA1 Message Date
openharmony_ci 33d58bb320
!818 【回合monthly0816】fix:trace模块编译修复
Merge pull request !818 from Zhaotianyu/cherry-pick-1662090526
2022-09-24 02:15:18 +00:00
openharmony_ci 75bb5ae446
!804 低功耗增加idle选项
Merge pull request !804 from zhushengle/cherry-pick-1661260128
2022-09-06 02:28:15 +00:00
arvinzzz 589c6fe894 fixed 6377f98 from https://gitee.com/arvinzzz/kernel_liteos_m/pulls/816
fix: trace模块编译修复
close: #I5PD6D

Signed-off-by: arvinzzz <zhaotianyu9@huawei.com>
Change-Id: I727ddaa78c5ca7b6626347659f584f54191efabe
2022-09-02 03:48:46 +00:00
openharmony_ci 008d9cf1bc
!813 非安全函数整改-合入monthly
Merge pull request !813 from xuxinyu/cherry-pick-1661483655
2022-08-27 09:14:39 +00:00
xuxinyu b746ddd9d6 fixed a0b776a from https://gitee.com/xuiny/kernel_liteos_m/pulls/807
非安全函数告警清理

Signed-off-by: xuxinyu <xuxinyu6@huawei.com>
Change-Id: I45bbaa3568be3679b34b1e8b072d19d878fdbf02
2022-08-26 03:14:16 +00:00
openharmony_ci 236e316568
!810 unittest关联issue
Merge pull request !810 from Hongjin Li/cherry-pick-1661312357
2022-08-24 08:32:05 +00:00
openharmony_ci 72d9e053d9
!802 编译构建规范优化-合入monthly0816
Merge pull request !802 from Hongjin Li/cherry-pick-1661257665
2022-08-24 03:45:09 +00:00
Hongjin Li a25443b016 fixed f7cc6ff from https://gitee.com/hongjin-li/kernel_liteos_m/pulls/809
test: unittest 关联 issue number

Signed-off-by: Hongjin Li <lihongjin1@huawei.com>
Change-Id: I0a735c85c004ef3171eb170effacc034e3c8cd1a
2022-08-24 03:39:17 +00:00
openharmony_ci 453790015e
!806 补充unittest用例描述,与需求issue进行关联-合入monthly
Merge pull request !806 from Hongjin Li/cherry-pick-1661261241
2022-08-24 02:10:18 +00:00
Hongjin Li fd75add21d fixed e9de74a from https://gitee.com/hongjin-li/kernel_liteos_m/pulls/805
test: testcase description

Signed-off-by: Hongjin Li <lihongjin1@huawei.com>
Change-Id: I1f8067dfbde2c12c092d5c9570f6ad45430f58ef

Change-Id: Ifad39593d943a29771691b6c23289d9774f5dfab
2022-08-23 13:27:21 +00:00
zhushengle 5717559488 fixed 9add4b4 from https://gitee.com/zhushengle/kernel_liteos_m/pulls/795
feat: 低功耗增加idle选项

Close #I5N9J2

Signed-off-by: zhushengle <zhushengle@huawei.com>
Change-Id: I066ff415709145e585f1eb94e70263361d3d71af
2022-08-23 13:08:48 +00:00
Hongjin Li 62c0ba21ad fixed 565049f from https://gitee.com/hongjin-li/kernel_liteos_m/pulls/801
style: string format in python

Signed-off-by: Hongjin Li <lihongjin1@huawei.com>
Change-Id: I0d6ffb978bf4f96fd546868a6dd5f20d2cefbfd6
2022-08-23 12:27:46 +00:00
openharmony_ci a4c87a792c
!798 【回合monthly0816】feature:允许device_path指向vendor
Merge pull request !798 from Zhaotianyu/cherry-pick-1660983025
2022-08-22 01:48:35 +00:00
arvinzzz d04b407e92 fixed d4db5a5 from https://gitee.com/arvinzzz/kernel_liteos_m/pulls/796
feature: BUILD.gn中device_path允许指向vendor
close: #I5N9NC

Signed-off-by: arvinzzz <zhaotianyu9@huawei.com>
Change-Id: If6a05871a0c78a92d6370b73528674e411642e20
2022-08-20 08:10:26 +00:00
openharmony_ci a7e5d26b17
!794 【回合】fix: iccarm fatfs编译问题修复 回合 monthly_0816分支
Merge pull request !794 from Zhaotianyu/cherry-pick-1660827092
2022-08-18 13:48:18 +00:00
arvinzzz 63d8e9d25c fixed 99640e9 from https://gitee.com/arvinzzz/kernel_liteos_m/pulls/792
fix: fatfs iccarm编译修复
close: #I5MZ62

Signed-off-by: arvinzzz <zhaotianyu9@huawei.com>
Change-Id: Ie3882e443406d5055ff58c780cd376ddd6054bbf
2022-08-18 12:51:33 +00:00
18 changed files with 270 additions and 193 deletions

View File

@ -120,8 +120,11 @@ config("los_config") {
cmd = "if [ -f $device_path/BUILD.gn ]; then echo true; else echo false; fi"
HAVE_DEVICE_SDK = exec_script("//build/lite/run_shell_cmd.py", [ cmd ], "value")
# board and soc decoupling feature, device_path should contains board
BOARD_SOC_FEATURE = device_path != string_replace(device_path, "/board/", "")
# If device_path points to vendor, use device_path directly,
# otherwise board is decoupled from soc, device_path should contain board
BOARD_SOC_FEATURE =
device_path == string_replace(device_path, "/vendor/", "") &&
device_path != string_replace(device_path, "/board/", "")
config("public") {
configs = [

View File

@ -273,7 +273,7 @@ STATIC DynSharedObj *OsLoadInit(const CHAR *fileName, VOID *pool)
goto ERR2;
}
strcpy(dso->buf, fileName);
(void)strcpy_s(dso->buf, nameLen + 1, fileName);
dso->fileName = dso->buf;
dso->ref = 1;
dso->pool = (pool ? pool : OS_SYS_MEM_ADDR);

View File

@ -71,7 +71,7 @@ PARTITION VolToPart[] = {
static int FsLock(void)
{
INT32 ret = 0;
int ret = 0;
struct timespec absTimeout = {0};
if (osKernelGetState() != osKernelRunning) {
return ret;
@ -110,15 +110,15 @@ static int FsChangeDrive(const char *path)
retErr = strncpy_s(tmpPath + 1, (FS_DRIVE_NAME_MAX_LEN - 1), (char const *)path, pathLen);
if (retErr != EOK) {
return LOS_NOK;
return (int)LOS_NOK;
}
res = f_chdrive(tmpPath);
if (res != FR_OK) {
return LOS_NOK;
return (int)LOS_NOK;
}
return LOS_OK;
return (int)LOS_OK;
}
static int Remount(struct MountPoint *mp, unsigned long mountflags)
@ -128,11 +128,11 @@ static int Remount(struct MountPoint *mp, unsigned long mountflags)
/* remount is not allowed when the device is not mounted. */
if (fatfs->fs_type == 0) {
errno = EINVAL;
return LOS_NOK;
return (int)LOS_NOK;
}
mp->mWriteEnable = (mountflags & MS_RDONLY) ? FALSE : TRUE;
return LOS_OK;
return (int)LOS_OK;
}
static unsigned int FatFsGetMode(int oflags)
@ -273,19 +273,19 @@ int FatfsMount(struct MountPoint *mp, unsigned long mountflags,
const void *data)
{
FRESULT res;
INT32 ret;
FATFS *fs = NULL;
int ret;
ret = FsLock();
if (ret != 0) {
errno = ret;
return LOS_NOK;
return (int)LOS_NOK;
}
char *ldPath = GetLdPath(mp->mDev);
if (ldPath == NULL) {
errno = EFAULT;
ret = LOS_NOK;
ret = (int)LOS_NOK;
goto ERROUT;
}
@ -297,7 +297,7 @@ int FatfsMount(struct MountPoint *mp, unsigned long mountflags,
fs = (FATFS *)malloc(sizeof(FATFS));
if (fs == NULL) {
errno = ENOMEM;
ret = LOS_NOK;
ret = (int)LOS_NOK;
goto ERROUT;
}
(void)memset_s(fs, sizeof(FATFS), 0, sizeof(FATFS));
@ -306,13 +306,13 @@ int FatfsMount(struct MountPoint *mp, unsigned long mountflags,
res = f_mount((FATFS *)mp->mData, ldPath, 1);
if (res != FR_OK) {
errno = FatfsErrno(res);
ret = LOS_NOK;
ret = (int)LOS_NOK;
goto ERROUT;
}
PutLdPath(ldPath);
FsUnlock();
return LOS_OK;
return (int)LOS_OK;
ERROUT:
free(fs);
@ -324,28 +324,28 @@ ERROUT:
int FatfsUmount(struct MountPoint *mp)
{
int ret;
int volId;
FRESULT res;
INT32 ret;
INT32 volId;
FATFS *fatfs = (FATFS *)mp->mData;
ret = FsLock();
if (ret != 0) {
errno = ret;
return LOS_NOK;
return (int)LOS_NOK;
}
char *ldPath = GetLdPath(mp->mDev);
if (ldPath == NULL) {
errno = EFAULT;
ret = LOS_NOK;
ret = (int)LOS_NOK;
goto OUT;
}
/* The volume is not mounted */
if (fatfs->fs_type == 0) {
errno = EINVAL;
ret = LOS_NOK;
ret = (int)LOS_NOK;
goto OUT;
}
@ -353,14 +353,14 @@ int FatfsUmount(struct MountPoint *mp)
/* umount is not allowed when a file or directory is opened. */
if (f_checkopenlock(volId) != FR_OK) {
errno = EBUSY;
ret = LOS_NOK;
ret = (int)LOS_NOK;
goto OUT;
}
res = f_mount((FATFS *)NULL, ldPath, 0);
if (res != FR_OK) {
errno = FatfsErrno(res);
ret = LOS_NOK;
ret = (int)LOS_NOK;
goto OUT;
}
@ -371,7 +371,7 @@ int FatfsUmount(struct MountPoint *mp)
free(mp->mData);
mp->mData = NULL;
ret = LOS_OK;
ret = (int)LOS_OK;
OUT:
PutLdPath(ldPath);
@ -381,7 +381,7 @@ OUT:
int FatfsUmount2(struct MountPoint *mp, int flag)
{
INT32 ret;
int ret;
UINT32 flags;
FRESULT res;
FATFS *fatfs = (FATFS *)mp->mData;
@ -389,33 +389,33 @@ int FatfsUmount2(struct MountPoint *mp, int flag)
flags = MNT_FORCE | MNT_DETACH | MNT_EXPIRE | UMOUNT_NOFOLLOW;
if ((UINT32)flag & ~flags) {
errno = EINVAL;
return LOS_NOK;
return (int)LOS_NOK;
}
ret = FsLock();
if (ret != 0) {
errno = ret;
return LOS_NOK;
return (int)LOS_NOK;
}
char *ldPath = GetLdPath(mp->mDev);
if (ldPath == NULL) {
errno = EFAULT;
ret = LOS_NOK;
ret = (int)LOS_NOK;
goto OUT;
}
/* The volume is not mounted */
if (fatfs->fs_type == 0) {
errno = EINVAL;
ret = LOS_NOK;
ret = (int)LOS_NOK;
goto OUT;
}
res = f_mount((FATFS *)NULL, ldPath, 0);
if (res != FR_OK) {
errno = FatfsErrno(res);
ret = LOS_NOK;
ret = (int)LOS_NOK;
goto OUT;
}
@ -426,7 +426,7 @@ int FatfsUmount2(struct MountPoint *mp, int flag)
free(mp->mData);
mp->mData = NULL;
ret = LOS_OK;
ret = (int)LOS_OK;
OUT:
PutLdPath(ldPath);
@ -438,12 +438,12 @@ int FatfsOpen(struct File *file, const char *path, int oflag)
{
FRESULT res;
UINT32 fmode;
INT32 ret;
FIL *fp = NULL;
int ret;
if (path == NULL) {
errno = EFAULT;
return LOS_NOK;
return (int)LOS_NOK;
}
fmode = FatFsGetMode(oflag);
@ -451,21 +451,21 @@ int FatfsOpen(struct File *file, const char *path, int oflag)
fp = (FIL *)malloc(sizeof(FIL));
if (fp == NULL) {
errno = ENOMEM;
return LOS_NOK;
return (int)LOS_NOK;
}
ret = FsLock();
if (ret != 0) {
errno = ret;
free(fp);
return LOS_NOK;
return (int)LOS_NOK;
}
ret = FsChangeDrive(path);
if (ret != LOS_OK) {
if (ret != (int)LOS_OK) {
PRINT_ERR("FAT open ChangeDrive err 0x%x!\r\n", ret);
errno = ENOENT;
ret = LOS_NOK;
ret = (int)LOS_NOK;
free(fp);
goto OUT;
}
@ -475,7 +475,7 @@ int FatfsOpen(struct File *file, const char *path, int oflag)
PRINT_ERR("FAT open err 0x%x!\r\n", res);
free(fp);
errno = FatfsErrno(res);
ret = LOS_NOK;
ret = (int)LOS_NOK;
goto OUT;
}
@ -489,19 +489,19 @@ OUT:
int FatfsClose(struct File *file)
{
FRESULT res;
INT32 ret;
FIL *fp = (FIL *)file->fData;
int ret;
ret = FsLock();
if (ret != 0) {
errno = ret;
return LOS_NOK;
return (int)LOS_NOK;
}
if ((fp == NULL) || (fp->obj.fs == NULL)) {
FsUnlock();
errno = ENOENT;
return LOS_NOK;
return (int)LOS_NOK;
}
res = f_close(fp);
@ -509,7 +509,7 @@ int FatfsClose(struct File *file)
PRINT_ERR("FAT close err 0x%x!\r\n", res);
FsUnlock();
errno = FatfsErrno(res);
return LOS_NOK;
return (int)LOS_NOK;
}
#if !FF_FS_TINY
@ -521,37 +521,37 @@ int FatfsClose(struct File *file)
file->fData = NULL;
FsUnlock();
return LOS_OK;
return (int)LOS_OK;
}
ssize_t FatfsRead(struct File *file, char *buf, size_t nbyte)
{
FRESULT res;
INT32 ret;
UINT32 lenRead;
FIL *fp = (FIL *)file->fData;
int ret;
if (buf == NULL) {
errno = EFAULT;
return LOS_NOK;
return (ssize_t)LOS_NOK;
}
ret = FsLock();
if (ret != 0) {
errno = ret;
return LOS_NOK;
return (ssize_t)LOS_NOK;
}
if (fp == NULL) {
FsUnlock();
errno = ENOENT;
return LOS_NOK;
return (ssize_t)LOS_NOK;
}
res = f_read(fp, buf, nbyte, &lenRead);
if (res != FR_OK) {
FsUnlock();
errno = FatfsErrno(res);
return LOS_NOK;
return (ssize_t)LOS_NOK;
}
FsUnlock();
@ -561,20 +561,20 @@ ssize_t FatfsRead(struct File *file, char *buf, size_t nbyte)
ssize_t FatfsWrite(struct File *file, const char *buf, size_t nbyte)
{
FRESULT res;
INT32 ret;
UINT32 lenWrite;
static BOOL overFlow = FALSE;
FIL *fp = (FIL *)file->fData;
int ret;
if (buf == NULL) {
errno = EFAULT;
return LOS_NOK;
return (ssize_t)LOS_NOK;
}
ret = FsLock();
if (ret != 0) {
errno = ret;
return LOS_NOK;
return (ssize_t)LOS_NOK;
}
if ((fp ==NULL) || (fp->obj.fs == NULL)) {
@ -598,20 +598,20 @@ ssize_t FatfsWrite(struct File *file, const char *buf, size_t nbyte)
ERROUT:
FsUnlock();
return LOS_NOK;
return (ssize_t)LOS_NOK;
}
off_t FatfsLseek(struct File *file, off_t offset, int whence)
{
FRESULT res;
INT32 ret;
off_t pos;
FIL *fp = (FIL *)file->fData;
int ret;
ret = FsLock();
if (ret != 0) {
errno = ret;
return LOS_NOK;
return (off_t)LOS_NOK;
}
if ((fp == NULL) || (fp->obj.fs == NULL)) {
@ -642,37 +642,37 @@ off_t FatfsLseek(struct File *file, off_t offset, int whence)
ERROUT:
FsUnlock();
return LOS_NOK;
return (off_t)LOS_NOK;
}
/* Remove the specified FILE */
int FatfsUnlink(struct MountPoint *mp, const char *path)
{
FRESULT res;
INT32 ret;
int ret;
if (path == NULL) {
errno = EFAULT;
return LOS_NOK;
return (int)LOS_NOK;
}
ret = FsLock();
if (ret != 0) {
errno = ret;
return LOS_NOK;
return (int)LOS_NOK;
}
if (!mp->mWriteEnable) {
errno = EACCES;
ret = LOS_NOK;
ret = (int)LOS_NOK;
goto OUT;
}
ret = FsChangeDrive(path);
if (ret != LOS_OK) {
if (ret != (int)LOS_OK) {
PRINT_ERR("FAT unlink ChangeDrive err 0x%x!\r\n", ret);
errno = ENOENT;
ret = LOS_NOK;
ret = (int)LOS_NOK;
goto OUT;
}
@ -680,11 +680,11 @@ int FatfsUnlink(struct MountPoint *mp, const char *path)
if (res != FR_OK) {
PRINT_ERR("FAT unlink err 0x%x!\r\n", res);
errno = FatfsErrno(res);
ret = LOS_NOK;
ret = (int)LOS_NOK;
goto OUT;
}
ret = LOS_OK;
ret = (int)LOS_OK;
OUT:
FsUnlock();
@ -695,24 +695,24 @@ int FatfsStat(struct MountPoint *mp, const char *path, struct stat *buf)
{
FRESULT res;
FILINFO fileInfo = {0};
INT32 ret;
int ret;
if ((path == NULL) || (buf == NULL)) {
errno = EFAULT;
return LOS_NOK;
return (int)LOS_NOK;
}
ret = FsLock();
if (ret != 0) {
errno = ret;
return LOS_NOK;
return (int)LOS_NOK;
}
ret = FsChangeDrive(path);
if (ret != LOS_OK) {
if (ret != (int)LOS_OK) {
PRINT_ERR("FAT stat ChangeDrive err 0x%x!\r\n", ret);
errno = ENOENT;
ret = LOS_NOK;
ret = (int)LOS_NOK;
goto OUT;
}
@ -720,7 +720,7 @@ int FatfsStat(struct MountPoint *mp, const char *path, struct stat *buf)
if (res != FR_OK) {
PRINT_ERR("FAT stat err 0x%x!\r\n", res);
errno = FatfsErrno(res);
ret = LOS_NOK;
ret = (int)LOS_NOK;
goto OUT;
}
@ -738,7 +738,7 @@ int FatfsStat(struct MountPoint *mp, const char *path, struct stat *buf)
buf->st_mode |= S_IFDIR;
}
ret = LOS_OK;
ret = (int)LOS_OK;
OUT:
FsUnlock();
@ -748,29 +748,29 @@ OUT:
/* Synchronize all changes to Flash */
int FatfsSync(struct File *file)
{
int ret;
FRESULT res;
INT32 ret;
FIL *fp = (FIL *)file->fData;
ret = FsLock();
if (ret != 0) {
errno = ret;
return LOS_NOK;
return (int)LOS_NOK;
}
if ((fp == NULL) || (fp->obj.fs == NULL)) {
errno = ENOENT;
ret = LOS_NOK;
ret = (int)LOS_NOK;
goto OUT;
}
res = f_sync(fp);
if (res != FR_OK) {
errno = FatfsErrno(res);
ret = LOS_NOK;
ret = (int)LOS_NOK;
goto OUT;
}
ret = LOS_OK;
ret = (int)LOS_OK;
OUT:
FsUnlock();
@ -780,30 +780,30 @@ OUT:
int FatfsMkdir(struct MountPoint *mp, const char *path)
{
FRESULT res;
INT32 ret;
int ret;
if (path == NULL) {
errno = EFAULT;
return LOS_NOK;
return (int)LOS_NOK;
}
ret = FsLock();
if (ret != 0) {
errno = ret;
return LOS_NOK;
return (int)LOS_NOK;
}
if (!mp->mWriteEnable) {
errno = EACCES;
ret = LOS_NOK;
ret = (int)LOS_NOK;
goto OUT;
}
ret = FsChangeDrive(path);
if (ret != LOS_OK) {
if (ret != (int)LOS_OK) {
PRINT_ERR("FAT mkdir ChangeDrive err 0x%x!\r\n", ret);
errno = ENOENT;
ret = LOS_NOK;
ret = (int)LOS_NOK;
goto OUT;
}
@ -811,10 +811,10 @@ int FatfsMkdir(struct MountPoint *mp, const char *path)
if (res != FR_OK) {
PRINT_ERR("FAT mkdir err 0x%x!\r\n", res);
errno = FatfsErrno(res);
ret = LOS_NOK;
ret = (int)LOS_NOK;
goto OUT;
}
ret = LOS_OK;
ret = (int)LOS_OK;
OUT:
FsUnlock();
@ -824,8 +824,8 @@ OUT:
int FatfsOpendir(struct Dir *dir, const char *dirName)
{
FRESULT res;
INT32 ret;
DIR *dp = NULL;
int ret;
if (dirName == NULL) {
errno = EFAULT;
@ -845,7 +845,7 @@ int FatfsOpendir(struct Dir *dir, const char *dirName)
}
ret = FsChangeDrive(dirName);
if (ret != LOS_OK) {
if (ret != (int)LOS_OK) {
PRINT_ERR("FAT opendir ChangeDrive err 0x%x!\r\n", ret);
errno = ENOENT;
goto ERROUT;
@ -862,33 +862,33 @@ int FatfsOpendir(struct Dir *dir, const char *dirName)
dir->dOffset = 0;
FsUnlock();
return LOS_OK;
return (int)LOS_OK;
ERROUT:
if (dp != NULL) {
free(dp);
}
FsUnlock();
return LOS_NOK;
return (int)LOS_NOK;
}
int FatfsReaddir(struct Dir *dir, struct dirent *dent)
{
FRESULT res;
INT32 ret;
FILINFO fileInfo = {0};
DIR *dp = NULL;
int ret;
if ((dir == NULL) || (dir->dData == NULL)) {
errno = EBADF;
return LOS_NOK;
return (int)LOS_NOK;
}
dp = (DIR *)dir->dData;
ret = FsLock();
if (ret != 0) {
errno = ret;
return LOS_NOK;
return (int)LOS_NOK;
}
res = f_readdir(dp, &fileInfo);
@ -897,7 +897,7 @@ int FatfsReaddir(struct Dir *dir, struct dirent *dent)
PRINT_ERR("FAT readdir err 0x%x!\r\n", res);
errno = FatfsErrno(res);
FsUnlock();
return LOS_NOK;
return (int)LOS_NOK;
}
(void)memcpy_s(dent->d_name, sizeof(dent->d_name),
@ -909,25 +909,25 @@ int FatfsReaddir(struct Dir *dir, struct dirent *dent)
}
FsUnlock();
return LOS_OK;
return (int)LOS_OK;
}
int FatfsClosedir(struct Dir *dir)
{
FRESULT res;
INT32 ret;
DIR *dp = NULL;
int ret;
if ((dir == NULL) || (dir->dData == NULL)) {
errno = EBADF;
return LOS_NOK;
return (int)LOS_NOK;
}
dp = dir->dData;
ret = FsLock();
if (ret != 0) {
errno = ret;
return LOS_NOK;
return (int)LOS_NOK;
}
res = f_closedir(dp);
@ -935,43 +935,43 @@ int FatfsClosedir(struct Dir *dir)
PRINT_ERR("FAT closedir err 0x%x!\r\n", res);
FsUnlock();
errno = FatfsErrno(res);
return LOS_NOK;
return (int)LOS_NOK;
}
free(dir->dData);
dir->dData = NULL;
FsUnlock();
return LOS_OK;
return (int)LOS_OK;
}
int FatfsRmdir(struct MountPoint *mp, const char *path)
{
FRESULT res;
INT32 ret;
int ret;
if ((path == NULL) || (mp == NULL)) {
errno = EFAULT;
return LOS_NOK;
return (int)LOS_NOK;
}
ret = FsLock();
if (ret != 0) {
errno = ret;
return LOS_NOK;
return (int)LOS_NOK;
}
if (!mp->mWriteEnable) {
errno = EACCES;
ret = LOS_NOK;
ret = (int)LOS_NOK;
goto OUT;
}
ret = FsChangeDrive(path);
if (ret != LOS_OK) {
if (ret != (int)LOS_OK) {
PRINT_ERR("FAT rmdir ChangeDrive err 0x%x!\r\n", ret);
errno = ENOENT;
ret = LOS_NOK;
ret = (int)LOS_NOK;
goto OUT;
}
@ -979,10 +979,10 @@ int FatfsRmdir(struct MountPoint *mp, const char *path)
if (res != FR_OK) {
PRINT_ERR("FAT rmdir err 0x%x!\r\n", res);
errno = FatfsErrno(res);
ret = LOS_NOK;
ret = (int)LOS_NOK;
goto OUT;
}
ret = LOS_OK;
ret = (int)LOS_OK;
OUT:
FsUnlock();
@ -992,30 +992,30 @@ OUT:
int FatfsRename(struct MountPoint *mp, const char *oldName, const char *newName)
{
FRESULT res;
INT32 ret;
int ret;
if ((oldName == NULL) || (newName == NULL)) {
errno = EFAULT;
return LOS_NOK;
return (int)LOS_NOK;
}
ret = FsLock();
if (ret != 0) {
errno = ret;
return LOS_NOK;
return (int)LOS_NOK;
}
if (!mp->mWriteEnable) {
errno = EACCES;
ret = LOS_NOK;
ret = (int)LOS_NOK;
goto OUT;
}
ret = FsChangeDrive(oldName);
if (ret != LOS_OK) {
if (ret != (int)LOS_OK) {
PRINT_ERR("FAT f_getfree ChangeDrive err 0x%x!\r\n", ret);
errno = ENOENT;
ret = LOS_NOK;
ret = (int)LOS_NOK;
goto OUT;
}
@ -1023,10 +1023,10 @@ int FatfsRename(struct MountPoint *mp, const char *oldName, const char *newName)
if (res != FR_OK) {
PRINT_ERR("FAT frename err 0x%x!\r\n", res);
errno = FatfsErrno(res);
ret = LOS_NOK;
ret = (int)LOS_NOK;
goto OUT;
}
ret = LOS_OK;
ret = (int)LOS_OK;
OUT:
FsUnlock();
@ -1038,24 +1038,24 @@ int FatfsStatfs(const char *path, struct statfs *buf)
FATFS *fs = NULL;
UINT32 freeClust;
FRESULT res;
INT32 ret;
int ret;
if ((path == NULL) || (buf == NULL)) {
errno = EFAULT;
return LOS_NOK;
return (int)LOS_NOK;
}
ret = FsLock();
if (ret != 0) {
errno = ret;
return LOS_NOK;
return (int)LOS_NOK;
}
ret = FsChangeDrive(path);
if (ret != FR_OK) {
PRINT_ERR("FAT f_getfree ChangeDrive err %d.", ret);
errno = FatfsErrno(FR_INVALID_PARAMETER);
ret = LOS_NOK;
ret = (int)LOS_NOK;
goto OUT;
}
@ -1063,7 +1063,7 @@ int FatfsStatfs(const char *path, struct statfs *buf)
if (res != FR_OK) {
PRINT_ERR("FAT f_getfree err 0x%x.", res);
errno = FatfsErrno(res);
ret = LOS_NOK;
ret = (int)LOS_NOK;
goto OUT;
}
buf->f_bfree = freeClust;
@ -1076,7 +1076,7 @@ int FatfsStatfs(const char *path, struct statfs *buf)
buf->f_bsize = FF_MIN_SS * fs->csize;
#endif
ret = LOS_OK;
ret = (int)LOS_OK;
OUT:
FsUnlock();
@ -1086,9 +1086,9 @@ OUT:
static int DoTruncate(struct File *file, off_t length, UINT32 count)
{
FRESULT res = FR_OK;
INT32 ret = LOS_OK;
DWORD csz;
FIL *fp = (FIL *)file->fData;
int ret = (int)LOS_OK;
csz = (DWORD)(fp->obj.fs)->csize * SS(fp->obj.fs); /* Cluster size */
if (length > csz * count) {
@ -1096,7 +1096,7 @@ static int DoTruncate(struct File *file, off_t length, UINT32 count)
res = f_expand(fp, 0, (FSIZE_t)(length), FALLOC_FL_KEEP_SIZE);
#else
errno = ENOSYS;
ret = LOS_NOK;
ret = (int)LOS_NOK;
return ret;
#endif
} else if (length < csz * count) {
@ -1105,7 +1105,7 @@ static int DoTruncate(struct File *file, off_t length, UINT32 count)
if (res != FR_OK) {
errno = FatfsErrno(res);
ret = LOS_NOK;
ret = (int)LOS_NOK;
return ret;
}
@ -1118,32 +1118,32 @@ static int DoTruncate(struct File *file, off_t length, UINT32 count)
int FatfsTruncate(struct File *file, off_t length)
{
FRESULT res;
INT32 ret;
UINT count;
DWORD fclust;
FIL *fp = (FIL *)file->fData;
int ret;
if ((length < 0) || (length > UINT_MAX)) {
errno = EINVAL;
return LOS_NOK;
return (int)LOS_NOK;
}
ret = FsLock();
if (ret != 0) {
errno = ret;
return LOS_NOK;
return (int)LOS_NOK;
}
if ((fp == NULL) || (fp->obj.fs == NULL)) {
errno = ENOENT;
ret = LOS_NOK;
ret = (int)LOS_NOK;
goto OUT;
}
res = f_getclustinfo(fp, &fclust, &count);
if (res != FR_OK) {
errno = FatfsErrno(res);
ret = LOS_NOK;
ret = (int)LOS_NOK;
goto OUT;
}
@ -1152,7 +1152,7 @@ int FatfsTruncate(struct File *file, off_t length)
goto OUT;
}
ret = LOS_OK;
ret = (int)LOS_OK;
OUT:
FsUnlock();
@ -1163,34 +1163,34 @@ int FatfsFdisk(const char *dev, int *partTbl, int arrayNum)
{
int pdrv;
FRESULT res;
INT32 ret;
int ret;
if ((dev == NULL) || (partTbl == NULL)) {
errno = EFAULT;
return LOS_NOK;
return (int)LOS_NOK;
}
pdrv = GetDevIdByDevName(dev);
if (pdrv < 0) {
errno = EFAULT;
return LOS_NOK;
return (int)LOS_NOK;
}
ret = FsLock();
if (ret != 0) {
errno = ret;
ret = LOS_NOK;
ret = (int)LOS_NOK;
goto OUT;
}
res = f_fdisk(pdrv, (DWORD const *)partTbl, g_workBuffer);
if (res != FR_OK) {
errno = FatfsErrno(res);
ret = LOS_NOK;
ret = (int)LOS_NOK;
goto OUT;
}
ret = LOS_OK;
ret = (int)LOS_OK;
OUT:
FsUnlock();
@ -1200,27 +1200,27 @@ OUT:
int FatfsFormat(const char *partName, void *privData)
{
FRESULT res;
INT32 ret;
MKFS_PARM opt = {0};
int option = *(int *)privData;
char *dev = NULL; /* logical driver */
int ret;
if (partName == NULL) {
errno = EFAULT;
return LOS_NOK;
return (int)LOS_NOK;
}
dev = GetLdPath(partName);
if (dev == NULL) {
errno = EFAULT;
return LOS_NOK;
return (int)LOS_NOK;
}
ret = FsLock();
if (ret != 0) {
errno = ret;
PutLdPath(dev);
return LOS_NOK;
return (int)LOS_NOK;
}
opt.fmt = option;
@ -1229,11 +1229,11 @@ int FatfsFormat(const char *partName, void *privData)
res = f_mkfs(dev, &opt, g_workBuffer, FF_MAX_SS);
if (res != FR_OK) {
errno = FatfsErrno(res);
ret = LOS_NOK;
ret = (int)LOS_NOK;
goto OUT;
}
ret = LOS_OK;
ret = (int)LOS_OK;
OUT:
PutLdPath(dev);

View File

@ -129,7 +129,8 @@ STATIC BOOL OsPmTickTimerStop(LosPmCB *pm)
#endif
LosPmTickTimer *tickTimer = pm->tickTimer;
if ((tickTimer == NULL) || (tickTimer->tickLock == NULL)) {
if ((tickTimer == NULL) || (tickTimer->tickLock == NULL) ||
(pm->pmMode == LOS_SYS_NORMAL_SLEEP)) {
return FALSE;
}
@ -167,7 +168,6 @@ STATIC VOID OsPmCpuResume(LosPmCB *pm)
STATIC VOID OsPmCpuSuspend(LosPmCB *pm)
{
/* cpu enter low power mode */
LOS_ASSERT(pm->sysctrl != NULL);
if (pm->sysMode == LOS_SYS_NORMAL_SLEEP) {
pm->sysctrl->normalSuspend();
@ -226,6 +226,8 @@ STATIC UINT32 OsPmSuspendCheck(LosPmCB *pm, Suspend *sysSuspendEarly, Suspend *d
return LOS_NOK;
}
LOS_ASSERT(pm->sysctrl != NULL);
pm->isWake = FALSE;
*mode = pm->sysMode;
*sysSuspendEarly = pm->sysctrl->early;
@ -260,6 +262,10 @@ STATIC UINT32 OsPmSuspendSleep(LosPmCB *pm)
goto EXIT;
}
if (pm->sysctrl->suspendCheck != NULL) {
pm->sysctrl->suspendCheck(mode);
}
tickTimerStop = OsPmTickTimerStop(pm);
if (!tickTimerStop) {
OsSchedResetSchedResponseTime(0);
@ -283,6 +289,9 @@ EXIT:
STATIC VOID OsPmNormalSleep(VOID)
{
#if (LOSCFG_KERNEL_PM_IDLE == 1)
(VOID)LOS_PmSuspend(0);
#else
UINT32 intSave;
LosPmCB *pm = &g_pmCB;
@ -293,6 +302,7 @@ STATIC VOID OsPmNormalSleep(VOID)
OsPmCpuResume(pm);
LOS_IntRestore(intSave);
#endif
}
STATIC UINT32 OsPmDeviceRegister(LosPmCB *pm, LosPmDevice *device)
@ -343,6 +353,9 @@ STATIC UINT32 OsPmSysctrlRegister(LosPmCB *pm, LosPmSysctrl *sysctrl)
if (sysctrl->late != NULL) {
pm->sysctrl->late = sysctrl->late;
}
if (sysctrl->suspendCheck != NULL) {
pm->sysctrl->suspendCheck = sysctrl->suspendCheck;
}
if (sysctrl->normalSuspend != NULL) {
pm->sysctrl->normalSuspend = sysctrl->normalSuspend;
}

View File

@ -165,6 +165,8 @@ typedef struct {
* Unlocked task scheduling.
*/
VOID (*late)(UINT32 mode);
/* Final check before low-power consumption. */
VOID (*suspendCheck)(UINT32 mode);
/* The system enters the Normal sleep mode.
* In normal mode, the value cannot be NULL.
*/

View File

@ -43,6 +43,10 @@
#include "los_debugtools.h"
#endif
#if (LOSCFG_KERNEL_TRACE == 1)
#include "los_trace_pri.h"
#endif
#define SHELL_INIT_MAGIC_FLAG 0xABABABAB
STATIC CmdModInfo cmdInfo;
@ -75,6 +79,13 @@ CmdItem g_shellcmdAll[] = {
{CMD_TYPE_EX, "st", 1, (CmdCallBackFunc)OsShellCmdSchedTrace},
#endif
{CMD_TYPE_EX, "help", 0, (CmdCallBackFunc)OsShellCmdHelp},
#if (LOSCFG_KERNEL_TRACE == 1)
{CMD_TYPE_EX, "trace_start", 0, (CmdCallBackFunc)LOS_TraceStart},
{CMD_TYPE_EX, "trace_stop", 0, (CmdCallBackFunc)LOS_TraceStop},
{CMD_TYPE_EX, "trace_mask", 1, (CmdCallBackFunc)OsShellCmdTraceSetMask},
{CMD_TYPE_EX, "trace_reset", 0, (CmdCallBackFunc)LOS_TraceReset},
{CMD_TYPE_EX, "trace_dump", 1, (CmdCallBackFunc)OsShellCmdTraceDump},
#endif
};
CmdModInfo *OsCmdInfoGet(VOID)

View File

@ -64,3 +64,11 @@ kernel_module(module_name) {
include_dirs += [ "pipeline/serial" ]
}
}
config("public") {
include_dirs = [
".",
"cnv",
"pipeline",
]
}

View File

@ -411,12 +411,6 @@ LITE_OS_SEC_TEXT_MINOR UINT32 OsShellCmdTraceDump(INT32 argc, const CHAR **argv)
LOS_TraceRecordDump(toClient);
return LOS_OK;
}
SHELLCMD_ENTRY(tracestart_shellcmd, CMD_TYPE_EX, "trace_start", 0, (CmdCallBackFunc)LOS_TraceStart);
SHELLCMD_ENTRY(tracestop_shellcmd, CMD_TYPE_EX, "trace_stop", 0, (CmdCallBackFunc)LOS_TraceStop);
SHELLCMD_ENTRY(tracesetmask_shellcmd, CMD_TYPE_EX, "trace_mask", 1, (CmdCallBackFunc)OsShellCmdTraceSetMask);
SHELLCMD_ENTRY(tracereset_shellcmd, CMD_TYPE_EX, "trace_reset", 0, (CmdCallBackFunc)LOS_TraceReset);
SHELLCMD_ENTRY(tracedump_shellcmd, CMD_TYPE_EX, "trace_dump", 1, (CmdCallBackFunc)OsShellCmdTraceDump);
#endif
#endif /* LOSCFG_KERNEL_TRACE == 1 */

View File

@ -152,6 +152,11 @@ extern VOID OsTraceRecordDump(BOOL toClient);
#define OsTraceNotifyStop()
#endif
#if (LOSCFG_SHELL == 1)
extern UINT32 OsShellCmdTraceSetMask(INT32 argc, const CHAR **argv);
extern UINT32 OsShellCmdTraceDump(INT32 argc, const CHAR **argv);
#endif
#ifdef __cplusplus
#if __cplusplus
}

View File

@ -31,6 +31,8 @@
#include "los_trace_pri.h"
#include "trace_pipeline.h"
#include "los_memory.h"
#include "securec.h"
#if (LOSCFG_RECORDER_MODE_OFFLINE == 1)
#define BITS_NUM_FOR_TASK_ID 16

View File

@ -663,6 +663,22 @@ extern UINT8 *m_aucSysMem0;
#define LOSCFG_KERNEL_SIGNAL 0
#endif
/**
* @ingroup los_config
* Configuration item to enable kernel power module.
*/
#ifndef LOSCFG_KERNEL_PM
#define LOSCFG_KERNEL_PM 0
#endif
/**
* @ingroup los_config
* Configuration item to enable kernel power module in idle task.
*/
#ifndef LOSCFG_KERNEL_PM_IDLE
#define LOSCFG_KERNEL_PM_IDLE 0
#endif
#ifdef __cplusplus
#if __cplusplus
}

View File

@ -81,18 +81,21 @@ EXIT:
return LOS_OK;
};
/* set and get queue name test */
/**
* @tc.name: TestCmsis007
* @tc.desc: set and get queue name
* @tc.type: FUNC
* @tc.require: issueI5LBE8
*/
LITE_TEST_CASE(CmsisFuncTestSuite, TestCmsis007, Function | MediumTest | Level1)
{
osMessageQueueId_t msgQueueId;
osMessageQueueAttr_t attr;
osMessageQueueAttr_t attr = {0};
CHAR staticBuff[STATCI_BUFF_SIZE] = {0};
CHAR strbuff[] = "hello world";
CHAR *name = NULL;
INT32 ret;
memset(&attr, 0, sizeof(attr));
attr.name = "q1";
/* dynamic test */
msgQueueId = osMessageQueueNew(1, strlen(strbuff), &attr);
@ -179,11 +182,9 @@ static VOID CmsisQueueTestThread2(VOID)
static INT32 ThreadReadWriteTest(VOID)
{
osMessageQueueAttr_t attr;
osMessageQueueAttr_t attr = {0};
INT32 ret;
memset(&attr, 0, sizeof(attr));
g_msgQueueId1 = osMessageQueueNew(1, strlen(g_strbuff1), NULL);
ICUNIT_ASSERT_NOT_EQUAL(g_msgQueueId1, NULL, g_msgQueueId1);
@ -212,7 +213,12 @@ static INT32 ThreadReadWriteTest(VOID)
return 0;
}
/* mix read write */
/**
* @tc.name: TestCmsis006
* @tc.desc: mix read write
* @tc.type: FUNC
* @tc.require: issueI5LBE8
*/
LITE_TEST_CASE(CmsisFuncTestSuite, TestCmsis006, Function | MediumTest | Level1)
{
INT32 ret;
@ -224,18 +230,21 @@ LITE_TEST_CASE(CmsisFuncTestSuite, TestCmsis006, Function | MediumTest | Level1)
}
#endif
/* read-write exception */
/**
* @tc.name: TestCmsis005
* @tc.desc: read-write exception
* @tc.type: FUNC
* @tc.require: issueI5LBE8
*/
LITE_TEST_CASE(CmsisFuncTestSuite, TestCmsis005, Function | MediumTest | Level1)
{
osMessageQueueId_t msgQueueId;
osMessageQueueAttr_t attr;
osMessageQueueAttr_t attr = {0};
CHAR staticBuff[STATCI_BUFF_SIZE] = {0};
CHAR strbuff[] = "hello world";
CHAR data[STATCI_BUFF_SIZE] = {0};
INT32 ret;
memset(&attr, 0, sizeof(attr));
ret = osMessageQueuePut(NULL, &strbuff, 0U, 0U);
ICUNIT_ASSERT_EQUAL(ret, osErrorParameter, ret);
@ -293,18 +302,21 @@ EXIT:
return LOS_OK;
}
/* read write test */
/**
* @tc.name: TestCmsis004
* @tc.desc: read write test
* @tc.type: FUNC
* @tc.require: issueI5LBE8
*/
LITE_TEST_CASE(CmsisFuncTestSuite, TestCmsis004, Function | MediumTest | Level1)
{
osMessageQueueId_t msgQueueId;
osMessageQueueAttr_t attr;
osMessageQueueAttr_t attr = {0};
CHAR staticBuff[STATCI_BUFF_SIZE] = {0};
CHAR strbuff[] = "hello world";
CHAR data[STATCI_BUFF_SIZE] = {0};
INT32 ret;
memset(&attr, 0, sizeof(attr));
/* dynamic test */
msgQueueId = osMessageQueueNew(1, strlen(strbuff), NULL);
ICUNIT_ASSERT_NOT_EQUAL(msgQueueId, NULL, msgQueueId);
@ -352,16 +364,19 @@ EXIT:
return LOS_OK;
}
/* create exception parameters test */
/**
* @tc.name: TestCmsis003
* @tc.desc: create exception parameters test
* @tc.type: FUNC
* @tc.require: issueI5LBE8
*/
LITE_TEST_CASE(CmsisFuncTestSuite, TestCmsis003, Function | MediumTest | Level1)
{
osMessageQueueId_t msgQueueId;
osMessageQueueAttr_t attr;
osMessageQueueAttr_t attr = {0};
CHAR staticBuff[STATCI_BUFF_SIZE] = {0};
CHAR strbuff[] = "hello world";
memset(&attr, 0, sizeof(attr));
/* dynmic test */
msgQueueId = osMessageQueueNew(0, strlen(strbuff), NULL);
ICUNIT_ASSERT_EQUAL(msgQueueId, NULL, msgQueueId);
@ -393,17 +408,20 @@ LITE_TEST_CASE(CmsisFuncTestSuite, TestCmsis003, Function | MediumTest | Level1)
return LOS_OK;
};
/* create and delete test */
/**
* @tc.name: TestCmsis002
* @tc.desc: create and delete test
* @tc.type: FUNC
* @tc.require: issueI5LBE8
*/
LITE_TEST_CASE(CmsisFuncTestSuite, TestCmsis002, Function | MediumTest | Level1)
{
osMessageQueueId_t msgQueueId;
osMessageQueueAttr_t attr;
osMessageQueueAttr_t attr = {0};
CHAR staticBuff[STATCI_BUFF_SIZE] = {0};
CHAR strbuff[] = "hello world";
INT32 ret;
memset(&attr, 0, sizeof(attr));
/* dynamic test */
msgQueueId = osMessageQueueNew(1, strlen(strbuff), NULL);
ICUNIT_ASSERT_NOT_EQUAL(msgQueueId, NULL, msgQueueId);

View File

@ -55,8 +55,10 @@ static UINT32 TestCase(VOID)
g_testAtomicID05 = 0;
for (i = 0; i < ATOMIC_MUTI_TASK_NUM; i++) {
memset(buf, 0, 10); // max buf size is 10.
memset(taskName[i], 0, 20); // max taskName size is 20.
ret = memset_s(buf, 10, 0, 10); // max buf size is 10.
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
ret = memset_s(taskName[i], 20, 0, 20); // max taskName size is 20.
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
task[i].pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01;
task[i].pcName = taskName[i];

View File

@ -56,9 +56,10 @@ static UINT32 TestCase(VOID)
g_testAtomicID05 = 0;
for (i = 0; i < ATOMIC_MUTI_TASK_NUM; i++) {
memset(buf, 0, 10); // max buf size is 10.
memset(taskName[i], 0, 20); // max taskName size is 20.
ret = memset_s(buf, 10, 0, 10); // max buf size is 10.
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
ret = memset_s(taskName[i], 20, 0, 20); // max taskName size is 20.
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
task[i].pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01;
task[i].pcName = taskName[i];
task[i].uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE;

View File

@ -71,8 +71,10 @@ static UINT32 TestCase(VOID)
}
for (i = 0; i < uLoop; i++) {
memset(buf, 0, 10); // max buf size is 10.
memset(taskName[i], 0, 20); // max taskName size is 20.
ret = memset_s(buf, 10, 0, 10); // max buf size is 10.
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
ret = memset_s(taskName[i], 20, 0, 20); // max taskName size is 20.
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
if (i % 2 == 0) { // 2 is index.
uCount++;

View File

@ -40,7 +40,7 @@ static UINT32 TestCase(VOID)
src = LOS_MemAlloc(m_aucSysMem0, 9);
ICUNIT_ASSERT_NOT_EQUAL(src, NULL, src);
(VOID)memset(src, 0, 9);
(void)memset_s(src, 9, 0, 9);
src[0] = 49;
src[1] = 50;
src[2] = 51;

View File

@ -40,7 +40,7 @@ static UINT32 TestCase(VOID)
src = LOS_MemAlloc(m_aucSysMem0, 9);
ICUNIT_ASSERT_NOT_EQUAL(src, NULL, src);
(VOID)memset(src, 0, 9);
(void)memset_s(src, 9, 0, 9);
src[0] = 49;
src[1] = 50;
src[2] = 51;

View File

@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 2020 Huawei Device Co., Ltd.
# Copyright (c) 2020-2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
@ -79,7 +79,6 @@ def store_static_excel():
def format_store_static():
global g_excel_support
out_fd = open("./static_symbol_out.txt", "w+")
target_list = []
for base_address, values in static_map.items():
@ -89,8 +88,9 @@ def format_store_static():
target_list.append('{:<10}'.format(values.get('sizeD')))
target_list.append('{:<55s}{:<55s}{:<55s}'.format(values.get('symbol'), values.get('lib'), values.get('obj')))
target_list.append("\r")
out_fd.write("".join(target_list))
with open("./static_symbol_out.txt", "w+") as out_fd:
out_fd.write("".join(target_list))
if g_excel_support == True:
store_static_excel()
return
@ -126,13 +126,13 @@ def store_dync_excel():
c.value = values.get('symbol')
for i in range(values.get('lib')):
column = i * 3 + 2
addr_name = 'LR' + str(i) + '_addr'
addr_name = "LR%s_addr" % (str(i))
c = ws.cell(row, column + 1)
c.value = addr_name
symbol_name = 'LR' + str(i) + '_symbol'
symbol_name = "LR%s_symbol" % (str(i))
c = ws.cell(row, column + 2)
c.value = symbol_name
object_name = 'LR' + str(i) + '_object'
object_name = "LR%s_object" % (str(i))
c = ws.cell(row, column + 3)
c.value = object_name
else:
@ -157,16 +157,15 @@ def store_dync_excel():
def format_store_dync():
global g_excel_support
out_fd = open("./dynamic_memory_out.txt", "w+")
target_list = []
for base_address, values in dync_map.items():
if (0 == base_address):
target_list.append('{:<15s}{:<15s}'.format("node", "size"))
for i in range(values.get('lib')):
addr_name = 'LR' + str(i) + '_addr'
symbol_name = 'LR' + str(i) + '_symbol'
object_name = 'LR' + str(i) + '_object'
addr_name = "LR%s_addr" % (str(i))
symbol_name = "LR%s_symbol" % (str(i))
object_name = "LR%s_object" % (str(i))
target_list.append('{:<15s}{:<55s}{:<55s}'.format(addr_name, symbol_name, object_name))
else:
@ -177,8 +176,9 @@ def format_store_dync():
target_list.append('{:<15s}'.format(values.get('addr')))
target_list.append('{:<55s}'.format(values.get('symbol')))
target_list.append('{:<55s}'.format(values.get('lib')))
out_fd.write("".join(target_list))
with open("./dynamic_memory_out.txt", "w+") as out_fd:
out_fd.write("".join(target_list))
if g_excel_support == True:
store_dync_excel()
return