Compare commits
10 Commits
OpenHarmon
...
OpenHarmon
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
887a845874 | ||
|
|
8ee33a771b | ||
|
|
c182540a92 | ||
|
|
d837ed3e9d | ||
|
|
a2371f1b27 | ||
|
|
8245cd5cd0 | ||
|
|
b9311b9aa0 | ||
|
|
8cf75d80fd | ||
|
|
4491d561c7 | ||
|
|
1bf61bb4b0 |
@@ -151,7 +151,7 @@ STATIC INLINE UINT32 OsStackAddrGet(UINTPTR *stackStart, UINTPTR *stackEnd, UINT
|
||||
LosTaskCB *taskCB = OS_TCB_FROM_TID(taskID);
|
||||
*stackEnd = (UINTPTR)taskCB->topOfStack + taskCB->stackSize;
|
||||
if ((*stackStart < (UINTPTR)taskCB->topOfStack) || (*stackStart >= *stackEnd)) {
|
||||
PRINT_ERR("psp stack [0x%x, 0x%x], cur sp(0x%x) is overflow, cur task id is %d!\n",
|
||||
PRINT_ERR("psp stack [0x%x, 0x%x], cur sp(0x%x) is overflow, cur task id is %u!\n",
|
||||
taskCB->topOfStack, *stackEnd, *stackStart, taskID);
|
||||
return LOS_NOK;
|
||||
}
|
||||
@@ -413,7 +413,7 @@ VOID LOS_BackTrace(VOID)
|
||||
if (LR[index] == 0) {
|
||||
break;
|
||||
}
|
||||
PRINTK("traceback %d -- lr = 0x%x\r\n", index, LR[index]);
|
||||
PRINTK("traceback %u -- lr = 0x%x\r\n", index, LR[index]);
|
||||
}
|
||||
PRINTK("----- traceback end -----\r\n");
|
||||
}
|
||||
|
||||
@@ -481,7 +481,7 @@ LITE_OS_SEC_TEXT_MINOR UINT32 LOS_CpupUsageMonitor(CPUP_TYPE_E type, CPUP_MODE_E
|
||||
PRINTK("\nSysCpuUsage in <1s: ");
|
||||
}
|
||||
ret = LOS_HistorySysCpuUsage(mode);
|
||||
PRINTK("%d.%d", ret / LOS_CPUP_PRECISION_MULT, ret % LOS_CPUP_PRECISION_MULT);
|
||||
PRINTK("%u.%u", ret / LOS_CPUP_PRECISION_MULT, ret % LOS_CPUP_PRECISION_MULT);
|
||||
break;
|
||||
|
||||
case TASK_CPU_USAGE:
|
||||
@@ -495,11 +495,11 @@ LITE_OS_SEC_TEXT_MINOR UINT32 LOS_CpupUsageMonitor(CPUP_TYPE_E type, CPUP_MODE_E
|
||||
return OS_ERROR;
|
||||
}
|
||||
if (mode == CPUP_IN_10S) {
|
||||
PRINTK("\nCPUusage of taskID %d in 10s: ", taskID);
|
||||
PRINTK("\nCPUusage of taskID %u in 10s: ", taskID);
|
||||
} else if (mode == CPUP_IN_1S) {
|
||||
PRINTK("\nCPUusage of taskID %d in 1s: ", taskID);
|
||||
PRINTK("\nCPUusage of taskID %u in 1s: ", taskID);
|
||||
} else {
|
||||
PRINTK("\nCPUusage of taskID %d in <1s: ", taskID);
|
||||
PRINTK("\nCPUusage of taskID %u in <1s: ", taskID);
|
||||
}
|
||||
ret = LOS_HistoryTaskCpuUsage(taskID, mode);
|
||||
PRINTK("%u.%u", ret / LOS_CPUP_PRECISION_MULT, ret % LOS_CPUP_PRECISION_MULT);
|
||||
|
||||
@@ -1432,6 +1432,7 @@ int fatfs_format(const char *dev, int sectors, int option)
|
||||
INT32 index;
|
||||
FRESULT res;
|
||||
INT32 ret;
|
||||
MKFS_PARM opt = {0};
|
||||
|
||||
if (dev == NULL) {
|
||||
errno = EFAULT;
|
||||
@@ -1458,7 +1459,9 @@ int fatfs_format(const char *dev, int sectors, int option)
|
||||
goto OUT;
|
||||
}
|
||||
|
||||
res = f_mkfs(dev, option, sectors, g_workBuffer, FF_MAX_SS);
|
||||
opt.n_sect = sectors;
|
||||
opt.fmt = (BYTE)option;
|
||||
res = f_mkfs(dev, &opt, g_workBuffer, FF_MAX_SS);
|
||||
if (res != FR_OK) {
|
||||
errno = FatfsErrno(res);
|
||||
ret = FS_FAILURE;
|
||||
|
||||
@@ -32,6 +32,8 @@
|
||||
#define _GNU_SOURCE 1
|
||||
#include "lfs_api.h"
|
||||
#include "los_config.h"
|
||||
#include "los_mux.h"
|
||||
#include "los_debug.h"
|
||||
#include "securec.h"
|
||||
|
||||
lfs_t g_lfs;
|
||||
@@ -40,29 +42,41 @@ FileDirInfo g_lfsDir[LFS_MAX_OPEN_DIRS] = {0};
|
||||
struct FileOpInfo g_fsOp[LOSCFG_LFS_MAX_MOUNT_SIZE] = {0};
|
||||
static LittleFsHandleStruct g_handle[LITTLE_FS_MAX_OPEN_FILES] = {0};
|
||||
struct dirent g_nameValue;
|
||||
static pthread_mutex_t g_FslocalMutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
static const char *g_littlefsMntName[LOSCFG_LFS_MAX_MOUNT_SIZE] = {"/a", "/b", "/c"};
|
||||
#define LFS_MUTEX_UNINIT (-1)
|
||||
static UINT32 g_lfsMutex = LFS_MUTEX_UNINIT;
|
||||
|
||||
static int LfsLock(void)
|
||||
{
|
||||
if (LOS_MuxPend(g_lfsMutex, LOS_WAIT_FOREVER) != LOS_OK) {
|
||||
PRINT_ERR("LfsLock failed!");
|
||||
return LOS_NOK;
|
||||
}
|
||||
|
||||
return LOS_OK;
|
||||
}
|
||||
|
||||
static void LfsUnlock(void)
|
||||
{
|
||||
(void)LOS_MuxPost(g_lfsMutex);
|
||||
}
|
||||
|
||||
LittleFsHandleStruct *LfsAllocFd(const char *fileName, int *fd)
|
||||
{
|
||||
pthread_mutex_lock(&g_FslocalMutex);
|
||||
for (int i = 0; i < LITTLE_FS_MAX_OPEN_FILES; i++) {
|
||||
if (g_handle[i].useFlag == 0) {
|
||||
*fd = i;
|
||||
g_handle[i].useFlag = 1;
|
||||
g_handle[i].pathName = strdup(fileName);
|
||||
pthread_mutex_unlock(&g_FslocalMutex);
|
||||
return &(g_handle[i]);
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&g_FslocalMutex);
|
||||
*fd = INVALID_FD;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void LfsFreeFd(int fd)
|
||||
{
|
||||
pthread_mutex_lock(&g_FslocalMutex);
|
||||
g_handle[fd].useFlag = 0;
|
||||
if (g_handle[fd].pathName != NULL) {
|
||||
free((void *)g_handle[fd].pathName);
|
||||
@@ -72,21 +86,17 @@ static void LfsFreeFd(int fd)
|
||||
if (g_handle[fd].lfsHandle != NULL) {
|
||||
g_handle[fd].lfsHandle = NULL;
|
||||
}
|
||||
pthread_mutex_unlock(&g_FslocalMutex);
|
||||
}
|
||||
|
||||
BOOL CheckFileIsOpen(const char *fileName)
|
||||
{
|
||||
pthread_mutex_lock(&g_FslocalMutex);
|
||||
for (int i = 0; i < LITTLE_FS_MAX_OPEN_FILES; i++) {
|
||||
if (g_handle[i].useFlag == 1) {
|
||||
if (strcmp(g_handle[i].pathName, fileName) == 0) {
|
||||
pthread_mutex_unlock(&g_FslocalMutex);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&g_FslocalMutex);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -103,22 +113,18 @@ static BOOL LfsFdIsValid(int fd)
|
||||
|
||||
FileDirInfo *GetFreeDir(const char *dirName)
|
||||
{
|
||||
pthread_mutex_lock(&g_FslocalMutex);
|
||||
for (int i = 0; i < LFS_MAX_OPEN_DIRS; i++) {
|
||||
if (g_lfsDir[i].useFlag == 0) {
|
||||
g_lfsDir[i].useFlag = 1;
|
||||
g_lfsDir[i].dirName = strdup(dirName);
|
||||
pthread_mutex_unlock(&g_FslocalMutex);
|
||||
return &(g_lfsDir[i]);
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&g_FslocalMutex);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void FreeDirInfo(const char *dirName)
|
||||
{
|
||||
pthread_mutex_lock(&g_FslocalMutex);
|
||||
for (int i = 0; i < LFS_MAX_OPEN_DIRS; i++) {
|
||||
if (g_lfsDir[i].useFlag == 1 && strcmp(g_lfsDir[i].dirName, dirName) == 0) {
|
||||
g_lfsDir[i].useFlag = 0;
|
||||
@@ -126,24 +132,19 @@ void FreeDirInfo(const char *dirName)
|
||||
free(g_lfsDir[i].dirName);
|
||||
g_lfsDir[i].dirName = NULL;
|
||||
}
|
||||
pthread_mutex_unlock(&g_FslocalMutex);
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&g_FslocalMutex);
|
||||
}
|
||||
|
||||
BOOL CheckDirIsOpen(const char *dirName)
|
||||
{
|
||||
pthread_mutex_lock(&g_FslocalMutex);
|
||||
for (int i = 0; i < LFS_MAX_OPEN_DIRS; i++) {
|
||||
if (g_lfsDir[i].useFlag == 1) {
|
||||
if (strcmp(g_lfsDir[i].dirName, dirName) == 0) {
|
||||
pthread_mutex_unlock(&g_FslocalMutex);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&g_FslocalMutex);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -165,35 +166,29 @@ BOOL CheckPathIsMounted(const char *pathName, struct FileOpInfo **fileOpInfo)
|
||||
char tmpName[LITTLEFS_MAX_LFN_LEN] = {0};
|
||||
int len = GetFirstLevelPathLen(pathName);
|
||||
|
||||
pthread_mutex_lock(&g_FslocalMutex);
|
||||
for (int i = 0; i < LOSCFG_LFS_MAX_MOUNT_SIZE; i++) {
|
||||
if (g_fsOp[i].useFlag == 1) {
|
||||
(void)strncpy_s(tmpName, LITTLEFS_MAX_LFN_LEN, pathName, len);
|
||||
if (strcmp(tmpName, g_fsOp[i].dirName) == 0) {
|
||||
*fileOpInfo = &(g_fsOp[i]);
|
||||
pthread_mutex_unlock(&g_FslocalMutex);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&g_FslocalMutex);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
struct FileOpInfo *AllocMountRes(const char* target, const struct FileOps *fileOps)
|
||||
{
|
||||
pthread_mutex_lock(&g_FslocalMutex);
|
||||
for (int i = 0; i < LOSCFG_LFS_MAX_MOUNT_SIZE; i++) {
|
||||
if (g_fsOp[i].useFlag == 0 && strcmp(target, g_littlefsMntName[i]) == 0) {
|
||||
g_fsOp[i].useFlag = 1;
|
||||
g_fsOp[i].fsVops = fileOps;
|
||||
g_fsOp[i].dirName = strdup(target);
|
||||
pthread_mutex_unlock(&g_FslocalMutex);
|
||||
return &(g_fsOp[i]);
|
||||
}
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&g_FslocalMutex);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -203,26 +198,21 @@ int SetDefaultMountPath(int pathNameIndex, const char* target)
|
||||
return VFS_ERROR;
|
||||
}
|
||||
|
||||
pthread_mutex_lock(&g_FslocalMutex);
|
||||
g_littlefsMntName[pathNameIndex] = strdup(target);
|
||||
pthread_mutex_unlock(&g_FslocalMutex);
|
||||
return VFS_OK;
|
||||
}
|
||||
|
||||
struct FileOpInfo *GetMountRes(const char *target, int *mountIndex)
|
||||
{
|
||||
pthread_mutex_lock(&g_FslocalMutex);
|
||||
for (int i = 0; i < LOSCFG_LFS_MAX_MOUNT_SIZE; i++) {
|
||||
if (g_fsOp[i].useFlag == 1) {
|
||||
if (g_fsOp[i].dirName && strcmp(target, g_fsOp[i].dirName) == 0) {
|
||||
*mountIndex = i;
|
||||
pthread_mutex_unlock(&g_FslocalMutex);
|
||||
return &(g_fsOp[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&g_FslocalMutex);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -232,33 +222,28 @@ int FreeMountResByIndex(int mountIndex)
|
||||
return VFS_ERROR;
|
||||
}
|
||||
|
||||
pthread_mutex_lock(&g_FslocalMutex);
|
||||
if (g_fsOp[mountIndex].useFlag == 1 && g_fsOp[mountIndex].dirName != NULL) {
|
||||
g_fsOp[mountIndex].useFlag = 0;
|
||||
free(g_fsOp[mountIndex].dirName);
|
||||
g_fsOp[mountIndex].dirName = NULL;
|
||||
}
|
||||
pthread_mutex_unlock(&g_FslocalMutex);
|
||||
|
||||
return VFS_OK;
|
||||
}
|
||||
|
||||
int FreeMountRes(const char *target)
|
||||
{
|
||||
pthread_mutex_lock(&g_FslocalMutex);
|
||||
for (int i = 0; i < LOSCFG_LFS_MAX_MOUNT_SIZE; i++) {
|
||||
if (g_fsOp[i].useFlag == 1) {
|
||||
if (g_fsOp[i].dirName && strcmp(target, g_fsOp[i].dirName) == 0) {
|
||||
g_fsOp[i].useFlag = 0;
|
||||
free(g_fsOp[i].dirName);
|
||||
g_fsOp[i].dirName = NULL;
|
||||
pthread_mutex_unlock(&g_FslocalMutex);
|
||||
return VFS_OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&g_FslocalMutex);
|
||||
return VFS_ERROR;
|
||||
}
|
||||
|
||||
@@ -330,6 +315,18 @@ int LfsMount(const char *source, const char *target, const char *fileSystemType,
|
||||
int ret;
|
||||
struct FileOpInfo *fileOpInfo = NULL;
|
||||
|
||||
if (g_lfsMutex == LFS_MUTEX_UNINIT) {
|
||||
if (LOS_MuxCreate(&g_lfsMutex) != LOS_OK) {
|
||||
errno = EBUSY;
|
||||
return VFS_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
if (LfsLock() != LOS_OK) {
|
||||
errno = EAGAIN;
|
||||
return VFS_ERROR;
|
||||
}
|
||||
|
||||
if (target == NULL || fileSystemType == NULL || data == NULL) {
|
||||
errno = EFAULT;
|
||||
ret = VFS_ERROR;
|
||||
@@ -370,6 +367,7 @@ int LfsMount(const char *source, const char *target, const char *fileSystemType,
|
||||
}
|
||||
|
||||
errout:
|
||||
LfsUnlock();
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -384,9 +382,15 @@ int LfsUmount(const char *target)
|
||||
return VFS_ERROR;
|
||||
}
|
||||
|
||||
if (LfsLock() != LOS_OK) {
|
||||
errno = EAGAIN;
|
||||
return VFS_ERROR;
|
||||
}
|
||||
|
||||
fileOpInfo = GetMountRes(target, &mountIndex);
|
||||
if (fileOpInfo == NULL) {
|
||||
errno = ENOENT;
|
||||
LfsUnlock();
|
||||
return VFS_ERROR;
|
||||
}
|
||||
|
||||
@@ -397,6 +401,7 @@ int LfsUmount(const char *target)
|
||||
}
|
||||
|
||||
(void)FreeMountResByIndex(mountIndex);
|
||||
LfsUnlock();
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -410,8 +415,14 @@ int LfsUnlink(const char *fileName)
|
||||
return VFS_ERROR;
|
||||
}
|
||||
|
||||
if (LfsLock() != LOS_OK) {
|
||||
errno = EAGAIN;
|
||||
return VFS_ERROR;
|
||||
}
|
||||
|
||||
if (CheckPathIsMounted(fileName, &fileOpInfo) == FALSE || fileOpInfo == NULL) {
|
||||
errno = ENOENT;
|
||||
LfsUnlock();
|
||||
return VFS_ERROR;
|
||||
}
|
||||
|
||||
@@ -421,6 +432,7 @@ int LfsUnlink(const char *fileName)
|
||||
ret = VFS_ERROR;
|
||||
}
|
||||
|
||||
LfsUnlock();
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -434,8 +446,14 @@ int LfsMkdir(const char *dirName, mode_t mode)
|
||||
return VFS_ERROR;
|
||||
}
|
||||
|
||||
if (LfsLock() != LOS_OK) {
|
||||
errno = EAGAIN;
|
||||
return VFS_ERROR;
|
||||
}
|
||||
|
||||
if (CheckPathIsMounted(dirName, &fileOpInfo) == FALSE || fileOpInfo == NULL) {
|
||||
errno = ENOENT;
|
||||
LfsUnlock();
|
||||
return VFS_ERROR;
|
||||
}
|
||||
|
||||
@@ -445,6 +463,7 @@ int LfsMkdir(const char *dirName, mode_t mode)
|
||||
ret = VFS_ERROR;
|
||||
}
|
||||
|
||||
LfsUnlock();
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -459,8 +478,14 @@ int LfsRmdir(const char *dirName)
|
||||
return VFS_ERROR;
|
||||
}
|
||||
|
||||
if (LfsLock() != LOS_OK) {
|
||||
errno = EAGAIN;
|
||||
return VFS_ERROR;
|
||||
}
|
||||
|
||||
if (CheckPathIsMounted(dirName, &fileOpInfo) == FALSE || fileOpInfo == NULL) {
|
||||
errno = ENOENT;
|
||||
LfsUnlock();
|
||||
return VFS_ERROR;
|
||||
}
|
||||
|
||||
@@ -470,6 +495,7 @@ int LfsRmdir(const char *dirName)
|
||||
ret = VFS_ERROR;
|
||||
}
|
||||
|
||||
LfsUnlock();
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -480,9 +506,14 @@ DIR *LfsOpendir(const char *dirName)
|
||||
|
||||
if (dirName == NULL) {
|
||||
errno = EFAULT;
|
||||
goto errout;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (LfsLock() != LOS_OK) {
|
||||
errno = EAGAIN;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (CheckPathIsMounted(dirName, &fileOpInfo) == FALSE || fileOpInfo == NULL) {
|
||||
errno = ENOENT;
|
||||
goto errout;
|
||||
@@ -509,9 +540,11 @@ DIR *LfsOpendir(const char *dirName)
|
||||
|
||||
dirInfo->lfsHandle = &(fileOpInfo->lfsInfo);
|
||||
|
||||
LfsUnlock();
|
||||
return (DIR *)dirInfo;
|
||||
|
||||
errout:
|
||||
LfsUnlock();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -527,9 +560,13 @@ struct dirent *LfsReaddir(DIR *dir)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (LfsLock() != LOS_OK) {
|
||||
errno = EAGAIN;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ret = lfs_dir_read(dirInfo->lfsHandle, (lfs_dir_t *)(&(dirInfo->dir)), &lfsInfo);
|
||||
if (ret == TRUE) {
|
||||
pthread_mutex_lock(&g_FslocalMutex);
|
||||
(void)strncpy_s(g_nameValue.d_name, sizeof(g_nameValue.d_name), lfsInfo.name, strlen(lfsInfo.name) + 1);
|
||||
if (lfsInfo.type == LFS_TYPE_DIR) {
|
||||
g_nameValue.d_type = DT_DIR;
|
||||
@@ -538,8 +575,7 @@ struct dirent *LfsReaddir(DIR *dir)
|
||||
}
|
||||
|
||||
g_nameValue.d_reclen = lfsInfo.size;
|
||||
pthread_mutex_unlock(&g_FslocalMutex);
|
||||
|
||||
LfsUnlock();
|
||||
return &g_nameValue;
|
||||
}
|
||||
|
||||
@@ -547,6 +583,7 @@ struct dirent *LfsReaddir(DIR *dir)
|
||||
errno = LittlefsErrno(ret);
|
||||
}
|
||||
|
||||
LfsUnlock();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -560,6 +597,11 @@ int LfsClosedir(DIR *dir)
|
||||
return VFS_ERROR;
|
||||
}
|
||||
|
||||
if (LfsLock() != LOS_OK) {
|
||||
errno = EAGAIN;
|
||||
return VFS_ERROR;
|
||||
}
|
||||
|
||||
ret = lfs_dir_close(dirInfo->lfsHandle, (lfs_dir_t *)(&(dirInfo->dir)));
|
||||
|
||||
FreeDirInfo(dirInfo->dirName);
|
||||
@@ -569,6 +611,7 @@ int LfsClosedir(DIR *dir)
|
||||
ret = VFS_ERROR;
|
||||
}
|
||||
|
||||
LfsUnlock();
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -581,9 +624,14 @@ int LfsOpen(const char *pathName, int openFlag, int mode)
|
||||
|
||||
if (pathName == NULL) {
|
||||
errno = EFAULT;
|
||||
goto errout;
|
||||
return INVALID_FD;
|
||||
}
|
||||
|
||||
if (LfsLock() != LOS_OK) {
|
||||
errno = EAGAIN;
|
||||
return VFS_ERROR;
|
||||
}
|
||||
|
||||
if (CheckPathIsMounted(pathName, &fileOpInfo) == FALSE || fileOpInfo == NULL) {
|
||||
errno = ENOENT;
|
||||
goto errout;
|
||||
@@ -609,9 +657,11 @@ int LfsOpen(const char *pathName, int openFlag, int mode)
|
||||
}
|
||||
|
||||
g_handle[fd].lfsHandle = &(fileOpInfo->lfsInfo);
|
||||
LfsUnlock();
|
||||
return fd;
|
||||
|
||||
errout:
|
||||
LfsUnlock();
|
||||
return INVALID_FD;
|
||||
}
|
||||
|
||||
@@ -624,8 +674,14 @@ int LfsRead(int fd, void *buf, unsigned int len)
|
||||
return VFS_ERROR;
|
||||
}
|
||||
|
||||
if (LfsLock() != LOS_OK) {
|
||||
errno = EAGAIN;
|
||||
return VFS_ERROR;
|
||||
}
|
||||
|
||||
if (LfsFdIsValid(fd) == FALSE) {
|
||||
errno = EBADF;
|
||||
LfsUnlock();
|
||||
return VFS_ERROR;
|
||||
}
|
||||
|
||||
@@ -634,6 +690,7 @@ int LfsRead(int fd, void *buf, unsigned int len)
|
||||
errno = LittlefsErrno(ret);
|
||||
ret = VFS_ERROR;
|
||||
}
|
||||
LfsUnlock();
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -646,8 +703,14 @@ int LfsWrite(int fd, const void *buf, unsigned int len)
|
||||
return VFS_ERROR;
|
||||
}
|
||||
|
||||
if (LfsLock() != LOS_OK) {
|
||||
errno = EAGAIN;
|
||||
return VFS_ERROR;
|
||||
}
|
||||
|
||||
if (LfsFdIsValid(fd) == FALSE) {
|
||||
errno = EBADF;
|
||||
LfsUnlock();
|
||||
return VFS_ERROR;
|
||||
}
|
||||
|
||||
@@ -656,6 +719,7 @@ int LfsWrite(int fd, const void *buf, unsigned int len)
|
||||
errno = LittlefsErrno(ret);
|
||||
ret = VFS_ERROR;
|
||||
}
|
||||
LfsUnlock();
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -663,8 +727,14 @@ off_t LfsSeek(int fd, off_t offset, int whence)
|
||||
{
|
||||
off_t ret;
|
||||
|
||||
if (LfsLock() != LOS_OK) {
|
||||
errno = EAGAIN;
|
||||
return VFS_ERROR;
|
||||
}
|
||||
|
||||
if (LfsFdIsValid(fd) == FALSE) {
|
||||
errno = EBADF;
|
||||
LfsUnlock();
|
||||
return VFS_ERROR;
|
||||
}
|
||||
|
||||
@@ -674,6 +744,7 @@ off_t LfsSeek(int fd, off_t offset, int whence)
|
||||
ret = VFS_ERROR;
|
||||
}
|
||||
|
||||
LfsUnlock();
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -681,14 +752,18 @@ int LfsClose(int fd)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (LfsLock() != LOS_OK) {
|
||||
errno = EAGAIN;
|
||||
return VFS_ERROR;
|
||||
}
|
||||
|
||||
if (LfsFdIsValid(fd) == FALSE) {
|
||||
errno = EBADF;
|
||||
LfsUnlock();
|
||||
return VFS_ERROR;
|
||||
}
|
||||
|
||||
pthread_mutex_lock(&g_FslocalMutex);
|
||||
ret = lfs_file_close(g_handle[fd].lfsHandle, &(g_handle[fd].file));
|
||||
pthread_mutex_unlock(&g_FslocalMutex);
|
||||
|
||||
LfsFreeFd(fd);
|
||||
|
||||
@@ -696,7 +771,7 @@ int LfsClose(int fd)
|
||||
errno = LittlefsErrno(ret);
|
||||
ret = VFS_ERROR;
|
||||
}
|
||||
|
||||
LfsUnlock();
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -710,8 +785,14 @@ int LfsRename(const char *oldName, const char *newName)
|
||||
return VFS_ERROR;
|
||||
}
|
||||
|
||||
if (LfsLock() != LOS_OK) {
|
||||
errno = EAGAIN;
|
||||
return VFS_ERROR;
|
||||
}
|
||||
|
||||
if (CheckPathIsMounted(oldName, &fileOpInfo) == FALSE || fileOpInfo == NULL) {
|
||||
errno = ENOENT;
|
||||
LfsUnlock();
|
||||
return VFS_ERROR;
|
||||
}
|
||||
|
||||
@@ -721,6 +802,7 @@ int LfsRename(const char *oldName, const char *newName)
|
||||
ret = VFS_ERROR;
|
||||
}
|
||||
|
||||
LfsUnlock();
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -735,8 +817,14 @@ int LfsStat(const char *path, struct stat *buf)
|
||||
return VFS_ERROR;
|
||||
}
|
||||
|
||||
if (LfsLock() != LOS_OK) {
|
||||
errno = EAGAIN;
|
||||
return VFS_ERROR;
|
||||
}
|
||||
|
||||
if (CheckPathIsMounted(path, &fileOpInfo) == FALSE || fileOpInfo == NULL) {
|
||||
errno = ENOENT;
|
||||
LfsUnlock();
|
||||
return VFS_ERROR;
|
||||
}
|
||||
|
||||
@@ -752,7 +840,7 @@ int LfsStat(const char *path, struct stat *buf)
|
||||
errno = LittlefsErrno(ret);
|
||||
ret = VFS_ERROR;
|
||||
}
|
||||
|
||||
LfsUnlock();
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -760,8 +848,14 @@ int LfsFsync(int fd)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (LfsLock() != LOS_OK) {
|
||||
errno = EAGAIN;
|
||||
return VFS_ERROR;
|
||||
}
|
||||
|
||||
if (LfsFdIsValid(fd) == FALSE) {
|
||||
errno = EBADF;
|
||||
LfsUnlock();
|
||||
return VFS_ERROR;
|
||||
}
|
||||
|
||||
@@ -770,5 +864,6 @@ int LfsFsync(int fd)
|
||||
errno = LittlefsErrno(ret);
|
||||
ret = VFS_ERROR;
|
||||
}
|
||||
LfsUnlock();
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
#include "lfs.h"
|
||||
#include "lfs_util.h"
|
||||
#include "memory.h"
|
||||
#include "pthread.h"
|
||||
|
||||
#define INVALID_FD (-1)
|
||||
|
||||
|
||||
@@ -588,7 +588,6 @@ u32_t OsShellPing(int argc, const char **argv)
|
||||
stPingTask.uwArg = (UINTPTR)parg;
|
||||
ret = LOS_TaskCreate((UINT32 *)(&ping_taskid), &stPingTask);
|
||||
if (ret != LOS_OK) {
|
||||
free(parg);
|
||||
PRINTK("ping_task create failed 0x%08x.\n", ret);
|
||||
count = LWIP_SHELL_CMD_PING_RETRY_TIMES;
|
||||
} else {
|
||||
@@ -604,6 +603,8 @@ u32_t OsShellPing(int argc, const char **argv)
|
||||
PRINTK("Ping cmd failed due some errors\n");
|
||||
}
|
||||
|
||||
free(parg);
|
||||
|
||||
return LOS_OK;
|
||||
ping_error:
|
||||
lwip_ping_usage();
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
#define OS_INT_STATUS_ADDR (OS_INT_REG_BASE + 12)
|
||||
|
||||
#define OS_INT_ENABLE(num) (*((volatile UINT32 *)OS_INT_ENABLE_ADDR) |= (1U << (num)))
|
||||
#define OS_INT_DISABLE(num) (*((volatile UINT32 *)OS_INT_ENABLE_ADDR ) &= ~(1U << (num)))
|
||||
#define OS_INT_DISABLE(num) (*((volatile UINT32 *)OS_INT_ENABLE_ADDR) &= ~(1U << (num)))
|
||||
|
||||
#define OS_INSTR_SET_MASK 0x01000020U
|
||||
#define OS_ARM_INSTR_LEN 4
|
||||
@@ -123,7 +123,7 @@ LITE_OS_SEC_TEXT_MINOR UINT32 HalIntNumGet(VOID)
|
||||
UINT32 status;
|
||||
|
||||
READ_UINT32(status, OS_INT_STATUS_ADDR);
|
||||
return (31 - CLZ(status));
|
||||
return (31 - CLZ(status)); /* 31 bit map of int */
|
||||
}
|
||||
|
||||
inline UINT32 HalIsIntActive(VOID)
|
||||
@@ -140,8 +140,7 @@ inline UINT32 HalIsIntActive(VOID)
|
||||
/*lint -e529*/
|
||||
LITE_OS_SEC_TEXT_MINOR VOID HalHwiDefaultHandler(VOID)
|
||||
{
|
||||
UINT32 irqNum = HalIntNumGet();
|
||||
PRINT_ERR("%s irqnum:%d\n", __FUNCTION__, irqNum);
|
||||
PRINT_ERR("%s irqnum:%u\n", __FUNCTION__, HalIntNumGet());
|
||||
while (1) {}
|
||||
}
|
||||
|
||||
@@ -272,8 +271,8 @@ STATIC VOID OsExcTypeInfo(const ExcInfo *excInfo)
|
||||
{
|
||||
CHAR *phaseStr[] = {"exc in init", "exc in task", "exc in hwi"};
|
||||
|
||||
PRINTK("Type = %d\n", excInfo->type);
|
||||
PRINTK("ThrdPid = %d\n", excInfo->thrdPid);
|
||||
PRINTK("Type = %u\n", excInfo->type);
|
||||
PRINTK("ThrdPid = %u\n", excInfo->thrdPid);
|
||||
PRINTK("Phase = %s\n", phaseStr[excInfo->phase]);
|
||||
PRINTK("FaultAddr = 0x%x\n", excInfo->faultAddr);
|
||||
}
|
||||
@@ -284,7 +283,7 @@ STATIC VOID OsExcCurTaskInfo(const ExcInfo *excInfo)
|
||||
if (excInfo->phase == OS_EXC_IN_TASK) {
|
||||
LosTaskCB *taskCB = OS_TCB_FROM_TID(LOS_CurTaskIDGet());
|
||||
PRINTK("Task name = %s\n", taskCB->taskName);
|
||||
PRINTK("Task ID = %d\n", taskCB->taskID);
|
||||
PRINTK("Task ID = %u\n", taskCB->taskID);
|
||||
PRINTK("Task SP = 0x%x\n", taskCB->stackPointer);
|
||||
PRINTK("Task ST = 0x%x\n", taskCB->topOfStack);
|
||||
PRINTK("Task SS = 0x%x\n", taskCB->stackSize);
|
||||
@@ -328,7 +327,7 @@ STATIC VOID OsExcBackTraceInfo(const ExcInfo *excInfo)
|
||||
if (LR[index] == 0) {
|
||||
break;
|
||||
}
|
||||
PRINTK("backtrace %d -- lr = 0x%x\n", index, LR[index]);
|
||||
PRINTK("backtrace %u -- lr = 0x%x\n", index, LR[index]);
|
||||
}
|
||||
PRINTK("----- backtrace end -----\n");
|
||||
}
|
||||
@@ -354,15 +353,15 @@ STATIC VOID OsExcMemPoolCheckInfo(VOID)
|
||||
}
|
||||
|
||||
for (i = 0; i < errCnt; i++) {
|
||||
PRINTK("pool num = %d\n", i);
|
||||
PRINTK("pool num = %u\n", i);
|
||||
PRINTK("pool type = %d\n", memExcInfo[i].type);
|
||||
PRINTK("pool addr = 0x%x\n", memExcInfo[i].startAddr);
|
||||
PRINTK("pool size = 0x%x\n", memExcInfo[i].size);
|
||||
PRINTK("pool free = 0x%x\n", memExcInfo[i].free);
|
||||
PRINTK("pool blkNum = %d\n", memExcInfo[i].blockSize);
|
||||
PRINTK("pool blkNum = %u\n", memExcInfo[i].blockSize);
|
||||
PRINTK("pool error node addr = 0x%x\n", memExcInfo[i].errorAddr);
|
||||
PRINTK("pool error node len = 0x%x\n", memExcInfo[i].errorLen);
|
||||
PRINTK("pool error node owner = %d\n", memExcInfo[i].errorOwner);
|
||||
PRINTK("pool error node owner = %u\n", memExcInfo[i].errorOwner);
|
||||
}
|
||||
#endif
|
||||
UINT32 ret = LOS_MemIntegrityCheck(LOSCFG_SYS_HEAP_ADDR);
|
||||
|
||||
@@ -133,8 +133,7 @@ inline UINT32 HalIsIntActive(VOID)
|
||||
/*lint -e529*/
|
||||
LITE_OS_SEC_TEXT_MINOR VOID HalHwiDefaultHandler(VOID)
|
||||
{
|
||||
UINT32 irqNum = HalIntNumGet();
|
||||
PRINT_ERR("%s irqnum:%d\n", __FUNCTION__, irqNum);
|
||||
PRINT_ERR("%s irqnum:%u\n", __FUNCTION__, HalIntNumGet());
|
||||
while (1) {}
|
||||
}
|
||||
|
||||
@@ -332,8 +331,8 @@ STATIC VOID OsExcTypeInfo(const ExcInfo *excInfo)
|
||||
{
|
||||
CHAR *phaseStr[] = {"exc in init", "exc in task", "exc in hwi"};
|
||||
|
||||
PRINTK("Type = %d\n", excInfo->type);
|
||||
PRINTK("ThrdPid = %d\n", excInfo->thrdPid);
|
||||
PRINTK("Type = %u\n", excInfo->type);
|
||||
PRINTK("ThrdPid = %u\n", excInfo->thrdPid);
|
||||
PRINTK("Phase = %s\n", phaseStr[excInfo->phase]);
|
||||
PRINTK("FaultAddr = 0x%x\n", excInfo->faultAddr);
|
||||
}
|
||||
@@ -344,7 +343,7 @@ STATIC VOID OsExcCurTaskInfo(const ExcInfo *excInfo)
|
||||
if (excInfo->phase == OS_EXC_IN_TASK) {
|
||||
LosTaskCB *taskCB = OS_TCB_FROM_TID(LOS_CurTaskIDGet());
|
||||
PRINTK("Task name = %s\n", taskCB->taskName);
|
||||
PRINTK("Task ID = %d\n", taskCB->taskID);
|
||||
PRINTK("Task ID = %u\n", taskCB->taskID);
|
||||
PRINTK("Task SP = %p\n", taskCB->stackPointer);
|
||||
PRINTK("Task ST = 0x%x\n", taskCB->topOfStack);
|
||||
PRINTK("Task SS = 0x%x\n", taskCB->stackSize);
|
||||
@@ -390,7 +389,7 @@ STATIC VOID OsExcBackTraceInfo(const ExcInfo *excInfo)
|
||||
if (LR[index] == 0) {
|
||||
break;
|
||||
}
|
||||
PRINTK("backtrace %d -- lr = 0x%x\n", index, LR[index]);
|
||||
PRINTK("backtrace %u -- lr = 0x%x\n", index, LR[index]);
|
||||
}
|
||||
PRINTK("----- backtrace end -----\n");
|
||||
}
|
||||
@@ -416,15 +415,15 @@ STATIC VOID OsExcMemPoolCheckInfo(VOID)
|
||||
}
|
||||
|
||||
for (i = 0; i < errCnt; i++) {
|
||||
PRINTK("pool num = %d\n", i);
|
||||
PRINTK("pool num = %u\n", i);
|
||||
PRINTK("pool type = %d\n", memExcInfo[i].type);
|
||||
PRINTK("pool addr = 0x%x\n", memExcInfo[i].startAddr);
|
||||
PRINTK("pool size = 0x%x\n", memExcInfo[i].size);
|
||||
PRINTK("pool free = 0x%x\n", memExcInfo[i].free);
|
||||
PRINTK("pool blkNum = %d\n", memExcInfo[i].blockSize);
|
||||
PRINTK("pool blkNum = %u\n", memExcInfo[i].blockSize);
|
||||
PRINTK("pool error node addr = 0x%x\n", memExcInfo[i].errorAddr);
|
||||
PRINTK("pool error node len = 0x%x\n", memExcInfo[i].errorLen);
|
||||
PRINTK("pool error node owner = %d\n", memExcInfo[i].errorOwner);
|
||||
PRINTK("pool error node owner = %u\n", memExcInfo[i].errorOwner);
|
||||
}
|
||||
#endif
|
||||
UINT32 ret = LOS_MemIntegrityCheck(LOSCFG_SYS_HEAP_ADDR);
|
||||
|
||||
@@ -123,8 +123,7 @@ inline UINT32 HalIsIntActive(VOID)
|
||||
/*lint -e529*/
|
||||
LITE_OS_SEC_TEXT_MINOR VOID HalHwiDefaultHandler(VOID)
|
||||
{
|
||||
UINT32 irqNum = HalIntNumGet();
|
||||
PRINT_ERR("%s irqnum:%d\n", __FUNCTION__, irqNum);
|
||||
PRINT_ERR("%s irqnum:%u\n", __FUNCTION__, HalIntNumGet());
|
||||
while (1) {}
|
||||
}
|
||||
|
||||
@@ -322,8 +321,8 @@ STATIC VOID OsExcTypeInfo(const ExcInfo *excInfo)
|
||||
{
|
||||
CHAR *phaseStr[] = {"exc in init", "exc in task", "exc in hwi"};
|
||||
|
||||
PRINTK("Type = %d\n", excInfo->type);
|
||||
PRINTK("ThrdPid = %d\n", excInfo->thrdPid);
|
||||
PRINTK("Type = %u\n", excInfo->type);
|
||||
PRINTK("ThrdPid = %u\n", excInfo->thrdPid);
|
||||
PRINTK("Phase = %s\n", phaseStr[excInfo->phase]);
|
||||
PRINTK("FaultAddr = 0x%x\n", excInfo->faultAddr);
|
||||
}
|
||||
@@ -334,7 +333,7 @@ STATIC VOID OsExcCurTaskInfo(const ExcInfo *excInfo)
|
||||
if (excInfo->phase == OS_EXC_IN_TASK) {
|
||||
LosTaskCB *taskCB = OS_TCB_FROM_TID(LOS_CurTaskIDGet());
|
||||
PRINTK("Task name = %s\n", taskCB->taskName);
|
||||
PRINTK("Task ID = %d\n", taskCB->taskID);
|
||||
PRINTK("Task ID = %u\n", taskCB->taskID);
|
||||
PRINTK("Task SP = %p\n", taskCB->stackPointer);
|
||||
PRINTK("Task ST = 0x%x\n", taskCB->topOfStack);
|
||||
PRINTK("Task SS = 0x%x\n", taskCB->stackSize);
|
||||
@@ -380,7 +379,7 @@ STATIC VOID OsExcBackTraceInfo(const ExcInfo *excInfo)
|
||||
if (LR[index] == 0) {
|
||||
break;
|
||||
}
|
||||
PRINTK("backtrace %d -- lr = 0x%x\n", index, LR[index]);
|
||||
PRINTK("backtrace %u -- lr = 0x%x\n", index, LR[index]);
|
||||
}
|
||||
PRINTK("----- backtrace end -----\n");
|
||||
}
|
||||
@@ -406,15 +405,15 @@ STATIC VOID OsExcMemPoolCheckInfo(VOID)
|
||||
}
|
||||
|
||||
for (i = 0; i < errCnt; i++) {
|
||||
PRINTK("pool num = %d\n", i);
|
||||
PRINTK("pool num = %u\n", i);
|
||||
PRINTK("pool type = %d\n", memExcInfo[i].type);
|
||||
PRINTK("pool addr = 0x%x\n", memExcInfo[i].startAddr);
|
||||
PRINTK("pool size = 0x%x\n", memExcInfo[i].size);
|
||||
PRINTK("pool free = 0x%x\n", memExcInfo[i].free);
|
||||
PRINTK("pool blkNum = %d\n", memExcInfo[i].blockSize);
|
||||
PRINTK("pool blkNum = %u\n", memExcInfo[i].blockSize);
|
||||
PRINTK("pool error node addr = 0x%x\n", memExcInfo[i].errorAddr);
|
||||
PRINTK("pool error node len = 0x%x\n", memExcInfo[i].errorLen);
|
||||
PRINTK("pool error node owner = %d\n", memExcInfo[i].errorOwner);
|
||||
PRINTK("pool error node owner = %u\n", memExcInfo[i].errorOwner);
|
||||
}
|
||||
#endif
|
||||
UINT32 ret = LOS_MemIntegrityCheck(LOSCFG_SYS_HEAP_ADDR);
|
||||
|
||||
@@ -123,8 +123,7 @@ inline UINT32 HalIsIntActive(VOID)
|
||||
/*lint -e529*/
|
||||
LITE_OS_SEC_TEXT_MINOR VOID HalHwiDefaultHandler(VOID)
|
||||
{
|
||||
UINT32 irqNum = HalIntNumGet();
|
||||
PRINT_ERR("%s irqnum:%d\n", __FUNCTION__, irqNum);
|
||||
PRINT_ERR("%s irqnum:%u\n", __FUNCTION__, HalIntNumGet());
|
||||
while (1) {}
|
||||
}
|
||||
|
||||
@@ -322,8 +321,8 @@ STATIC VOID OsExcTypeInfo(const ExcInfo *excInfo)
|
||||
{
|
||||
CHAR *phaseStr[] = {"exc in init", "exc in task", "exc in hwi"};
|
||||
|
||||
PRINTK("Type = %d\n", excInfo->type);
|
||||
PRINTK("ThrdPid = %d\n", excInfo->thrdPid);
|
||||
PRINTK("Type = %u\n", excInfo->type);
|
||||
PRINTK("ThrdPid = %u\n", excInfo->thrdPid);
|
||||
PRINTK("Phase = %s\n", phaseStr[excInfo->phase]);
|
||||
PRINTK("FaultAddr = 0x%x\n", excInfo->faultAddr);
|
||||
}
|
||||
@@ -334,7 +333,7 @@ STATIC VOID OsExcCurTaskInfo(const ExcInfo *excInfo)
|
||||
if (excInfo->phase == OS_EXC_IN_TASK) {
|
||||
LosTaskCB *taskCB = OS_TCB_FROM_TID(LOS_CurTaskIDGet());
|
||||
PRINTK("Task name = %s\n", taskCB->taskName);
|
||||
PRINTK("Task ID = %d\n", taskCB->taskID);
|
||||
PRINTK("Task ID = %u\n", taskCB->taskID);
|
||||
PRINTK("Task SP = %p\n", taskCB->stackPointer);
|
||||
PRINTK("Task ST = 0x%x\n", taskCB->topOfStack);
|
||||
PRINTK("Task SS = 0x%x\n", taskCB->stackSize);
|
||||
@@ -380,7 +379,7 @@ STATIC VOID OsExcBackTraceInfo(const ExcInfo *excInfo)
|
||||
if (LR[index] == 0) {
|
||||
break;
|
||||
}
|
||||
PRINTK("backtrace %d -- lr = 0x%x\n", index, LR[index]);
|
||||
PRINTK("backtrace %u -- lr = 0x%x\n", index, LR[index]);
|
||||
}
|
||||
PRINTK("----- backtrace end -----\n");
|
||||
}
|
||||
@@ -406,15 +405,15 @@ STATIC VOID OsExcMemPoolCheckInfo(VOID)
|
||||
}
|
||||
|
||||
for (i = 0; i < errCnt; i++) {
|
||||
PRINTK("pool num = %d\n", i);
|
||||
PRINTK("pool num = %u\n", i);
|
||||
PRINTK("pool type = %d\n", memExcInfo[i].type);
|
||||
PRINTK("pool addr = 0x%x\n", memExcInfo[i].startAddr);
|
||||
PRINTK("pool size = 0x%x\n", memExcInfo[i].size);
|
||||
PRINTK("pool free = 0x%x\n", memExcInfo[i].free);
|
||||
PRINTK("pool blkNum = %d\n", memExcInfo[i].blockSize);
|
||||
PRINTK("pool blkNum = %u\n", memExcInfo[i].blockSize);
|
||||
PRINTK("pool error node addr = 0x%x\n", memExcInfo[i].errorAddr);
|
||||
PRINTK("pool error node len = 0x%x\n", memExcInfo[i].errorLen);
|
||||
PRINTK("pool error node owner = %d\n", memExcInfo[i].errorOwner);
|
||||
PRINTK("pool error node owner = %u\n", memExcInfo[i].errorOwner);
|
||||
}
|
||||
#endif
|
||||
UINT32 ret = LOS_MemIntegrityCheck(LOSCFG_SYS_HEAP_ADDR);
|
||||
@@ -489,7 +488,7 @@ LITE_OS_SEC_TEXT_INIT VOID HalHwiInit()
|
||||
UINT32 index;
|
||||
g_hwiForm[0] = 0; /* [0] Top of Stack */
|
||||
g_hwiForm[1] = 0; /* [1] reset */
|
||||
for (index = 2; index < OS_VECTOR_CNT; index++) {
|
||||
for (index = 2; index < OS_VECTOR_CNT; index++) { /* 2 Default hw handler stack start from index 2 */
|
||||
g_hwiForm[index] = (HWI_PROC_FUNC)HalHwiDefaultHandler;
|
||||
}
|
||||
/* Exception handler register */
|
||||
|
||||
@@ -123,8 +123,7 @@ inline UINT32 HalIsIntActive(VOID)
|
||||
/*lint -e529*/
|
||||
LITE_OS_SEC_TEXT_MINOR VOID HalHwiDefaultHandler(VOID)
|
||||
{
|
||||
UINT32 irqNum = HalIntNumGet();
|
||||
PRINT_ERR("%s irqnum:%d\n", __FUNCTION__, irqNum);
|
||||
PRINT_ERR("%s irqnum:%u\n", __FUNCTION__, HalIntNumGet());
|
||||
while (1) {}
|
||||
}
|
||||
|
||||
@@ -322,8 +321,8 @@ STATIC VOID OsExcTypeInfo(const ExcInfo *excInfo)
|
||||
{
|
||||
CHAR *phaseStr[] = {"exc in init", "exc in task", "exc in hwi"};
|
||||
|
||||
PRINTK("Type = %d\n", excInfo->type);
|
||||
PRINTK("ThrdPid = %d\n", excInfo->thrdPid);
|
||||
PRINTK("Type = %u\n", excInfo->type);
|
||||
PRINTK("ThrdPid = %u\n", excInfo->thrdPid);
|
||||
PRINTK("Phase = %s\n", phaseStr[excInfo->phase]);
|
||||
PRINTK("FaultAddr = 0x%x\n", excInfo->faultAddr);
|
||||
}
|
||||
@@ -334,7 +333,7 @@ STATIC VOID OsExcCurTaskInfo(const ExcInfo *excInfo)
|
||||
if (excInfo->phase == OS_EXC_IN_TASK) {
|
||||
LosTaskCB *taskCB = OS_TCB_FROM_TID(LOS_CurTaskIDGet());
|
||||
PRINTK("Task name = %s\n", taskCB->taskName);
|
||||
PRINTK("Task ID = %d\n", taskCB->taskID);
|
||||
PRINTK("Task ID = %u\n", taskCB->taskID);
|
||||
PRINTK("Task SP = %p\n", taskCB->stackPointer);
|
||||
PRINTK("Task ST = 0x%x\n", taskCB->topOfStack);
|
||||
PRINTK("Task SS = 0x%x\n", taskCB->stackSize);
|
||||
@@ -380,7 +379,7 @@ STATIC VOID OsExcBackTraceInfo(const ExcInfo *excInfo)
|
||||
if (LR[index] == 0) {
|
||||
break;
|
||||
}
|
||||
PRINTK("backtrace %d -- lr = 0x%x\n", index, LR[index]);
|
||||
PRINTK("backtrace %u -- lr = 0x%x\n", index, LR[index]);
|
||||
}
|
||||
PRINTK("----- backtrace end -----\n");
|
||||
}
|
||||
@@ -406,15 +405,15 @@ STATIC VOID OsExcMemPoolCheckInfo(VOID)
|
||||
}
|
||||
|
||||
for (i = 0; i < errCnt; i++) {
|
||||
PRINTK("pool num = %d\n", i);
|
||||
PRINTK("pool num = %u\n", i);
|
||||
PRINTK("pool type = %d\n", memExcInfo[i].type);
|
||||
PRINTK("pool addr = 0x%x\n", memExcInfo[i].startAddr);
|
||||
PRINTK("pool size = 0x%x\n", memExcInfo[i].size);
|
||||
PRINTK("pool free = 0x%x\n", memExcInfo[i].free);
|
||||
PRINTK("pool blkNum = %d\n", memExcInfo[i].blockSize);
|
||||
PRINTK("pool blkNum = %u\n", memExcInfo[i].blockSize);
|
||||
PRINTK("pool error node addr = 0x%x\n", memExcInfo[i].errorAddr);
|
||||
PRINTK("pool error node len = 0x%x\n", memExcInfo[i].errorLen);
|
||||
PRINTK("pool error node owner = %d\n", memExcInfo[i].errorOwner);
|
||||
PRINTK("pool error node owner = %u\n", memExcInfo[i].errorOwner);
|
||||
}
|
||||
#endif
|
||||
UINT32 ret = LOS_MemIntegrityCheck(LOSCFG_SYS_HEAP_ADDR);
|
||||
@@ -489,7 +488,7 @@ LITE_OS_SEC_TEXT_INIT VOID HalHwiInit()
|
||||
UINT32 index;
|
||||
g_hwiForm[0] = 0; /* [0] Top of Stack */
|
||||
g_hwiForm[1] = 0; /* [1] reset */
|
||||
for (index = 2; index < OS_VECTOR_CNT; index++) {
|
||||
for (index = 2; index < OS_VECTOR_CNT; index++) { /* 2: The starting position of the interrupt */
|
||||
g_hwiForm[index] = (HWI_PROC_FUNC)HalHwiDefaultHandler;
|
||||
}
|
||||
/* Exception handler register */
|
||||
|
||||
@@ -130,8 +130,7 @@ inline UINT32 HalIsIntActive(VOID)
|
||||
/*lint -e529*/
|
||||
LITE_OS_SEC_TEXT_MINOR VOID HalHwiDefaultHandler(VOID)
|
||||
{
|
||||
UINT32 irqNum = HalIntNumGet();
|
||||
PRINT_ERR("%s irqnum:%d\n", __FUNCTION__, irqNum);
|
||||
PRINT_ERR("%s irqnum:%u\n", __FUNCTION__, HalIntNumGet());
|
||||
while (1) {}
|
||||
}
|
||||
|
||||
@@ -330,8 +329,8 @@ STATIC VOID OsExcTypeInfo(const ExcInfo *excInfo)
|
||||
{
|
||||
CHAR *phaseStr[] = {"exc in init", "exc in task", "exc in hwi"};
|
||||
|
||||
PRINTK("Type = %d\n", excInfo->type);
|
||||
PRINTK("ThrdPid = %d\n", excInfo->thrdPid);
|
||||
PRINTK("Type = %u\n", excInfo->type);
|
||||
PRINTK("ThrdPid = %u\n", excInfo->thrdPid);
|
||||
PRINTK("Phase = %s\n", phaseStr[excInfo->phase]);
|
||||
PRINTK("FaultAddr = 0x%x\n", excInfo->faultAddr);
|
||||
}
|
||||
@@ -342,7 +341,7 @@ STATIC VOID OsExcCurTaskInfo(const ExcInfo *excInfo)
|
||||
if (excInfo->phase == OS_EXC_IN_TASK) {
|
||||
LosTaskCB *taskCB = OS_TCB_FROM_TID(LOS_CurTaskIDGet());
|
||||
PRINTK("Task name = %s\n", taskCB->taskName);
|
||||
PRINTK("Task ID = %d\n", taskCB->taskID);
|
||||
PRINTK("Task ID = %u\n", taskCB->taskID);
|
||||
PRINTK("Task SP = %p\n", taskCB->stackPointer);
|
||||
PRINTK("Task ST = 0x%x\n", taskCB->topOfStack);
|
||||
PRINTK("Task SS = 0x%x\n", taskCB->stackSize);
|
||||
@@ -388,7 +387,7 @@ STATIC VOID OsExcBackTraceInfo(const ExcInfo *excInfo)
|
||||
if (LR[index] == 0) {
|
||||
break;
|
||||
}
|
||||
PRINTK("backtrace %d -- lr = 0x%x\n", index, LR[index]);
|
||||
PRINTK("backtrace %u -- lr = 0x%x\n", index, LR[index]);
|
||||
}
|
||||
PRINTK("----- backtrace end -----\n");
|
||||
}
|
||||
@@ -414,15 +413,15 @@ STATIC VOID OsExcMemPoolCheckInfo(VOID)
|
||||
}
|
||||
|
||||
for (i = 0; i < errCnt; i++) {
|
||||
PRINTK("pool num = %d\n", i);
|
||||
PRINTK("pool num = %u\n", i);
|
||||
PRINTK("pool type = %d\n", memExcInfo[i].type);
|
||||
PRINTK("pool addr = 0x%x\n", memExcInfo[i].startAddr);
|
||||
PRINTK("pool size = 0x%x\n", memExcInfo[i].size);
|
||||
PRINTK("pool free = 0x%x\n", memExcInfo[i].free);
|
||||
PRINTK("pool blkNum = %d\n", memExcInfo[i].blockSize);
|
||||
PRINTK("pool blkNum = %u\n", memExcInfo[i].blockSize);
|
||||
PRINTK("pool error node addr = 0x%x\n", memExcInfo[i].errorAddr);
|
||||
PRINTK("pool error node len = 0x%x\n", memExcInfo[i].errorLen);
|
||||
PRINTK("pool error node owner = %d\n", memExcInfo[i].errorOwner);
|
||||
PRINTK("pool error node owner = %u\n", memExcInfo[i].errorOwner);
|
||||
}
|
||||
#endif
|
||||
UINT32 ret = LOS_MemIntegrityCheck(LOSCFG_SYS_HEAP_ADDR);
|
||||
|
||||
@@ -130,8 +130,7 @@ inline UINT32 HalIsIntActive(VOID)
|
||||
/*lint -e529*/
|
||||
LITE_OS_SEC_TEXT_MINOR VOID HalHwiDefaultHandler(VOID)
|
||||
{
|
||||
UINT32 irqNum = HalIntNumGet();
|
||||
PRINT_ERR("%s irqnum:%d\n", __FUNCTION__, irqNum);
|
||||
PRINT_ERR("%s irqnum:%d\n", __FUNCTION__, HalIntNumGet());
|
||||
while (1) {}
|
||||
}
|
||||
|
||||
@@ -330,8 +329,8 @@ STATIC VOID OsExcTypeInfo(const ExcInfo *excInfo)
|
||||
{
|
||||
CHAR *phaseStr[] = {"exc in init", "exc in task", "exc in hwi"};
|
||||
|
||||
PRINTK("Type = %d\n", excInfo->type);
|
||||
PRINTK("ThrdPid = %d\n", excInfo->thrdPid);
|
||||
PRINTK("Type = %u\n", excInfo->type);
|
||||
PRINTK("ThrdPid = %u\n", excInfo->thrdPid);
|
||||
PRINTK("Phase = %s\n", phaseStr[excInfo->phase]);
|
||||
PRINTK("FaultAddr = 0x%x\n", excInfo->faultAddr);
|
||||
}
|
||||
@@ -342,7 +341,7 @@ STATIC VOID OsExcCurTaskInfo(const ExcInfo *excInfo)
|
||||
if (excInfo->phase == OS_EXC_IN_TASK) {
|
||||
LosTaskCB *taskCB = OS_TCB_FROM_TID(LOS_CurTaskIDGet());
|
||||
PRINTK("Task name = %s\n", taskCB->taskName);
|
||||
PRINTK("Task ID = %d\n", taskCB->taskID);
|
||||
PRINTK("Task ID = %u\n", taskCB->taskID);
|
||||
PRINTK("Task SP = %p\n", taskCB->stackPointer);
|
||||
PRINTK("Task ST = 0x%x\n", taskCB->topOfStack);
|
||||
PRINTK("Task SS = 0x%x\n", taskCB->stackSize);
|
||||
@@ -388,7 +387,7 @@ STATIC VOID OsExcBackTraceInfo(const ExcInfo *excInfo)
|
||||
if (LR[index] == 0) {
|
||||
break;
|
||||
}
|
||||
PRINTK("backtrace %d -- lr = 0x%x\n", index, LR[index]);
|
||||
PRINTK("backtrace %u -- lr = 0x%x\n", index, LR[index]);
|
||||
}
|
||||
PRINTK("----- backtrace end -----\n");
|
||||
}
|
||||
@@ -414,15 +413,15 @@ STATIC VOID OsExcMemPoolCheckInfo(VOID)
|
||||
}
|
||||
|
||||
for (i = 0; i < errCnt; i++) {
|
||||
PRINTK("pool num = %d\n", i);
|
||||
PRINTK("pool num = %u\n", i);
|
||||
PRINTK("pool type = %d\n", memExcInfo[i].type);
|
||||
PRINTK("pool addr = 0x%x\n", memExcInfo[i].startAddr);
|
||||
PRINTK("pool size = 0x%x\n", memExcInfo[i].size);
|
||||
PRINTK("pool free = 0x%x\n", memExcInfo[i].free);
|
||||
PRINTK("pool blkNum = %d\n", memExcInfo[i].blockSize);
|
||||
PRINTK("pool blkNum = %u\n", memExcInfo[i].blockSize);
|
||||
PRINTK("pool error node addr = 0x%x\n", memExcInfo[i].errorAddr);
|
||||
PRINTK("pool error node len = 0x%x\n", memExcInfo[i].errorLen);
|
||||
PRINTK("pool error node owner = %d\n", memExcInfo[i].errorOwner);
|
||||
PRINTK("pool error node owner = %u\n", memExcInfo[i].errorOwner);
|
||||
}
|
||||
#endif
|
||||
UINT32 ret = LOS_MemIntegrityCheck(LOSCFG_SYS_HEAP_ADDR);
|
||||
|
||||
@@ -133,8 +133,7 @@ inline UINT32 HalIsIntActive(VOID)
|
||||
/*lint -e529*/
|
||||
LITE_OS_SEC_TEXT_MINOR VOID HalHwiDefaultHandler(VOID)
|
||||
{
|
||||
UINT32 irqNum = HalIntNumGet();
|
||||
PRINT_ERR("%s irqnum:%d\n", __FUNCTION__, irqNum);
|
||||
PRINT_ERR("%s irqnum:%u\n", __FUNCTION__, HalIntNumGet());
|
||||
while (1) {}
|
||||
}
|
||||
|
||||
@@ -332,8 +331,8 @@ STATIC VOID OsExcTypeInfo(const ExcInfo *excInfo)
|
||||
{
|
||||
CHAR *phaseStr[] = {"exc in init", "exc in task", "exc in hwi"};
|
||||
|
||||
PRINTK("Type = %d\n", excInfo->type);
|
||||
PRINTK("ThrdPid = %d\n", excInfo->thrdPid);
|
||||
PRINTK("Type = %u\n", excInfo->type);
|
||||
PRINTK("ThrdPid = %u\n", excInfo->thrdPid);
|
||||
PRINTK("Phase = %s\n", phaseStr[excInfo->phase]);
|
||||
PRINTK("FaultAddr = 0x%x\n", excInfo->faultAddr);
|
||||
}
|
||||
@@ -344,7 +343,7 @@ STATIC VOID OsExcCurTaskInfo(const ExcInfo *excInfo)
|
||||
if (excInfo->phase == OS_EXC_IN_TASK) {
|
||||
LosTaskCB *taskCB = OS_TCB_FROM_TID(LOS_CurTaskIDGet());
|
||||
PRINTK("Task name = %s\n", taskCB->taskName);
|
||||
PRINTK("Task ID = %d\n", taskCB->taskID);
|
||||
PRINTK("Task ID = %u\n", taskCB->taskID);
|
||||
PRINTK("Task SP = %p\n", taskCB->stackPointer);
|
||||
PRINTK("Task ST = 0x%x\n", taskCB->topOfStack);
|
||||
PRINTK("Task SS = 0x%x\n", taskCB->stackSize);
|
||||
@@ -390,7 +389,7 @@ STATIC VOID OsExcBackTraceInfo(const ExcInfo *excInfo)
|
||||
if (LR[index] == 0) {
|
||||
break;
|
||||
}
|
||||
PRINTK("backtrace %d -- lr = 0x%x\n", index, LR[index]);
|
||||
PRINTK("backtrace %u -- lr = 0x%x\n", index, LR[index]);
|
||||
}
|
||||
PRINTK("----- backtrace end -----\n");
|
||||
}
|
||||
@@ -416,15 +415,15 @@ STATIC VOID OsExcMemPoolCheckInfo(VOID)
|
||||
}
|
||||
|
||||
for (i = 0; i < errCnt; i++) {
|
||||
PRINTK("pool num = %d\n", i);
|
||||
PRINTK("pool num = %u\n", i);
|
||||
PRINTK("pool type = %d\n", memExcInfo[i].type);
|
||||
PRINTK("pool addr = 0x%x\n", memExcInfo[i].startAddr);
|
||||
PRINTK("pool size = 0x%x\n", memExcInfo[i].size);
|
||||
PRINTK("pool free = 0x%x\n", memExcInfo[i].free);
|
||||
PRINTK("pool blkNum = %d\n", memExcInfo[i].blockSize);
|
||||
PRINTK("pool blkNum = %u\n", memExcInfo[i].blockSize);
|
||||
PRINTK("pool error node addr = 0x%x\n", memExcInfo[i].errorAddr);
|
||||
PRINTK("pool error node len = 0x%x\n", memExcInfo[i].errorLen);
|
||||
PRINTK("pool error node owner = %d\n", memExcInfo[i].errorOwner);
|
||||
PRINTK("pool error node owner = %u\n", memExcInfo[i].errorOwner);
|
||||
}
|
||||
#endif
|
||||
UINT32 ret = LOS_MemIntegrityCheck(LOSCFG_SYS_HEAP_ADDR);
|
||||
|
||||
@@ -134,8 +134,7 @@ inline UINT32 HalIsIntActive(VOID)
|
||||
/*lint -e529*/
|
||||
LITE_OS_SEC_TEXT_MINOR VOID HalHwiDefaultHandler(VOID)
|
||||
{
|
||||
UINT32 irqNum = HalIntNumGet();
|
||||
PRINT_ERR("%s irqnum:%d\n", __FUNCTION__, irqNum);
|
||||
PRINT_ERR("%s irqnum:%u\n", __FUNCTION__, HalIntNumGet());
|
||||
while (1) {}
|
||||
}
|
||||
|
||||
@@ -335,8 +334,8 @@ STATIC VOID OsExcTypeInfo(const ExcInfo *excInfo)
|
||||
{
|
||||
CHAR *phaseStr[] = {"exc in init", "exc in task", "exc in hwi"};
|
||||
|
||||
PRINTK("Type = %d\n", excInfo->type);
|
||||
PRINTK("ThrdPid = %d\n", excInfo->thrdPid);
|
||||
PRINTK("Type = %u\n", excInfo->type);
|
||||
PRINTK("ThrdPid = %u\n", excInfo->thrdPid);
|
||||
PRINTK("Phase = %s\n", phaseStr[excInfo->phase]);
|
||||
PRINTK("FaultAddr = 0x%x\n", excInfo->faultAddr);
|
||||
}
|
||||
@@ -347,7 +346,7 @@ STATIC VOID OsExcCurTaskInfo(const ExcInfo *excInfo)
|
||||
if (excInfo->phase == OS_EXC_IN_TASK) {
|
||||
LosTaskCB *taskCB = OS_TCB_FROM_TID(LOS_CurTaskIDGet());
|
||||
PRINTK("Task name = %s\n", taskCB->taskName);
|
||||
PRINTK("Task ID = %d\n", taskCB->taskID);
|
||||
PRINTK("Task ID = %u\n", taskCB->taskID);
|
||||
PRINTK("Task SP = %p\n", taskCB->stackPointer);
|
||||
PRINTK("Task ST = 0x%x\n", taskCB->topOfStack);
|
||||
PRINTK("Task SS = 0x%x\n", taskCB->stackSize);
|
||||
@@ -393,7 +392,7 @@ STATIC VOID OsExcBackTraceInfo(const ExcInfo *excInfo)
|
||||
if (LR[index] == 0) {
|
||||
break;
|
||||
}
|
||||
PRINTK("backtrace %d -- lr = 0x%x\n", index, LR[index]);
|
||||
PRINTK("backtrace %u -- lr = 0x%x\n", index, LR[index]);
|
||||
}
|
||||
PRINTK("----- backtrace end -----\n");
|
||||
}
|
||||
@@ -419,15 +418,15 @@ STATIC VOID OsExcMemPoolCheckInfo(VOID)
|
||||
}
|
||||
|
||||
for (i = 0; i < errCnt; i++) {
|
||||
PRINTK("pool num = %d\n", i);
|
||||
PRINTK("pool num = %u\n", i);
|
||||
PRINTK("pool type = %d\n", memExcInfo[i].type);
|
||||
PRINTK("pool addr = 0x%x\n", memExcInfo[i].startAddr);
|
||||
PRINTK("pool size = 0x%x\n", memExcInfo[i].size);
|
||||
PRINTK("pool free = 0x%x\n", memExcInfo[i].free);
|
||||
PRINTK("pool blkNum = %d\n", memExcInfo[i].blockSize);
|
||||
PRINTK("pool blkNum = %u\n", memExcInfo[i].blockSize);
|
||||
PRINTK("pool error node addr = 0x%x\n", memExcInfo[i].errorAddr);
|
||||
PRINTK("pool error node len = 0x%x\n", memExcInfo[i].errorLen);
|
||||
PRINTK("pool error node owner = %d\n", memExcInfo[i].errorOwner);
|
||||
PRINTK("pool error node owner = %u\n", memExcInfo[i].errorOwner);
|
||||
}
|
||||
#endif
|
||||
UINT32 ret = LOS_MemIntegrityCheck(LOSCFG_SYS_HEAP_ADDR);
|
||||
|
||||
@@ -123,8 +123,7 @@ inline UINT32 HalIsIntActive(VOID)
|
||||
/*lint -e529*/
|
||||
LITE_OS_SEC_TEXT_MINOR VOID HalHwiDefaultHandler(VOID)
|
||||
{
|
||||
UINT32 irqNum = HalIntNumGet();
|
||||
PRINT_ERR("%s irqnum:%d\n", __FUNCTION__, irqNum);
|
||||
PRINT_ERR("%s irqnum:%u\n", __FUNCTION__, HalIntNumGet());
|
||||
while (1) {}
|
||||
}
|
||||
|
||||
@@ -322,8 +321,8 @@ STATIC VOID OsExcTypeInfo(const ExcInfo *excInfo)
|
||||
{
|
||||
CHAR *phaseStr[] = {"exc in init", "exc in task", "exc in hwi"};
|
||||
|
||||
PRINTK("Type = %d\n", excInfo->type);
|
||||
PRINTK("ThrdPid = %d\n", excInfo->thrdPid);
|
||||
PRINTK("Type = %u\n", excInfo->type);
|
||||
PRINTK("ThrdPid = %u\n", excInfo->thrdPid);
|
||||
PRINTK("Phase = %s\n", phaseStr[excInfo->phase]);
|
||||
PRINTK("FaultAddr = 0x%x\n", excInfo->faultAddr);
|
||||
}
|
||||
@@ -334,7 +333,7 @@ STATIC VOID OsExcCurTaskInfo(const ExcInfo *excInfo)
|
||||
if (excInfo->phase == OS_EXC_IN_TASK) {
|
||||
LosTaskCB *taskCB = OS_TCB_FROM_TID(LOS_CurTaskIDGet());
|
||||
PRINTK("Task name = %s\n", taskCB->taskName);
|
||||
PRINTK("Task ID = %d\n", taskCB->taskID);
|
||||
PRINTK("Task ID = %u\n", taskCB->taskID);
|
||||
PRINTK("Task SP = %p\n", taskCB->stackPointer);
|
||||
PRINTK("Task ST = 0x%x\n", taskCB->topOfStack);
|
||||
PRINTK("Task SS = 0x%x\n", taskCB->stackSize);
|
||||
@@ -380,7 +379,7 @@ STATIC VOID OsExcBackTraceInfo(const ExcInfo *excInfo)
|
||||
if (LR[index] == 0) {
|
||||
break;
|
||||
}
|
||||
PRINTK("backtrace %d -- lr = 0x%x\n", index, LR[index]);
|
||||
PRINTK("backtrace %u -- lr = 0x%x\n", index, LR[index]);
|
||||
}
|
||||
PRINTK("----- backtrace end -----\n");
|
||||
}
|
||||
@@ -406,15 +405,15 @@ STATIC VOID OsExcMemPoolCheckInfo(VOID)
|
||||
}
|
||||
|
||||
for (i = 0; i < errCnt; i++) {
|
||||
PRINTK("pool num = %d\n", i);
|
||||
PRINTK("pool num = %u\n", i);
|
||||
PRINTK("pool type = %d\n", memExcInfo[i].type);
|
||||
PRINTK("pool addr = 0x%x\n", memExcInfo[i].startAddr);
|
||||
PRINTK("pool size = 0x%x\n", memExcInfo[i].size);
|
||||
PRINTK("pool free = 0x%x\n", memExcInfo[i].free);
|
||||
PRINTK("pool blkNum = %d\n", memExcInfo[i].blockSize);
|
||||
PRINTK("pool blkNum = %u\n", memExcInfo[i].blockSize);
|
||||
PRINTK("pool error node addr = 0x%x\n", memExcInfo[i].errorAddr);
|
||||
PRINTK("pool error node len = 0x%x\n", memExcInfo[i].errorLen);
|
||||
PRINTK("pool error node owner = %d\n", memExcInfo[i].errorOwner);
|
||||
PRINTK("pool error node owner = %u\n", memExcInfo[i].errorOwner);
|
||||
}
|
||||
#endif
|
||||
UINT32 ret = LOS_MemIntegrityCheck(LOSCFG_SYS_HEAP_ADDR);
|
||||
|
||||
@@ -130,8 +130,7 @@ inline UINT32 HalIsIntActive(VOID)
|
||||
/*lint -e529*/
|
||||
LITE_OS_SEC_TEXT_MINOR VOID HalHwiDefaultHandler(VOID)
|
||||
{
|
||||
UINT32 irqNum = HalIntNumGet();
|
||||
PRINT_ERR("%s irqnum:%d\n", __FUNCTION__, irqNum);
|
||||
PRINT_ERR("%s irqnum:%u\n", __FUNCTION__, HalIntNumGet());
|
||||
while (1) {}
|
||||
}
|
||||
|
||||
@@ -331,8 +330,8 @@ STATIC VOID OsExcTypeInfo(const ExcInfo *excInfo)
|
||||
{
|
||||
CHAR *phaseStr[] = {"exc in init", "exc in task", "exc in hwi"};
|
||||
|
||||
PRINTK("Type = %d\n", excInfo->type);
|
||||
PRINTK("ThrdPid = %d\n", excInfo->thrdPid);
|
||||
PRINTK("Type = %u\n", excInfo->type);
|
||||
PRINTK("ThrdPid = %u\n", excInfo->thrdPid);
|
||||
PRINTK("Phase = %s\n", phaseStr[excInfo->phase]);
|
||||
PRINTK("FaultAddr = 0x%x\n", excInfo->faultAddr);
|
||||
}
|
||||
@@ -343,7 +342,7 @@ STATIC VOID OsExcCurTaskInfo(const ExcInfo *excInfo)
|
||||
if (excInfo->phase == OS_EXC_IN_TASK) {
|
||||
LosTaskCB *taskCB = OS_TCB_FROM_TID(LOS_CurTaskIDGet());
|
||||
PRINTK("Task name = %s\n", taskCB->taskName);
|
||||
PRINTK("Task ID = %d\n", taskCB->taskID);
|
||||
PRINTK("Task ID = %u\n", taskCB->taskID);
|
||||
PRINTK("Task SP = %p\n", taskCB->stackPointer);
|
||||
PRINTK("Task ST = 0x%x\n", taskCB->topOfStack);
|
||||
PRINTK("Task SS = 0x%x\n", taskCB->stackSize);
|
||||
@@ -389,7 +388,7 @@ STATIC VOID OsExcBackTraceInfo(const ExcInfo *excInfo)
|
||||
if (LR[index] == 0) {
|
||||
break;
|
||||
}
|
||||
PRINTK("backtrace %d -- lr = 0x%x\n", index, LR[index]);
|
||||
PRINTK("backtrace %u -- lr = 0x%x\n", index, LR[index]);
|
||||
}
|
||||
PRINTK("----- backtrace end -----\n");
|
||||
}
|
||||
@@ -415,15 +414,15 @@ STATIC VOID OsExcMemPoolCheckInfo(VOID)
|
||||
}
|
||||
|
||||
for (i = 0; i < errCnt; i++) {
|
||||
PRINTK("pool num = %d\n", i);
|
||||
PRINTK("pool num = %u\n", i);
|
||||
PRINTK("pool type = %d\n", memExcInfo[i].type);
|
||||
PRINTK("pool addr = 0x%x\n", memExcInfo[i].startAddr);
|
||||
PRINTK("pool size = 0x%x\n", memExcInfo[i].size);
|
||||
PRINTK("pool free = 0x%x\n", memExcInfo[i].free);
|
||||
PRINTK("pool blkNum = %d\n", memExcInfo[i].blockSize);
|
||||
PRINTK("pool blkNum = %u\n", memExcInfo[i].blockSize);
|
||||
PRINTK("pool error node addr = 0x%x\n", memExcInfo[i].errorAddr);
|
||||
PRINTK("pool error node len = 0x%x\n", memExcInfo[i].errorLen);
|
||||
PRINTK("pool error node owner = %d\n", memExcInfo[i].errorOwner);
|
||||
PRINTK("pool error node owner = %u\n", memExcInfo[i].errorOwner);
|
||||
}
|
||||
#endif
|
||||
UINT32 ret = LOS_MemIntegrityCheck(LOSCFG_SYS_HEAP_ADDR);
|
||||
|
||||
@@ -130,6 +130,10 @@ extern UINT64 LOS_SysCycleGet(VOID);
|
||||
#define OS_SYS_NS_TO_CYCLE(time, freq) (((time) / OS_SYS_NS_PER_SECOND) * (freq) + \
|
||||
(time % OS_SYS_NS_PER_SECOND) * (freq) / OS_SYS_NS_PER_SECOND)
|
||||
|
||||
#define OS_SYS_TICK_TO_CYCLE(ticks) (((UINT64)(ticks) * g_sysClock) / LOSCFG_BASE_CORE_TICK_PER_SECOND)
|
||||
|
||||
#define OS_SYS_CYCLE_TO_TICK(cycle) ((((UINT64)(cycle)) * LOSCFG_BASE_CORE_TICK_PER_SECOND) / g_sysClock)
|
||||
|
||||
/**
|
||||
* @ingroup los_tick
|
||||
* System time basic function error code: Null pointer.
|
||||
|
||||
@@ -127,7 +127,7 @@ LITE_OS_SEC_TEXT_INIT UINT32 LOS_KernelInit(VOID)
|
||||
OsRegister();
|
||||
ret = OsMemSystemInit();
|
||||
if (ret != LOS_OK) {
|
||||
PRINT_ERR("OsMemSystemInit error %d\n", ret);
|
||||
PRINT_ERR("OsMemSystemInit error %u\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -243,7 +243,7 @@ static INLINE VOID OsQueueBufferOperate(LosQueueCB *queueCB, UINT32 operateType,
|
||||
msgDataSize = *((UINT32 *)(UINTPTR)((queueNode + queueCB->queueSize) - sizeof(UINT32)));
|
||||
rc = memcpy_s((VOID *)bufferAddr, *bufferSize, (VOID *)queueNode, msgDataSize);
|
||||
if (rc != EOK) {
|
||||
PRINT_ERR("%s[%d] memcpy failed, error type = %u\n", __FUNCTION__, __LINE__, rc);
|
||||
PRINT_ERR("%s[%d] memcpy failed, error type = %d\n", __FUNCTION__, __LINE__, rc);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ static INLINE VOID OsQueueBufferOperate(LosQueueCB *queueCB, UINT32 operateType,
|
||||
*((UINT32 *)(UINTPTR)((queueNode + queueCB->queueSize) - sizeof(UINT32))) = *bufferSize;
|
||||
rc = memcpy_s((VOID *)queueNode, queueCB->queueSize, (VOID *)bufferAddr, *bufferSize);
|
||||
if (rc != EOK) {
|
||||
PRINT_ERR("%s[%d] memcpy failed, error type = %u\n", __FUNCTION__, __LINE__, rc);
|
||||
PRINT_ERR("%s[%d] memcpy failed, error type = %d\n", __FUNCTION__, __LINE__, rc);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,13 +92,17 @@ VOID OsSchedResetSchedResponseTime(UINT64 responseTime)
|
||||
|
||||
#if (LOSCFG_BASE_CORE_TICK_WTIMER == 0)
|
||||
STATIC UINT64 g_schedTimerBase;
|
||||
STATIC BOOL g_tickTimerBaseUpdate = FALSE;
|
||||
|
||||
VOID OsSchedUpdateSchedTimeBase(VOID)
|
||||
{
|
||||
UINT32 period = 0;
|
||||
|
||||
(VOID)HalGetTickCycle(&period);
|
||||
g_schedTimerBase += period;
|
||||
if (g_tickTimerBaseUpdate == FALSE) {
|
||||
(VOID)HalGetTickCycle(&period);
|
||||
g_schedTimerBase += period;
|
||||
}
|
||||
g_tickTimerBaseUpdate = FALSE;
|
||||
}
|
||||
|
||||
VOID OsSchedTimerBaseReset(UINT64 currTime)
|
||||
@@ -124,6 +128,7 @@ UINT64 OsGetCurrSysTimeCycle(VOID)
|
||||
/* Turn the timer count */
|
||||
g_schedTimerBase += period;
|
||||
schedTime = g_schedTimerBase + time;
|
||||
g_tickTimerBaseUpdate = TRUE;
|
||||
}
|
||||
|
||||
LOS_ASSERT(schedTime >= oldSchedTime);
|
||||
@@ -145,22 +150,11 @@ STATIC INLINE VOID OsTimeSliceUpdate(LosTaskCB *taskCB, UINT64 currTime)
|
||||
taskCB->startTime = currTime;
|
||||
}
|
||||
|
||||
STATIC INLINE VOID OsSchedTickReload(UINT64 nextResponseTime, UINT32 responseID, BOOL isTimeSlice, BOOL timeUpdate)
|
||||
STATIC INLINE VOID OsSchedTickReload(UINT64 currTime, UINT64 nextResponseTime, UINT32 responseID,
|
||||
BOOL isTimeSlice, BOOL timeUpdate)
|
||||
{
|
||||
UINT64 currTime, nextExpireTime;
|
||||
UINT32 usedTime;
|
||||
|
||||
currTime = OsGetCurrSchedTimeCycle();
|
||||
if (g_tickStartTime != 0) {
|
||||
usedTime = currTime - g_tickStartTime;
|
||||
g_tickStartTime = 0;
|
||||
} else {
|
||||
usedTime = 0;
|
||||
}
|
||||
|
||||
if ((nextResponseTime > usedTime) && ((nextResponseTime - usedTime) > OS_TICK_RESPONSE_PRECISION)) {
|
||||
nextResponseTime -= usedTime;
|
||||
} else {
|
||||
UINT64 nextExpireTime;
|
||||
if (nextResponseTime < OS_TICK_RESPONSE_PRECISION) {
|
||||
nextResponseTime = OS_TICK_RESPONSE_PRECISION;
|
||||
}
|
||||
|
||||
@@ -190,8 +184,10 @@ STATIC INLINE VOID OsSchedSetNextExpireTime(UINT64 startTime, UINT32 responseID,
|
||||
UINT64 nextExpireTime;
|
||||
UINT64 nextResponseTime = 0;
|
||||
BOOL isTimeSlice = FALSE;
|
||||
(VOID)startTime;
|
||||
|
||||
nextExpireTime = OsGetNextExpireTime(startTime);
|
||||
UINT64 currTime = OsGetCurrSchedTimeCycle();
|
||||
nextExpireTime = OsGetNextExpireTime(currTime);
|
||||
/* The response time of the task time slice is aligned to the next response time in the delay queue */
|
||||
if ((nextExpireTime > taskEndTime) && ((nextExpireTime - taskEndTime) > OS_SCHED_MINI_PERIOD)) {
|
||||
nextExpireTime = taskEndTime;
|
||||
@@ -200,7 +196,7 @@ STATIC INLINE VOID OsSchedSetNextExpireTime(UINT64 startTime, UINT32 responseID,
|
||||
|
||||
if ((g_schedResponseTime > nextExpireTime) &&
|
||||
((g_schedResponseTime - nextExpireTime) >= OS_TICK_RESPONSE_PRECISION)) {
|
||||
nextResponseTime = nextExpireTime - startTime;
|
||||
nextResponseTime = nextExpireTime - currTime;
|
||||
if (nextResponseTime > OS_TICK_RESPONSE_TIME_MAX) {
|
||||
if (SchedRealSleepTimeSet != NULL) {
|
||||
SchedRealSleepTimeSet(nextResponseTime);
|
||||
@@ -217,7 +213,7 @@ STATIC INLINE VOID OsSchedSetNextExpireTime(UINT64 startTime, UINT32 responseID,
|
||||
return;
|
||||
}
|
||||
|
||||
OsSchedTickReload(nextResponseTime, responseID, isTimeSlice, timeUpdate);
|
||||
OsSchedTickReload(currTime, nextResponseTime, responseID, isTimeSlice, timeUpdate);
|
||||
}
|
||||
|
||||
VOID OsSchedUpdateExpireTime(UINT64 startTime, BOOL timeUpdate)
|
||||
|
||||
@@ -115,7 +115,7 @@ VOID OsAdd2SortLink(SortLinkList *node, UINT64 startTime, UINT32 waitTicks, Sort
|
||||
}
|
||||
|
||||
intSave = LOS_IntLock();
|
||||
SET_SORTLIST_VALUE(node, startTime + (UINT64)waitTicks * OS_CYCLE_PER_TICK);
|
||||
SET_SORTLIST_VALUE(node, startTime + OS_SYS_TICK_TO_CYCLE(waitTicks));
|
||||
OsAddNode2SortLink(sortLinkHeader, node);
|
||||
LOS_IntRestore(intSave);
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ LITE_OS_SEC_TEXT VOID OsSwtmrTask(VOID)
|
||||
tick = LOS_TickCountGet() - tick;
|
||||
|
||||
if (tick >= SWTMR_MAX_RUNNING_TICKS) {
|
||||
PRINT_WARN("timer_handler(%p) cost too many ms(%d)\n",
|
||||
PRINT_WARN("timer_handler(%p) cost too many ms(%u)\n",
|
||||
swtmrHandle.handler,
|
||||
(UINT32)((tick * OS_SYS_MS_PER_SECOND) / LOSCFG_BASE_CORE_TICK_PER_SECOND));
|
||||
}
|
||||
@@ -123,8 +123,8 @@ LITE_OS_SEC_TEXT_INIT UINT32 OsSwtmrTaskCreate(VOID)
|
||||
STATIC UINT64 OsSwtmrCalcStartTime(UINT64 currTime, SWTMR_CTRL_S *swtmr, const SWTMR_CTRL_S *alignSwtmr)
|
||||
{
|
||||
UINT64 usedTime, startTime;
|
||||
UINT64 alignEnd = (UINT64)alignSwtmr->uwInterval * OS_CYCLE_PER_TICK;
|
||||
UINT64 swtmrTime = (UINT64)swtmr->uwInterval * OS_CYCLE_PER_TICK;
|
||||
UINT64 alignEnd = OS_SYS_TICK_TO_CYCLE(alignSwtmr->uwInterval);
|
||||
UINT64 swtmrTime = OS_SYS_TICK_TO_CYCLE(swtmr->uwInterval);
|
||||
UINT64 remainTime = OsSortLinkGetRemainTime(currTime, &alignSwtmr->stSortList);
|
||||
if (remainTime == 0) {
|
||||
startTime = GET_SORTLIST_VALUE(&alignSwtmr->stSortList);
|
||||
|
||||
@@ -343,7 +343,7 @@ LITE_OS_SEC_TEXT_MINOR UINT32 OsGetAllTskInfo(VOID)
|
||||
continue;
|
||||
}
|
||||
|
||||
PRINTK("%d %d %s 0x%x 0x%x 0x%x 0x%x 0x%x ",
|
||||
PRINTK("%u %u %s 0x%x 0x%x 0x%x 0x%x 0x%x ",
|
||||
taskCB->taskID, taskCB->priority, OsConvertTskStatus(taskCB->taskStatus),
|
||||
taskCB->stackSize, OsGetTaskWaterLine(taskCB->taskID),
|
||||
(UINT32)(UINTPTR)taskCB->stackPointer, taskCB->topOfStack, taskCB->eventMask);
|
||||
@@ -352,7 +352,7 @@ LITE_OS_SEC_TEXT_MINOR UINT32 OsGetAllTskInfo(VOID)
|
||||
PRINTK("0x%x ", semID);
|
||||
|
||||
#if (LOSCFG_BASE_CORE_CPUP == 1)
|
||||
PRINTK("%d.%d %d.%d %d.%d ",
|
||||
PRINTK("%u.%u %u.%u %u.%u ",
|
||||
cpuLessOneSec[taskCB->taskID].uwUsage / LOS_CPUP_PRECISION_MULT,
|
||||
cpuLessOneSec[taskCB->taskID].uwUsage % LOS_CPUP_PRECISION_MULT,
|
||||
cpuTenSec[taskCB->taskID].uwUsage / LOS_CPUP_PRECISION_MULT,
|
||||
@@ -498,7 +498,7 @@ LITE_OS_SEC_TEXT CHAR *LOS_CurTaskNameGet(VOID)
|
||||
*****************************************************************************/
|
||||
LITE_OS_SEC_TEXT STATIC VOID OsHandleRunTaskStackOverflow(VOID)
|
||||
{
|
||||
PRINT_ERR("CURRENT task ID: %s:%d stack overflow!\n",
|
||||
PRINT_ERR("CURRENT task ID: %s:%u stack overflow!\n",
|
||||
g_losTask.runTask->taskName, g_losTask.runTask->taskID);
|
||||
OsDoExcHook(EXC_STACKOVERFLOW);
|
||||
}
|
||||
@@ -514,7 +514,7 @@ LITE_OS_SEC_TEXT STATIC VOID OsHandleNewTaskStackOverflow(VOID)
|
||||
{
|
||||
LosTaskCB *tmp = NULL;
|
||||
|
||||
PRINT_ERR("HIGHEST task ID: %s:%d SP error!\n",
|
||||
PRINT_ERR("HIGHEST task ID: %s:%u SP error!\n",
|
||||
g_losTask.newTask->taskName, g_losTask.newTask->taskID);
|
||||
PRINT_ERR("HIGHEST task StackPointer: 0x%x TopOfStack: 0x%x\n",
|
||||
(UINT32)(UINTPTR)(g_losTask.newTask->stackPointer), g_losTask.newTask->topOfStack);
|
||||
@@ -633,7 +633,7 @@ LITE_OS_SEC_TEXT_INIT VOID OsTaskEntry(UINT32 taskID)
|
||||
taskCB->joinRetval = (UINTPTR)taskCB->taskEntry(taskCB->arg);
|
||||
retVal = LOS_TaskDelete(taskCB->taskID);
|
||||
if (retVal != LOS_OK) {
|
||||
PRINT_ERR("Delete Task[TID: %d] Failed!\n", taskCB->taskID);
|
||||
PRINT_ERR("Delete Task[TID: %u] Failed!\n", taskCB->taskID);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ Return : current tick
|
||||
*****************************************************************************/
|
||||
LITE_OS_SEC_TEXT_MINOR UINT64 LOS_TickCountGet(VOID)
|
||||
{
|
||||
return OsGetCurrSchedTimeCycle() / OS_CYCLE_PER_TICK;
|
||||
return OS_SYS_CYCLE_TO_TICK(OsGetCurrSchedTimeCycle());
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
|
||||
@@ -952,7 +952,7 @@ UINT32 LOS_MemInit(VOID *pool, UINT32 size)
|
||||
|
||||
if (((UINTPTR)pool & (OS_MEM_ALIGN_SIZE - 1)) || \
|
||||
(size & (OS_MEM_ALIGN_SIZE - 1))) {
|
||||
PRINT_ERR("LiteOS heap memory address or size configured not aligned:address:0x%x,size:0x%x, alignsize:%d\n", \
|
||||
PRINT_ERR("LiteOS heap memory address or size configured not aligned:address:0x%x,size:0x%x, alignsize:%u\n", \
|
||||
(UINTPTR)pool, size, OS_MEM_ALIGN_SIZE);
|
||||
return OS_ERROR;
|
||||
}
|
||||
@@ -1788,8 +1788,8 @@ STATIC VOID OsMemIntegrityCheckError(struct OsMemPoolHead *pool,
|
||||
PRINTK("The prev node is free\n");
|
||||
}
|
||||
MEM_UNLOCK(pool, intSave);
|
||||
PRINT_ERR("cur node: 0x%x, pre node: 0x%x, pre node was allocated by task: %d, %s\n",
|
||||
tmpNode, preNode, taskCB->taskID, taskCB->taskName);
|
||||
PRINT_ERR("cur node: 0x%x, pre node: 0x%x, pre node was allocated by task: %u, %s\n",
|
||||
(UINTPTR)tmpNode, (UINTPTR)preNode, taskCB->taskID, taskCB->taskName);
|
||||
LOS_Panic("Memory integrity check error!\n");
|
||||
#else
|
||||
MEM_UNLOCK(pool, intSave);
|
||||
|
||||
Reference in New Issue
Block a user