提交 ffe7462c 编写于 作者: Yansira's avatar Yansira

内核codex告警清零

Signed-off-by: NKiita <zhanyan@huawei.com>
Change-Id: I6b0bc9ba638f7aa73be754d5c92561fc372de1c6
上级 88a0caae
...@@ -454,7 +454,7 @@ STATIC VOID OsDumpExcVaddrRegion(LosVmSpace *space, LosVmMapRegion *region) ...@@ -454,7 +454,7 @@ STATIC VOID OsDumpExcVaddrRegion(LosVmSpace *space, LosVmMapRegion *region)
mmuFlag = FALSE; mmuFlag = FALSE;
} }
PrintExcInfo(" 0x%08x 0x%08x 0x%08x\n", PrintExcInfo(" 0x%08x 0x%08x 0x%08x\n",
startVaddr, LOS_PaddrToKVaddr(startPaddr), (UINT32)pageCount << PAGE_SHIFT); startVaddr, (UINTPTR)LOS_PaddrToKVaddr(startPaddr), (UINT32)pageCount << PAGE_SHIFT);
pageCount = 0; pageCount = 0;
startPaddr = 0; startPaddr = 0;
} }
...@@ -515,7 +515,7 @@ VOID OsDumpContextMem(const ExcContext *excBufAddr) ...@@ -515,7 +515,7 @@ VOID OsDumpContextMem(const ExcContext *excBufAddr)
for (excReg = &(excBufAddr->R0); count <= DUMPREGS; excReg++, count++) { for (excReg = &(excBufAddr->R0); count <= DUMPREGS; excReg++, count++) {
if (IS_VALID_ADDR(*excReg)) { if (IS_VALID_ADDR(*excReg)) {
PrintExcInfo("\ndump mem around R%u:%p", count, (*excReg)); PrintExcInfo("\ndump mem around R%u:0x%x", count, (*excReg));
OsDumpMemByte(DUMPSIZE, ((*excReg) - (DUMPSIZE >> 1))); OsDumpMemByte(DUMPSIZE, ((*excReg) - (DUMPSIZE >> 1)));
} }
} }
...@@ -811,7 +811,7 @@ VOID OsCallStackInfo(VOID) ...@@ -811,7 +811,7 @@ VOID OsCallStackInfo(VOID)
PrintExcInfo("runTask->stackPointer = 0x%x\n" PrintExcInfo("runTask->stackPointer = 0x%x\n"
"runTask->topOfStack = 0x%x\n" "runTask->topOfStack = 0x%x\n"
"text_start:0x%x,text_end:0x%x\n", "text_start:0x%x,text_end:0x%x\n",
stackPointer, runTask->topOfStack, &__text_start, &__text_end); (UINTPTR)stackPointer, runTask->topOfStack, &__text_start, &__text_end);
while ((stackPointer > (UINT32 *)runTask->topOfStack) && (count < OS_MAX_BACKTRACE)) { while ((stackPointer > (UINT32 *)runTask->topOfStack) && (count < OS_MAX_BACKTRACE)) {
if ((*stackPointer > (UINTPTR)(&__text_start)) && if ((*stackPointer > (UINTPTR)(&__text_start)) &&
......
...@@ -231,7 +231,7 @@ int pthread_create(pthread_t *thread, const pthread_attr_t *attr, ...@@ -231,7 +231,7 @@ int pthread_create(pthread_t *thread, const pthread_attr_t *attr,
SetPthreadAttr(self, attr, &userAttr); SetPthreadAttr(self, attr, &userAttr);
(VOID)snprintf_s(name, sizeof(name), sizeof(name) - 1, "pth%02d", pthreadNumber); (VOID)snprintf_s(name, sizeof(name), sizeof(name) - 1, "pth%02u", pthreadNumber);
pthreadNumber++; pthreadNumber++;
taskInitParam.pcName = name; taskInitParam.pcName = name;
......
...@@ -75,7 +75,7 @@ static void FillFdInfo(struct SeqBuf *seqBuf, struct filelist *fileList, unsigne ...@@ -75,7 +75,7 @@ static void FillFdInfo(struct SeqBuf *seqBuf, struct filelist *fileList, unsigne
} }
if (hasPrivilege) { if (hasPrivilege) {
(void)LosBufPrintf(seqBuf, "%u\t%d\t%6d <%d>\t%s\n", pid, fd, sysFd, filp ? filp->f_refcount : 1, name); (void)LosBufPrintf(seqBuf, "%u\t%d\t%6d <%lu>\t%s\n", pid, fd, sysFd, filp ? filp->f_refcount : 1, name);
} else { } else {
(void)LosBufPrintf(seqBuf, "%u\t%d\t%s\n", pid, fd, name); (void)LosBufPrintf(seqBuf, "%u\t%d\t%s\n", pid, fd, name);
} }
......
...@@ -59,24 +59,24 @@ void los_vfs_init(void) ...@@ -59,24 +59,24 @@ void los_vfs_init(void)
retval = VnodesInit(); retval = VnodesInit();
if (retval != LOS_OK) { if (retval != LOS_OK) {
PRINT_ERR("los_vfs_init VnodeInit failed error %d\n", retval); PRINT_ERR("los_vfs_init VnodeInit failed error %u\n", retval);
return; return;
} }
retval = PathCacheInit(); retval = PathCacheInit();
if (retval != LOS_OK) { if (retval != LOS_OK) {
PRINT_ERR("los_vfs_init PathCacheInit failed error %d\n", retval); PRINT_ERR("los_vfs_init PathCacheInit failed error %u\n", retval);
return; return;
} }
retval = VnodeHashInit(); retval = VnodeHashInit();
if (retval != LOS_OK) { if (retval != LOS_OK) {
PRINT_ERR("los_vfs_init VnodeHashInit failed error %d\n", retval); PRINT_ERR("los_vfs_init VnodeHashInit failed error %u\n", retval);
return; return;
} }
retval = VnodeDevInit(); retval = VnodeDevInit();
if (retval != LOS_OK) { if (retval != LOS_OK) {
PRINT_ERR("los_vfs_init VnodeDevInit failed error %d\n", retval); PRINT_ERR("los_vfs_init VnodeDevInit failed error %u\n", retval);
return; return;
} }
......
...@@ -535,7 +535,7 @@ static void PrintFileInfo64(const struct stat64 *stat64Info, const char *name) ...@@ -535,7 +535,7 @@ static void PrintFileInfo64(const struct stat64 *stat64Info, const char *name)
dirFlag = '-'; dirFlag = '-';
} }
PRINTK("%c%s%s%s %-8lld u:%-5d g:%-5d %-10s\n", dirFlag, PRINTK("%c%s%s%s %-8lld u:%-5u g:%-5u %-10s\n", dirFlag,
str[0], str[1], str[UGO_NUMS - 1], stat64Info->st_size, stat64Info->st_uid, stat64Info->st_gid, name); str[0], str[1], str[UGO_NUMS - 1], stat64Info->st_size, stat64Info->st_uid, stat64Info->st_gid, name);
} }
...@@ -561,7 +561,7 @@ static void PrintFileInfo(const struct stat *statInfo, const char *name) ...@@ -561,7 +561,7 @@ static void PrintFileInfo(const struct stat *statInfo, const char *name)
dirFlag = '-'; dirFlag = '-';
} }
PRINTK("%c%s%s%s %-8lld u:%-5d g:%-5d %-10s\n", dirFlag, PRINTK("%c%s%s%s %-8lld u:%-5u g:%-5u %-10s\n", dirFlag,
str[0], str[1], str[UGO_NUMS - 1], statInfo->st_size, statInfo->st_uid, statInfo->st_gid, name); str[0], str[1], str[UGO_NUMS - 1], statInfo->st_size, statInfo->st_uid, statInfo->st_gid, name);
} }
...@@ -736,7 +736,7 @@ void lsfd(void) ...@@ -736,7 +736,7 @@ void lsfd(void)
while (i < CONFIG_NFILE_DESCRIPTORS) { while (i < CONFIG_NFILE_DESCRIPTORS) {
node = files_get_openfile(i); node = files_get_openfile(i);
if (node) { if (node) {
PRINTK("%5d %s\n", i, f_list->fl_files[i].f_path); PRINTK("%5u %s\n", i, f_list->fl_files[i].f_path);
} }
i++; i++;
} }
......
...@@ -71,7 +71,7 @@ void PathCacheDump(void) ...@@ -71,7 +71,7 @@ void PathCacheDump(void)
LIST_HEAD *nhead = &g_pathCacheHashEntrys[i]; LIST_HEAD *nhead = &g_pathCacheHashEntrys[i];
LOS_DL_LIST_FOR_EACH_ENTRY(pc, nhead, struct PathCache, hashEntry) { LOS_DL_LIST_FOR_EACH_ENTRY(pc, nhead, struct PathCache, hashEntry) {
PRINTK(" pathCache dump hash %d item %s %p %p %d\n", i, PRINTK(" pathCache dump hash %d item %s %p %p %u\n", i,
pc->name, pc->parentVnode, pc->childVnode, pc->nameLen); pc->name, pc->parentVnode, pc->childVnode, pc->nameLen);
} }
} }
......
...@@ -635,7 +635,7 @@ void VnodeMemoryDump(void) ...@@ -635,7 +635,7 @@ void VnodeMemoryDump(void)
} }
PRINTK("Vnode number = %d\n", vnodeCount); PRINTK("Vnode number = %d\n", vnodeCount);
PRINTK("Vnode memory size = %d(B)\n", vnodeCount * sizeof(struct Vnode)); PRINTK("Vnode memory size = %u(B)\n", vnodeCount * sizeof(struct Vnode));
} }
LIST_HEAD* GetVnodeFreeList() LIST_HEAD* GetVnodeFreeList()
......
...@@ -338,7 +338,7 @@ STATIC VOID OsWaitCheckAndWakeParentProcess(LosProcessCB *parentCB, const LosPro ...@@ -338,7 +338,7 @@ STATIC VOID OsWaitCheckAndWakeParentProcess(LosProcessCB *parentCB, const LosPro
LITE_OS_SEC_TEXT VOID OsProcessResourcesToFree(LosProcessCB *processCB) LITE_OS_SEC_TEXT VOID OsProcessResourcesToFree(LosProcessCB *processCB)
{ {
if (!(processCB->processStatus & (OS_PROCESS_STATUS_INIT | OS_PROCESS_STATUS_RUNNING))) { if (!(processCB->processStatus & (OS_PROCESS_STATUS_INIT | OS_PROCESS_STATUS_RUNNING))) {
PRINT_ERR("The process(%d) has no permission to release process(%d) resources!\n", PRINT_ERR("The process(%u) has no permission to release process(%u) resources!\n",
OsCurrProcessGet()->processID, processCB->processID); OsCurrProcessGet()->processID, processCB->processID);
} }
......
...@@ -478,7 +478,7 @@ LITE_OS_SEC_TEXT VOID OsTaskResourcesToFree(LosTaskCB *taskCB) ...@@ -478,7 +478,7 @@ LITE_OS_SEC_TEXT VOID OsTaskResourcesToFree(LosTaskCB *taskCB)
LOS_ASSERT(!(processCB->vmSpace == NULL)); LOS_ASSERT(!(processCB->vmSpace == NULL));
UINT32 ret = OsUnMMap(processCB->vmSpace, (UINTPTR)mapBase, mapSize); UINT32 ret = OsUnMMap(processCB->vmSpace, (UINTPTR)mapBase, mapSize);
if ((ret != LOS_OK) && (mapBase != 0) && !(processCB->processStatus & OS_PROCESS_STATUS_INIT)) { if ((ret != LOS_OK) && (mapBase != 0) && !(processCB->processStatus & OS_PROCESS_STATUS_INIT)) {
PRINT_ERR("process(%u) ummap user task(%u) stack failed! mapbase: 0x%x size :0x%x, error: %d\n", PRINT_ERR("process(%u) ummap user task(%u) stack failed! mapbase: 0x%x size :0x%x, error: %u\n",
processCB->processID, taskCB->taskID, mapBase, mapSize, ret); processCB->processID, taskCB->taskID, mapBase, mapSize, ret);
} }
......
...@@ -519,7 +519,7 @@ STATIC INT32 OsFutexWaitParamCheck(const UINT32 *userVaddr, UINT32 flags, UINT32 ...@@ -519,7 +519,7 @@ STATIC INT32 OsFutexWaitParamCheck(const UINT32 *userVaddr, UINT32 flags, UINT32
} }
if (flags && (OsFutexKeyShmPermCheck(userVaddr, flags) != LOS_OK)) { if (flags && (OsFutexKeyShmPermCheck(userVaddr, flags) != LOS_OK)) {
PRINT_ERR("Futex wait param check failed! error shared memory perm userVaddr: 0x%x\n", userVaddr); PRINT_ERR("Futex wait param check failed! error shared memory perm userVaddr: 0x%x\n", (UINTPTR)userVaddr);
return LOS_EINVAL; return LOS_EINVAL;
} }
...@@ -663,12 +663,12 @@ STATIC INT32 OsFutexWakeParamCheck(const UINT32 *userVaddr, UINT32 flags) ...@@ -663,12 +663,12 @@ STATIC INT32 OsFutexWakeParamCheck(const UINT32 *userVaddr, UINT32 flags)
} }
if ((vaddr % sizeof(INT32)) || (vaddr < OS_FUTEX_KEY_BASE) || (vaddr >= OS_FUTEX_KEY_MAX)) { if ((vaddr % sizeof(INT32)) || (vaddr < OS_FUTEX_KEY_BASE) || (vaddr >= OS_FUTEX_KEY_MAX)) {
PRINT_ERR("Futex wake param check failed! error userVaddr: 0x%x\n", userVaddr); PRINT_ERR("Futex wake param check failed! error userVaddr: 0x%x\n", (UINTPTR)userVaddr);
return LOS_EINVAL; return LOS_EINVAL;
} }
if (flags && (OsFutexKeyShmPermCheck(userVaddr, flags) != LOS_OK)) { if (flags && (OsFutexKeyShmPermCheck(userVaddr, flags) != LOS_OK)) {
PRINT_ERR("Futex wake param check failed! error shared memory perm userVaddr: 0x%x\n", userVaddr); PRINT_ERR("Futex wake param check failed! error shared memory perm userVaddr: 0x%x\n", (UINTPTR)userVaddr);
return LOS_EINVAL; return LOS_EINVAL;
} }
...@@ -941,12 +941,12 @@ STATIC INT32 OsFutexRequeueParamCheck(const UINT32 *oldUserVaddr, UINT32 flags, ...@@ -941,12 +941,12 @@ STATIC INT32 OsFutexRequeueParamCheck(const UINT32 *oldUserVaddr, UINT32 flags,
} }
if ((oldVaddr % sizeof(INT32)) || (oldVaddr < OS_FUTEX_KEY_BASE) || (oldVaddr >= OS_FUTEX_KEY_MAX)) { if ((oldVaddr % sizeof(INT32)) || (oldVaddr < OS_FUTEX_KEY_BASE) || (oldVaddr >= OS_FUTEX_KEY_MAX)) {
PRINT_ERR("Futex requeue param check failed! error old userVaddr: 0x%x\n", oldUserVaddr); PRINT_ERR("Futex requeue param check failed! error old userVaddr: 0x%x\n", (UINTPTR)oldUserVaddr);
return LOS_EINVAL; return LOS_EINVAL;
} }
if ((newVaddr % sizeof(INT32)) || (newVaddr < OS_FUTEX_KEY_BASE) || (newVaddr >= OS_FUTEX_KEY_MAX)) { if ((newVaddr % sizeof(INT32)) || (newVaddr < OS_FUTEX_KEY_BASE) || (newVaddr >= OS_FUTEX_KEY_MAX)) {
PRINT_ERR("Futex requeue param check failed! error new userVaddr: 0x%x\n", newUserVaddr); PRINT_ERR("Futex requeue param check failed! error new userVaddr: 0x%x\n", (UINTPTR)newUserVaddr);
return LOS_EINVAL; return LOS_EINVAL;
} }
......
...@@ -703,7 +703,7 @@ VOID *OsSaveSignalContext(VOID *sp, VOID *newSp) ...@@ -703,7 +703,7 @@ VOID *OsSaveSignalContext(VOID *sp, VOID *newSp)
sigcb->sigFlag = 0; sigcb->sigFlag = 0;
process->sigShare = 0; process->sigShare = 0;
SCHEDULER_UNLOCK(intSave); SCHEDULER_UNLOCK(intSave);
PRINT_ERR("The signal processing function for the current process pid =%d is NULL!\n", task->processID); PRINT_ERR("The signal processing function for the current process pid =%u is NULL!\n", task->processID);
return sp; return sp;
} }
/* One pthread do the share signal */ /* One pthread do the share signal */
...@@ -737,7 +737,7 @@ VOID *OsRestorSignalContext(VOID *sp) ...@@ -737,7 +737,7 @@ VOID *OsRestorSignalContext(VOID *sp)
SCHEDULER_LOCK(intSave); SCHEDULER_LOCK(intSave);
if (sigcb->count != 1) { if (sigcb->count != 1) {
SCHEDULER_UNLOCK(intSave); SCHEDULER_UNLOCK(intSave);
PRINT_ERR("sig error count : %d\n", sigcb->count); PRINT_ERR("sig error count : %u\n", sigcb->count);
return sp; return sp;
} }
......
...@@ -312,7 +312,7 @@ STATIC INLINE struct OsMemNodeHead *PreSentinelNodeGet(const VOID *pool, const s ...@@ -312,7 +312,7 @@ STATIC INLINE struct OsMemNodeHead *PreSentinelNodeGet(const VOID *pool, const s
sentinelNode = OS_MEM_END_NODE(pool, ((struct OsMemPoolHead *)pool)->info.totalSize); sentinelNode = OS_MEM_END_NODE(pool, ((struct OsMemPoolHead *)pool)->info.totalSize);
while (sentinelNode != NULL) { while (sentinelNode != NULL) {
if (OsMemIsLastSentinelNode(sentinelNode)) { if (OsMemIsLastSentinelNode(sentinelNode)) {
PRINT_ERR("PreSentinelNodeGet can not find node %#x\n", node); PRINT_ERR("PreSentinelNodeGet can not find node %#x\n", (UINTPTR)node);
return NULL; return NULL;
} }
nextNode = OsMemSentinelNodeGet(sentinelNode); nextNode = OsMemSentinelNodeGet(sentinelNode);
...@@ -363,7 +363,7 @@ STATIC INLINE BOOL TryShrinkPool(const VOID *pool, const struct OsMemNodeHead *n ...@@ -363,7 +363,7 @@ STATIC INLINE BOOL TryShrinkPool(const VOID *pool, const struct OsMemNodeHead *n
} }
if (OsMemLargeNodeFree(node) != LOS_OK) { if (OsMemLargeNodeFree(node) != LOS_OK) {
PRINT_ERR("TryShrinkPool free %#x failed!\n", node); PRINT_ERR("TryShrinkPool free %#x failed!\n", (UINTPTR)node);
return FALSE; return FALSE;
} }
...@@ -1474,13 +1474,13 @@ STATIC UINT32 OsMemAddrValidCheckPrint(const VOID *pool, struct OsMemFreeNodeHea ...@@ -1474,13 +1474,13 @@ STATIC UINT32 OsMemAddrValidCheckPrint(const VOID *pool, struct OsMemFreeNodeHea
if (((*tmpNode)->prev != NULL) && !OsMemAddrValidCheck(pool, (*tmpNode)->prev)) { if (((*tmpNode)->prev != NULL) && !OsMemAddrValidCheck(pool, (*tmpNode)->prev)) {
PRINT_ERR("[%s], %d, memory check error!\n" PRINT_ERR("[%s], %d, memory check error!\n"
" freeNode.prev:%#x is out of legal mem range\n", " freeNode.prev:%#x is out of legal mem range\n",
__FUNCTION__, __LINE__, (*tmpNode)->prev); __FUNCTION__, __LINE__, (UINTPTR)(*tmpNode)->prev);
return LOS_NOK; return LOS_NOK;
} }
if (((*tmpNode)->next != NULL) && !OsMemAddrValidCheck(pool, (*tmpNode)->next)) { if (((*tmpNode)->next != NULL) && !OsMemAddrValidCheck(pool, (*tmpNode)->next)) {
PRINT_ERR("[%s], %d, memory check error!\n" PRINT_ERR("[%s], %d, memory check error!\n"
" freeNode.next:%#x is out of legal mem range\n", " freeNode.next:%#x is out of legal mem range\n",
__FUNCTION__, __LINE__, (*tmpNode)->next); __FUNCTION__, __LINE__, (UINTPTR)(*tmpNode)->next);
return LOS_NOK; return LOS_NOK;
} }
return LOS_OK; return LOS_OK;
...@@ -1538,7 +1538,7 @@ STATIC VOID OsMemPoolHeadCheck(const struct OsMemPoolHead *pool) ...@@ -1538,7 +1538,7 @@ STATIC VOID OsMemPoolHeadCheck(const struct OsMemPoolHead *pool)
if (OsMemFreeListNodeCheck(pool, tmpNode)) { if (OsMemFreeListNodeCheck(pool, tmpNode)) {
flag = 1; flag = 1;
PRINT_ERR("FreeListIndex: %u, node: %#x, bNode: %#x, prev: %#x, next: %#x\n", PRINT_ERR("FreeListIndex: %u, node: %#x, bNode: %#x, prev: %#x, next: %#x\n",
index, tmpNode, tmpNode->header.ptr.prev, tmpNode->prev, tmpNode->next); index, (UINTPTR)tmpNode, (UINTPTR)tmpNode->header.ptr.prev, (UINTPTR)tmpNode->prev, (UINTPTR)tmpNode->next);
goto OUT; goto OUT;
} }
} }
...@@ -1546,7 +1546,7 @@ STATIC VOID OsMemPoolHeadCheck(const struct OsMemPoolHead *pool) ...@@ -1546,7 +1546,7 @@ STATIC VOID OsMemPoolHeadCheck(const struct OsMemPoolHead *pool)
OUT: OUT:
if (flag) { if (flag) {
PRINTK("mem pool info: poolAddr: %#x, poolSize: 0x%x\n", pool, pool->info.totalSize); PRINTK("mem pool info: poolAddr: %#x, poolSize: 0x%x\n", (UINTPTR)pool, pool->info.totalSize);
#ifdef LOSCFG_MEM_WATERLINE #ifdef LOSCFG_MEM_WATERLINE
PRINTK("mem pool info: poolWaterLine: 0x%x, poolCurUsedSize: 0x%x\n", pool->info.waterLine, PRINTK("mem pool info: poolWaterLine: 0x%x, poolCurUsedSize: 0x%x\n", pool->info.waterLine,
pool->info.curUsedSize); pool->info.curUsedSize);
...@@ -1559,7 +1559,7 @@ OUT: ...@@ -1559,7 +1559,7 @@ OUT:
size = OS_MEM_NODE_GET_SIZE(sentinel->sizeAndFlag); size = OS_MEM_NODE_GET_SIZE(sentinel->sizeAndFlag);
node = OsMemSentinelNodeGet(sentinel); node = OsMemSentinelNodeGet(sentinel);
sentinel = OS_MEM_END_NODE(node, size); sentinel = OS_MEM_END_NODE(node, size);
PRINTK("expand node info: nodeAddr: %#x, nodeSize: 0x%x\n", node, size); PRINTK("expand node info: nodeAddr: %#x, nodeSize: 0x%x\n", (UINTPTR)node, size);
} }
#endif #endif
} }
...@@ -1606,23 +1606,23 @@ STATIC VOID OsMemNodeInfo(const struct OsMemNodeHead *tmpNode, ...@@ -1606,23 +1606,23 @@ STATIC VOID OsMemNodeInfo(const struct OsMemNodeHead *tmpNode,
if (OS_MEM_NODE_GET_USED_FLAG(tmpNode->sizeAndFlag)) { if (OS_MEM_NODE_GET_USED_FLAG(tmpNode->sizeAndFlag)) {
usedNode = (struct OsMemUsedNodeHead *)tmpNode; usedNode = (struct OsMemUsedNodeHead *)tmpNode;
PRINTK("\n broken node head: %#x %#x %#x, ", PRINTK("\n broken node head: %#x %#x %#x, ",
usedNode->header.ptr.prev, usedNode->header.magic, usedNode->header.sizeAndFlag); (UINTPTR)usedNode->header.ptr.prev, usedNode->header.magic, usedNode->header.sizeAndFlag);
} else { } else {
freeNode = (struct OsMemFreeNodeHead *)tmpNode; freeNode = (struct OsMemFreeNodeHead *)tmpNode;
PRINTK("\n broken node head: %#x %#x %#x %#x, ", PRINTK("\n broken node head: %#x %#x %#x %#x, ",
freeNode->header.ptr.prev, freeNode->next, freeNode->prev, freeNode->header.magic, (UINTPTR)freeNode->header.ptr.prev, (UINTPTR)freeNode->next, (UINTPTR)freeNode->prev,
freeNode->header.sizeAndFlag); freeNode->header.magic, freeNode->header.sizeAndFlag);
} }
if (OS_MEM_NODE_GET_USED_FLAG(preNode->sizeAndFlag)) { if (OS_MEM_NODE_GET_USED_FLAG(preNode->sizeAndFlag)) {
usedNode = (struct OsMemUsedNodeHead *)preNode; usedNode = (struct OsMemUsedNodeHead *)preNode;
PRINTK("prev node head: %#x %#x %#x\n", PRINTK("prev node head: %#x %#x %#x\n",
usedNode->header.ptr.prev, usedNode->header.magic, usedNode->header.sizeAndFlag); (UINTPTR)usedNode->header.ptr.prev, usedNode->header.magic, usedNode->header.sizeAndFlag);
} else { } else {
freeNode = (struct OsMemFreeNodeHead *)preNode; freeNode = (struct OsMemFreeNodeHead *)preNode;
PRINTK("prev node head: %#x %#x %#x %#x, ", PRINTK("prev node head: %#x %#x %#x %#x, ",
freeNode->header.ptr.prev, freeNode->next, freeNode->prev, freeNode->header.magic, (UINTPTR)freeNode->header.ptr.prev, (UINTPTR)freeNode->next, (UINTPTR)freeNode->prev,
freeNode->header.sizeAndFlag); freeNode->header.magic, freeNode->header.sizeAndFlag);
} }
#ifdef LOSCFG_MEM_LEAKCHECK #ifdef LOSCFG_MEM_LEAKCHECK
...@@ -1630,11 +1630,11 @@ STATIC VOID OsMemNodeInfo(const struct OsMemNodeHead *tmpNode, ...@@ -1630,11 +1630,11 @@ STATIC VOID OsMemNodeInfo(const struct OsMemNodeHead *tmpNode,
#endif #endif
PRINTK("\n---------------------------------------------\n"); PRINTK("\n---------------------------------------------\n");
PRINTK(" dump mem tmpNode:%#x ~ %#x\n", tmpNode, ((UINTPTR)tmpNode + OS_MEM_NODE_DUMP_SIZE)); PRINTK(" dump mem tmpNode:%#x ~ %#x\n", (UINTPTR)tmpNode, ((UINTPTR)tmpNode + OS_MEM_NODE_DUMP_SIZE));
OsDumpMemByte(OS_MEM_NODE_DUMP_SIZE, (UINTPTR)tmpNode); OsDumpMemByte(OS_MEM_NODE_DUMP_SIZE, (UINTPTR)tmpNode);
PRINTK("\n---------------------------------------------\n"); PRINTK("\n---------------------------------------------\n");
if (preNode != tmpNode) { if (preNode != tmpNode) {
PRINTK(" dump mem :%#x ~ tmpNode:%#x\n", ((UINTPTR)tmpNode - OS_MEM_NODE_DUMP_SIZE), tmpNode); PRINTK(" dump mem :%#x ~ tmpNode:%#x\n", ((UINTPTR)tmpNode - OS_MEM_NODE_DUMP_SIZE), (UINTPTR)tmpNode);
OsDumpMemByte(OS_MEM_NODE_DUMP_SIZE, ((UINTPTR)tmpNode - OS_MEM_NODE_DUMP_SIZE)); OsDumpMemByte(OS_MEM_NODE_DUMP_SIZE, ((UINTPTR)tmpNode - OS_MEM_NODE_DUMP_SIZE));
PRINTK("\n---------------------------------------------\n"); PRINTK("\n---------------------------------------------\n");
} }
...@@ -1669,10 +1669,10 @@ STATIC VOID OsMemIntegrityCheckError(struct OsMemPoolHead *pool, ...@@ -1669,10 +1669,10 @@ STATIC VOID OsMemIntegrityCheckError(struct OsMemPoolHead *pool,
} }
MEM_UNLOCK(pool, intSave); MEM_UNLOCK(pool, intSave);
LOS_Panic("cur node: %#x\npre node: %#x\npre node was allocated by task:%s\n", LOS_Panic("cur node: %#x\npre node: %#x\npre node was allocated by task:%s\n",
tmpNode, preNode, taskCB->taskName); (UINTPTR)tmpNode, (UINTPTR)preNode, taskCB->taskName);
#else #else
MEM_UNLOCK(pool, intSave); MEM_UNLOCK(pool, intSave);
LOS_Panic("Memory interity check error, cur node: %#x, pre node: %#x\n", tmpNode, preNode); LOS_Panic("Memory interity check error, cur node: %#x, pre node: %#x\n", (UINTPTR)tmpNode, (UINTPTR)preNode);
#endif #endif
} }
...@@ -1753,7 +1753,7 @@ UINT32 LOS_MemInfoGet(VOID *pool, LOS_MEM_POOL_STATUS *poolStatus) ...@@ -1753,7 +1753,7 @@ UINT32 LOS_MemInfoGet(VOID *pool, LOS_MEM_POOL_STATUS *poolStatus)
} }
if ((pool == NULL) || (poolInfo->info.pool != pool)) { if ((pool == NULL) || (poolInfo->info.pool != pool)) {
PRINT_ERR("wrong mem pool addr: %#x, line:%d\n", poolInfo, __LINE__); PRINT_ERR("wrong mem pool addr: %#x, line:%d\n", (UINTPTR)poolInfo, __LINE__);
return LOS_NOK; return LOS_NOK;
} }
......
...@@ -100,7 +100,7 @@ VOID OsExcStackInfo(VOID) ...@@ -100,7 +100,7 @@ VOID OsExcStackInfo(VOID)
stack = (UINTPTR *)((UINTPTR)stackTop + g_stackInfo[index].stackSize); stack = (UINTPTR *)((UINTPTR)stackTop + g_stackInfo[index].stackSize);
(VOID)OsStackWaterLineGet(stack, stackTop, &size); (VOID)OsStackWaterLineGet(stack, stackTop, &size);
PrintExcInfo("%11s %-5d %-10p 0x%-8x 0x%-4x\n", g_stackInfo[index].stackName, PrintExcInfo("%11s %-5u %-10p 0x%-8x 0x%-4x\n", g_stackInfo[index].stackName,
LOSCFG_KERNEL_CORE_NUM - 1 - cpuid, stackTop, g_stackInfo[index].stackSize, size); LOSCFG_KERNEL_CORE_NUM - 1 - cpuid, stackTop, g_stackInfo[index].stackSize, size);
} }
} }
......
...@@ -63,7 +63,7 @@ VOID OsDumpMemByte(size_t length, UINTPTR addr) ...@@ -63,7 +63,7 @@ VOID OsDumpMemByte(size_t length, UINTPTR addr)
} }
while (dataLen) { while (dataLen) {
if (IS_ALIGNED(count, sizeof(CHAR *))) { if (IS_ALIGNED(count, sizeof(CHAR *))) {
PRINTK("\n 0x%lx :", alignAddr); PRINTK("\n 0x%lx :", (UINTPTR)alignAddr);
#ifdef LOSCFG_SAVE_EXCINFO #ifdef LOSCFG_SAVE_EXCINFO
WriteExcInfoToBuf("\n 0x%lx :", alignAddr); WriteExcInfoToBuf("\n 0x%lx :", alignAddr);
#endif #endif
......
...@@ -111,7 +111,7 @@ STATIC VOID OsLockDepDumpLock(const LosTaskCB *task, const SPIN_LOCK_S *lock, ...@@ -111,7 +111,7 @@ STATIC VOID OsLockDepDumpLock(const LosTaskCB *task, const SPIN_LOCK_S *lock,
PrintExcInfo("lockdep check failed\n"); PrintExcInfo("lockdep check failed\n");
PrintExcInfo("error type : %s\n", OsLockDepErrorStringGet(errType)); PrintExcInfo("error type : %s\n", OsLockDepErrorStringGet(errType));
PrintExcInfo("request addr : 0x%x\n", requestAddr); PrintExcInfo("request addr : 0x%x\n", (UINTPTR)requestAddr);
while (1) { while (1) {
PrintExcInfo("task name : %s\n", temp->taskName); PrintExcInfo("task name : %s\n", temp->taskName);
...@@ -121,7 +121,7 @@ STATIC VOID OsLockDepDumpLock(const LosTaskCB *task, const SPIN_LOCK_S *lock, ...@@ -121,7 +121,7 @@ STATIC VOID OsLockDepDumpLock(const LosTaskCB *task, const SPIN_LOCK_S *lock,
for (i = 0; i < lockDep->lockDepth; i++) { for (i = 0; i < lockDep->lockDepth; i++) {
if (lockDep->heldLocks[i].lockPtr == lock) { if (lockDep->heldLocks[i].lockPtr == lock) {
PrintExcInfo("[%d] %s <-- addr:0x%x\n", i, LOCKDEP_GET_NAME(lockDep, i), PrintExcInfo("[%d] %s <-- addr:0x%x\n", i, LOCKDEP_GET_NAME(lockDep, i),
LOCKDEP_GET_ADDR(lockDep, i)); (UINTPTR)LOCKDEP_GET_ADDR(lockDep, i));
} else { } else {
PrintExcInfo("[%d] %s \n", i, LOCKDEP_GET_NAME(lockDep, i)); PrintExcInfo("[%d] %s \n", i, LOCKDEP_GET_NAME(lockDep, i));
} }
......
...@@ -920,7 +920,7 @@ VOID OsSchedStart(VOID) ...@@ -920,7 +920,7 @@ VOID OsSchedStart(VOID)
OsPercpuGet()->responseID = OS_INVALID; OsPercpuGet()->responseID = OS_INVALID;
OsSchedSetNextExpireTime(newTask->startTime, newTask->taskID, newTask->startTime + newTask->timeSlice, OS_INVALID); OsSchedSetNextExpireTime(newTask->startTime, newTask->taskID, newTask->startTime + newTask->timeSlice, OS_INVALID);
PRINTK("cpu %d entering scheduler\n", cpuid); PRINTK("cpu %u entering scheduler\n", cpuid);
OsTaskContextLoad(newTask); OsTaskContextLoad(newTask);
} }
...@@ -939,7 +939,7 @@ VOID OsSchedToUserReleaseLock(VOID) ...@@ -939,7 +939,7 @@ VOID OsSchedToUserReleaseLock(VOID)
STATIC VOID OsTaskStackCheck(LosTaskCB *runTask, LosTaskCB *newTask) STATIC VOID OsTaskStackCheck(LosTaskCB *runTask, LosTaskCB *newTask)
{ {
if (!OS_STACK_MAGIC_CHECK(runTask->topOfStack)) { if (!OS_STACK_MAGIC_CHECK(runTask->topOfStack)) {
LOS_Panic("CURRENT task ID: %s:%d stack overflow!\n", runTask->taskName, runTask->taskID); LOS_Panic("CURRENT task ID: %s:%u stack overflow!\n", runTask->taskName, runTask->taskID);
} }
if (((UINTPTR)(newTask->stackPointer) <= newTask->topOfStack) || if (((UINTPTR)(newTask->stackPointer) <= newTask->topOfStack) ||
......
...@@ -373,8 +373,8 @@ VOID OsDumpRegion2(LosVmSpace *space, LosVmMapRegion *region) ...@@ -373,8 +373,8 @@ VOID OsDumpRegion2(LosVmSpace *space, LosVmMapRegion *region)
if (flagsStr == NULL) { if (flagsStr == NULL) {
return; return;
} }
PRINTK("\t %#010x %-32.32s %#010x %#010x %-15.15s %4d %4d\n", PRINTK("\t %#010x %-32.32s %#010x %#010x %-15.15s %4u %4u\n",
region, OsGetRegionNameOrFilePath(region), region->range.base, (UINTPTR)region, OsGetRegionNameOrFilePath(region), region->range.base,
region->range.size, flagsStr, regionPages, pssPages); region->range.size, flagsStr, regionPages, pssPages);
(VOID)LOS_MemFree(m_aucSysMem0, flagsStr); (VOID)LOS_MemFree(m_aucSysMem0, flagsStr);
} }
...@@ -394,7 +394,7 @@ VOID OsDumpAspace(LosVmSpace *space) ...@@ -394,7 +394,7 @@ VOID OsDumpAspace(LosVmSpace *space)
spacePages = OsCountAspacePages(space); spacePages = OsCountAspacePages(space);
PRINTK("\r\n PID aspace name base size pages \n"); PRINTK("\r\n PID aspace name base size pages \n");
PRINTK(" ---- ------ ---- ---- ----- ----\n"); PRINTK(" ---- ------ ---- ---- ----- ----\n");
PRINTK(" %-4d %#010x %-10.10s %#010x %#010x %d\n", pcb->processID, space, pcb->processName, PRINTK(" %-4u %#010x %-10.10s %#010x %#010x %u\n", pcb->processID, space, pcb->processName,
space->base, space->size, spacePages); space->base, space->size, spacePages);
PRINTK("\r\n\t region name base size mmu_flags pages pg/ref\n"); PRINTK("\r\n\t region name base size mmu_flags pages pg/ref\n");
PRINTK("\t ------ ---- ---- ---- --------- ----- -----\n"); PRINTK("\t ------ ---- ---- ---- --------- ----- -----\n");
...@@ -467,7 +467,7 @@ VOID OsDumpPte(VADDR_T vaddr) ...@@ -467,7 +467,7 @@ VOID OsDumpPte(VADDR_T vaddr)
} }
return; return;
ERR: ERR:
PRINTK("%s, error vaddr: %#x, l2Table: %#x, l2Index: %#x\n", __FUNCTION__, vaddr, l2Table, l2Index); PRINTK("%s, error vaddr: %#x, l2Table: %#x, l2Index: %#x\n", __FUNCTION__, vaddr, (UINTPTR)l2Table, l2Index);
} }
UINT32 OsVmPhySegPagesGet(LosVmPhysSeg *seg) UINT32 OsVmPhySegPagesGet(LosVmPhysSeg *seg)
...@@ -504,7 +504,7 @@ VOID OsVmPhysDump(VOID) ...@@ -504,7 +504,7 @@ VOID OsVmPhysDump(VOID)
PRINTK("\r\n phys_seg base size free_pages \n"); PRINTK("\r\n phys_seg base size free_pages \n");
PRINTK(" -------- ------- ---------- --------- \n"); PRINTK(" -------- ------- ---------- --------- \n");
#endif #endif
PRINTK(" 0x%08x 0x%08x 0x%08x %8u \n", seg, seg->start, seg->size, segFreePages); PRINTK(" 0x%08x 0x%08x 0x%08x %8u \n", (UINTPTR)seg, seg->start, seg->size, segFreePages);
totalFreePages += segFreePages; totalFreePages += segFreePages;
totalPages += (seg->size >> PAGE_SHIFT); totalPages += (seg->size >> PAGE_SHIFT);
......
...@@ -163,7 +163,7 @@ STATIC VOID OsVmPhysFreeListAdd(LosVmPage *page, UINT8 order) ...@@ -163,7 +163,7 @@ STATIC VOID OsVmPhysFreeListAdd(LosVmPage *page, UINT8 order)
struct VmFreeList *list = NULL; struct VmFreeList *list = NULL;
if (page->segID >= VM_PHYS_SEG_MAX) { if (page->segID >= VM_PHYS_SEG_MAX) {
LOS_Panic("The page segment id(%d) is invalid\n", page->segID); LOS_Panic("The page segment id(%u) is invalid\n", page->segID);
} }
page->order = order; page->order = order;
...@@ -180,7 +180,7 @@ STATIC VOID OsVmPhysFreeListAddUnsafe(LosVmPage *page, UINT8 order) ...@@ -180,7 +180,7 @@ STATIC VOID OsVmPhysFreeListAddUnsafe(LosVmPage *page, UINT8 order)
struct VmFreeList *list = NULL; struct VmFreeList *list = NULL;
if (page->segID >= VM_PHYS_SEG_MAX) { if (page->segID >= VM_PHYS_SEG_MAX) {
LOS_Panic("The page segment id(%d) is invalid\n", page->segID); LOS_Panic("The page segment id(%u) is invalid\n", page->segID);
} }
page->order = order; page->order = order;
...@@ -242,7 +242,7 @@ LosVmPage *OsVmPhysToPage(paddr_t pa, UINT8 segID) ...@@ -242,7 +242,7 @@ LosVmPage *OsVmPhysToPage(paddr_t pa, UINT8 segID)
paddr_t offset; paddr_t offset;
if (segID >= VM_PHYS_SEG_MAX) { if (segID >= VM_PHYS_SEG_MAX) {
LOS_Panic("The page segment id(%d) is invalid\n", segID); LOS_Panic("The page segment id(%u) is invalid\n", segID);
} }
seg = &g_vmPhysSeg[segID]; seg = &g_vmPhysSeg[segID];
if ((pa < seg->start) || (pa >= (seg->start + seg->size))) { if ((pa < seg->start) || (pa >= (seg->start + seg->size))) {
......
...@@ -220,7 +220,7 @@ VOID *LOS_DoBrk(VOID *addr) ...@@ -220,7 +220,7 @@ VOID *LOS_DoBrk(VOID *addr)
size = (UINTPTR)addr - (UINTPTR)space->heapBase; size = (UINTPTR)addr - (UINTPTR)space->heapBase;
size = ROUNDUP(size, PAGE_SIZE); size = ROUNDUP(size, PAGE_SIZE);
alignAddr = (CHAR *)(UINTPTR)(space->heapBase) + size; alignAddr = (CHAR *)(UINTPTR)(space->heapBase) + size;
PRINT_INFO("brk addr %p , size 0x%x, alignAddr %p, align %d\n", addr, size, alignAddr, PAGE_SIZE); PRINT_INFO("brk addr %p , size 0x%x, alignAddr %p, align %u\n", addr, size, alignAddr, PAGE_SIZE);
(VOID)LOS_MuxAcquire(&space->regionMux); (VOID)LOS_MuxAcquire(&space->regionMux);
if (addr < (VOID *)(UINTPTR)space->heapNow) { if (addr < (VOID *)(UINTPTR)space->heapNow) {
......
...@@ -210,10 +210,10 @@ LITE_OS_SEC_TEXT_MINOR VOID OomSetCheckInterval(UINT32 checkInterval) ...@@ -210,10 +210,10 @@ LITE_OS_SEC_TEXT_MINOR VOID OomSetCheckInterval(UINT32 checkInterval)
{ {
if ((checkInterval >= OOM_CHECK_MIN) && (checkInterval <= OOM_CHECK_MAX)) { if ((checkInterval >= OOM_CHECK_MIN) && (checkInterval <= OOM_CHECK_MAX)) {
g_oomCB->checkInterval = checkInterval; g_oomCB->checkInterval = checkInterval;
PRINTK("[oom] set oom check interval (%d)ms successful\n", PRINTK("[oom] set oom check interval (%u)ms successful\n",
g_oomCB->checkInterval); g_oomCB->checkInterval);
} else { } else {
PRINTK("[oom] set oom check interval (%d)ms failed, should be in [%d, %d]\n", PRINTK("[oom] set oom check interval (%u)ms failed, should be in [%d, %d]\n",
g_oomCB->checkInterval, OOM_CHECK_MIN, OOM_CHECK_MAX); g_oomCB->checkInterval, OOM_CHECK_MIN, OOM_CHECK_MAX);
} }
} }
......
...@@ -214,7 +214,7 @@ UINT64 LOS_SizeStrToNum(CHAR *value) ...@@ -214,7 +214,7 @@ UINT64 LOS_SizeStrToNum(CHAR *value)
UINT64 num = 0; UINT64 num = 0;
/* If the string is a hexadecimal value */ /* If the string is a hexadecimal value */
if (sscanf_s(value, "0x%x", &num) > 0) { if (sscanf_s(value, "0x%x", (UINTPTR)(&num)) > 0) {
value += strlen("0x"); value += strlen("0x");
if (strspn(value, "0123456789abcdefABCDEF") < strlen(value)) { if (strspn(value, "0123456789abcdefABCDEF") < strlen(value)) {
goto ERROUT; goto ERROUT;
...@@ -223,7 +223,7 @@ UINT64 LOS_SizeStrToNum(CHAR *value) ...@@ -223,7 +223,7 @@ UINT64 LOS_SizeStrToNum(CHAR *value)
} }
/* If the string is a decimal value in unit *Bytes */ /* If the string is a decimal value in unit *Bytes */
INT32 ret = sscanf_s(value, "%d", &num); INT32 ret = sscanf_s(value, "%llu", &num);
INT32 decOffset = strspn(value, "0123456789"); INT32 decOffset = strspn(value, "0123456789");
CHAR *endPos = value + decOffset; CHAR *endPos = value + decOffset;
if ((ret <= 0) || (decOffset < (strlen(value) - 1))) { if ((ret <= 0) || (decOffset < (strlen(value) - 1))) {
......
...@@ -397,7 +397,7 @@ INT32 OsGetKernelVaddr(const LosVmSpace *space, VADDR_T vaddr, VADDR_T *kvaddr) ...@@ -397,7 +397,7 @@ INT32 OsGetKernelVaddr(const LosVmSpace *space, VADDR_T vaddr, VADDR_T *kvaddr)
PADDR_T paddr = 0; PADDR_T paddr = 0;
if ((space == NULL) || (vaddr == 0) || (kvaddr == NULL)) { if ((space == NULL) || (vaddr == 0) || (kvaddr == NULL)) {
PRINT_ERR("%s[%d], space: %#x, vaddr: %#x\n", __FUNCTION__, __LINE__, space, vaddr); PRINT_ERR("%s[%d], space: %#x, vaddr: %#x\n", __FUNCTION__, __LINE__, (UINTPTR)space, vaddr);
return LOS_NOK; return LOS_NOK;
} }
...@@ -546,7 +546,7 @@ STATIC CHAR *OsGetParamPtr(CHAR * const *ptr, INT32 index) ...@@ -546,7 +546,7 @@ STATIC CHAR *OsGetParamPtr(CHAR * const *ptr, INT32 index)
} }
ret = LOS_GetUser(&userStrPtr, (UINTPTR *)(ptr + index)); ret = LOS_GetUser(&userStrPtr, (UINTPTR *)(ptr + index));
if (ret != LOS_OK) { if (ret != LOS_OK) {
PRINT_ERR("%s[%d], %#x\n", __FUNCTION__, __LINE__, ptr); PRINT_ERR("%s[%d], %#x\n", __FUNCTION__, __LINE__, (UINTPTR)ptr);
return NULL; return NULL;
} }
...@@ -841,7 +841,7 @@ STATIC INT32 OsPutParamToStack(ELFLoadInfo *loadInfo, const UINTPTR *auxVecInfo, ...@@ -841,7 +841,7 @@ STATIC INT32 OsPutParamToStack(ELFLoadInfo *loadInfo, const UINTPTR *auxVecInfo,
size = LOS_ArchCopyToUser(argsPtr, auxVecInfo, vecIndex * sizeof(UINTPTR)); size = LOS_ArchCopyToUser(argsPtr, auxVecInfo, vecIndex * sizeof(UINTPTR));
if (size != 0) { if (size != 0) {
PRINT_ERR("%s[%d], Failed to copy strings! Bytes not copied: %d\n", __FUNCTION__, __LINE__, size); PRINT_ERR("%s[%d], Failed to copy strings! Bytes not copied: %u\n", __FUNCTION__, __LINE__, size);
return -EFAULT; return -EFAULT;
} }
......
...@@ -111,7 +111,7 @@ LITE_OS_SEC_TEXT_INIT UINT32 OsLiteIpcInit(VOID) ...@@ -111,7 +111,7 @@ LITE_OS_SEC_TEXT_INIT UINT32 OsLiteIpcInit(VOID)
} }
ret = (UINT32)register_driver(LITEIPC_DRIVER, &g_liteIpcFops, LITEIPC_DRIVER_MODE, NULL); ret = (UINT32)register_driver(LITEIPC_DRIVER, &g_liteIpcFops, LITEIPC_DRIVER_MODE, NULL);
if (ret != LOS_OK) { if (ret != LOS_OK) {
PRINT_ERR("register lite_ipc driver failed:%d\n", ret); PRINT_ERR("register lite_ipc driver failed:%u\n", ret);
} }
LOS_ListInit(&(g_ipcPendlist)); LOS_ListInit(&(g_ipcPendlist));
for (i = 0; i < LOSCFG_BASE_CORE_PROCESS_LIMIT; i++) { for (i = 0; i < LOSCFG_BASE_CORE_PROCESS_LIMIT; i++) {
...@@ -295,15 +295,15 @@ LITE_OS_SEC_TEXT STATIC VOID EnableIpcNodeFreeByUser(UINT32 processID, VOID *buf ...@@ -295,15 +295,15 @@ LITE_OS_SEC_TEXT STATIC VOID EnableIpcNodeFreeByUser(UINT32 processID, VOID *buf
LITE_OS_SEC_TEXT STATIC VOID *LiteIpcNodeAlloc(UINT32 processID, UINT32 size) LITE_OS_SEC_TEXT STATIC VOID *LiteIpcNodeAlloc(UINT32 processID, UINT32 size)
{ {
VOID *ptr = LOS_MemAlloc(OS_PCB_FROM_PID(processID)->ipcInfo.pool.kvaddr, size); VOID *ptr = LOS_MemAlloc(OS_PCB_FROM_PID(processID)->ipcInfo.pool.kvaddr, size);
PRINT_INFO("LiteIpcNodeAlloc pid:%d, pool:%x buf:%x size:%d\n", PRINT_INFO("LiteIpcNodeAlloc pid:%u, pool:%x buf:%x size:%u\n",
processID, OS_PCB_FROM_PID(processID)->ipcInfo.pool.kvaddr, ptr, size); processID, (UINTPTR)OS_PCB_FROM_PID(processID)->ipcInfo.pool.kvaddr, (UINTPTR)ptr, size);
return ptr; return ptr;
} }
LITE_OS_SEC_TEXT STATIC UINT32 LiteIpcNodeFree(UINT32 processID, VOID *buf) LITE_OS_SEC_TEXT STATIC UINT32 LiteIpcNodeFree(UINT32 processID, VOID *buf)
{ {
PRINT_INFO("LiteIpcNodeFree pid:%d, pool:%x buf:%x\n", PRINT_INFO("LiteIpcNodeFree pid:%u, pool:%x buf:%x\n",
processID, OS_PCB_FROM_PID(processID)->ipcInfo.pool.kvaddr, buf); processID, (UINTPTR)OS_PCB_FROM_PID(processID)->ipcInfo.pool.kvaddr, (UINTPTR)buf);
return LOS_MemFree(OS_PCB_FROM_PID(processID)->ipcInfo.pool.kvaddr, buf); return LOS_MemFree(OS_PCB_FROM_PID(processID)->ipcInfo.pool.kvaddr, buf);
} }
...@@ -455,7 +455,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 SetIpcTask(VOID) ...@@ -455,7 +455,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 SetIpcTask(VOID)
OsCurrProcessGet()->ipcInfo.ipcTaskID = LOS_CurTaskIDGet(); OsCurrProcessGet()->ipcInfo.ipcTaskID = LOS_CurTaskIDGet();
return OsCurrProcessGet()->ipcInfo.ipcTaskID; return OsCurrProcessGet()->ipcInfo.ipcTaskID;
} }
PRINT_ERR("curprocess %d IpcTask already set!\n", OsCurrProcessGet()->processID); PRINT_ERR("curprocess %u IpcTask already set!\n", OsCurrProcessGet()->processID);
return -EINVAL; return -EINVAL;
} }
...@@ -812,7 +812,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 CopyDataFromUser(IpcListNode *node, UINT32 bufSz, ...@@ -812,7 +812,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 CopyDataFromUser(IpcListNode *node, UINT32 bufSz,
node->msg.offsets = (VOID *)((UINTPTR)node + sizeof(IpcListNode) + msg->dataSz); node->msg.offsets = (VOID *)((UINTPTR)node + sizeof(IpcListNode) + msg->dataSz);
ret = copy_from_user((VOID *)(node->msg.offsets), msg->offsets, msg->spObjNum * sizeof(UINT32)); ret = copy_from_user((VOID *)(node->msg.offsets), msg->offsets, msg->spObjNum * sizeof(UINT32));
if (ret != LOS_OK) { if (ret != LOS_OK) {
PRINT_DEBUG("%s, %d, %x, %x, %d\n", __FUNCTION__, __LINE__, node->msg.offsets, msg->offsets, msg->spObjNum); PRINT_DEBUG("%s, %d, %x, %x, %u\n", __FUNCTION__, __LINE__, (UINTPTR)node->msg.offsets, (UINTPTR)msg->offsets, msg->spObjNum);
return ret; return ret;
} }
} else { } else {
...@@ -899,7 +899,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 CheckPara(IpcContent *content, UINT32 *dstTid) ...@@ -899,7 +899,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 CheckPara(IpcContent *content, UINT32 *dstTid)
#endif #endif
OsHookCall(LOS_HOOK_TYPE_IPC_WRITE_DROP, msg, *dstTid, OsHookCall(LOS_HOOK_TYPE_IPC_WRITE_DROP, msg, *dstTid,
(*dstTid == INVAILD_ID) ? INVAILD_ID : OS_TCB_FROM_TID(*dstTid)->processID, 0); (*dstTid == INVAILD_ID) ? INVAILD_ID : OS_TCB_FROM_TID(*dstTid)->processID, 0);
PRINT_ERR("A timeout reply, request timestamp:%lld, now:%lld\n", msg->timestamp, now); PRINT_ERR("A timeout reply, request timestamp:%llu, now:%llu\n", msg->timestamp, now);
return -ETIME; return -ETIME;
} }
#endif #endif
...@@ -1091,7 +1091,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 LiteIpcMsgHandle(IpcContent *con) ...@@ -1091,7 +1091,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 LiteIpcMsgHandle(IpcContent *con)
if ((content->flag & BUFF_FREE) == BUFF_FREE) { if ((content->flag & BUFF_FREE) == BUFF_FREE) {
ret = CheckUsedBuffer(content->buffToFree, &nodeNeedFree); ret = CheckUsedBuffer(content->buffToFree, &nodeNeedFree);
if (ret != LOS_OK) { if (ret != LOS_OK) {
PRINT_ERR("CheckUsedBuffer failed:%d\n", ret); PRINT_ERR("CheckUsedBuffer failed:%u\n", ret);
return ret; return ret;
} }
} }
...@@ -1137,7 +1137,7 @@ BUFFER_FREE: ...@@ -1137,7 +1137,7 @@ BUFFER_FREE:
UINT32 offset = LOS_OFF_SET_OF(IpcContent, inMsg); UINT32 offset = LOS_OFF_SET_OF(IpcContent, inMsg);
ret = copy_to_user((char*)con + offset, (char*)content + offset, sizeof(IpcMsg *)); ret = copy_to_user((char*)con + offset, (char*)content + offset, sizeof(IpcMsg *));
if (ret != LOS_OK) { if (ret != LOS_OK) {
PRINT_ERR("%s, %d, %d\n", __FUNCTION__, __LINE__, ret); PRINT_ERR("%s, %d, %u\n", __FUNCTION__, __LINE__, ret);
return -EINVAL; return -EINVAL;
} }
} }
......
...@@ -179,7 +179,7 @@ static ssize_t HiLogRead(struct file *filep, char *buffer, size_t bufLen) ...@@ -179,7 +179,7 @@ static ssize_t HiLogRead(struct file *filep, char *buffer, size_t bufLen)
} }
if (bufLen < header.len + sizeof(header)) { if (bufLen < header.len + sizeof(header)) {
dprintf("buffer too small,bufLen=%d, header.len=%d,%d\n", bufLen, header.len, header.hdrSize); dprintf("buffer too small,bufLen=%u, header.len=%u,%u\n", bufLen, header.len, header.hdrSize);
retval = -ENOMEM; retval = -ENOMEM;
goto out; goto out;
} }
......
...@@ -104,7 +104,7 @@ VOID OsArmA32SyscallHandle(TaskContext *regs) ...@@ -104,7 +104,7 @@ VOID OsArmA32SyscallHandle(TaskContext *regs)
UINT32 cmd = regs->reserved2; UINT32 cmd = regs->reserved2;
if (cmd >= SYS_CALL_NUM) { if (cmd >= SYS_CALL_NUM) {
PRINT_ERR("Syscall ID: error %d !!!\n", cmd); PRINT_ERR("Syscall ID: error %u !!!\n", cmd);
return; return;
} }
...@@ -112,7 +112,7 @@ VOID OsArmA32SyscallHandle(TaskContext *regs) ...@@ -112,7 +112,7 @@ VOID OsArmA32SyscallHandle(TaskContext *regs)
nArgs = g_syscallNArgs[cmd / NARG_PER_BYTE]; /* 4bit per nargs */ nArgs = g_syscallNArgs[cmd / NARG_PER_BYTE]; /* 4bit per nargs */
nArgs = (cmd & 1) ? (nArgs >> NARG_BITS) : (nArgs & NARG_MASK); nArgs = (cmd & 1) ? (nArgs >> NARG_BITS) : (nArgs & NARG_MASK);
if ((handle == 0) || (nArgs > ARG_NUM_7)) { if ((handle == 0) || (nArgs > ARG_NUM_7)) {
PRINT_ERR("Unsupport syscall ID: %d nArgs: %d\n", cmd, nArgs); PRINT_ERR("Unsupport syscall ID: %u nArgs: %u\n", cmd, nArgs);
regs->R0 = -ENOSYS; regs->R0 = -ENOSYS;
return; return;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册