未验证 提交 efd00c1e 编写于 作者: O openharmony_ci 提交者: Gitee

!872 内核codex清零

Merge pull request !872 from Kiita/0421_codex
......@@ -455,7 +455,7 @@ STATIC VOID OsDumpExcVaddrRegion(LosVmSpace *space, LosVmMapRegion *region)
mmuFlag = FALSE;
}
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;
startPaddr = 0;
}
......@@ -516,7 +516,7 @@ VOID OsDumpContextMem(const ExcContext *excBufAddr)
for (excReg = &(excBufAddr->R0); count <= DUMPREGS; excReg++, count++) {
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)));
}
}
......@@ -812,7 +812,7 @@ VOID OsCallStackInfo(VOID)
PrintExcInfo("runTask->stackPointer = 0x%x\n"
"runTask->topOfStack = 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)) {
if ((*stackPointer > (UINTPTR)(&__text_start)) &&
......
......@@ -231,7 +231,7 @@ int pthread_create(pthread_t *thread, const pthread_attr_t *attr,
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++;
taskInitParam.pcName = name;
......
......@@ -75,7 +75,7 @@ static void FillFdInfo(struct SeqBuf *seqBuf, struct filelist *fileList, unsigne
}
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 {
(void)LosBufPrintf(seqBuf, "%u\t%d\t%s\n", pid, fd, name);
}
......
......@@ -59,24 +59,24 @@ void los_vfs_init(void)
retval = VnodesInit();
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;
}
retval = PathCacheInit();
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;
}
retval = VnodeHashInit();
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;
}
retval = VnodeDevInit();
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;
}
......
......@@ -535,7 +535,7 @@ static void PrintFileInfo64(const struct stat64 *stat64Info, const char *name)
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);
}
......@@ -561,7 +561,7 @@ static void PrintFileInfo(const struct stat *statInfo, const char *name)
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);
}
......@@ -736,7 +736,7 @@ void lsfd(void)
while (i < CONFIG_NFILE_DESCRIPTORS) {
node = files_get_openfile(i);
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++;
}
......
......@@ -71,7 +71,7 @@ void PathCacheDump(void)
LIST_HEAD *nhead = &g_pathCacheHashEntrys[i];
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);
}
}
......
......@@ -669,7 +669,7 @@ void VnodeMemoryDump(void)
}
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()
......
......@@ -338,7 +338,7 @@ STATIC VOID OsWaitCheckAndWakeParentProcess(LosProcessCB *parentCB, const LosPro
LITE_OS_SEC_TEXT VOID OsProcessResourcesToFree(LosProcessCB *processCB)
{
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);
}
......
......@@ -478,7 +478,7 @@ LITE_OS_SEC_TEXT VOID OsTaskResourcesToFree(LosTaskCB *taskCB)
LOS_ASSERT(!(processCB->vmSpace == NULL));
UINT32 ret = OsUnMMap(processCB->vmSpace, (UINTPTR)mapBase, mapSize);
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);
}
......
......@@ -519,7 +519,7 @@ STATIC INT32 OsFutexWaitParamCheck(const UINT32 *userVaddr, UINT32 flags, UINT32
}
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;
}
......@@ -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)) {
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;
}
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;
}
......@@ -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)) {
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;
}
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;
}
......
......@@ -698,7 +698,7 @@ VOID *OsSaveSignalContext(VOID *sp, VOID *newSp)
sigcb->sigFlag = 0;
process->sigShare = 0;
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;
}
/* One pthread do the share signal */
......@@ -732,7 +732,7 @@ VOID *OsRestorSignalContext(VOID *sp)
SCHEDULER_LOCK(intSave);
if (sigcb->count != 1) {
SCHEDULER_UNLOCK(intSave);
PRINT_ERR("sig error count : %d\n", sigcb->count);
PRINT_ERR("sig error count : %u\n", sigcb->count);
return sp;
}
......
......@@ -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);
while (sentinelNode != NULL) {
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;
}
nextNode = OsMemSentinelNodeGet(sentinelNode);
......@@ -363,7 +363,7 @@ STATIC INLINE BOOL TryShrinkPool(const VOID *pool, const struct OsMemNodeHead *n
}
if (OsMemLargeNodeFree(node) != LOS_OK) {
PRINT_ERR("TryShrinkPool free %#x failed!\n", node);
PRINT_ERR("TryShrinkPool free %#x failed!\n", (UINTPTR)node);
return FALSE;
}
......@@ -1474,13 +1474,13 @@ STATIC UINT32 OsMemAddrValidCheckPrint(const VOID *pool, struct OsMemFreeNodeHea
if (((*tmpNode)->prev != NULL) && !OsMemAddrValidCheck(pool, (*tmpNode)->prev)) {
PRINT_ERR("[%s], %d, memory check error!\n"
" freeNode.prev:%#x is out of legal mem range\n",
__FUNCTION__, __LINE__, (*tmpNode)->prev);
__FUNCTION__, __LINE__, (UINTPTR)(*tmpNode)->prev);
return LOS_NOK;
}
if (((*tmpNode)->next != NULL) && !OsMemAddrValidCheck(pool, (*tmpNode)->next)) {
PRINT_ERR("[%s], %d, memory check error!\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_OK;
......@@ -1538,7 +1538,7 @@ STATIC VOID OsMemPoolHeadCheck(const struct OsMemPoolHead *pool)
if (OsMemFreeListNodeCheck(pool, tmpNode)) {
flag = 1;
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;
}
}
......@@ -1546,7 +1546,7 @@ STATIC VOID OsMemPoolHeadCheck(const struct OsMemPoolHead *pool)
OUT:
if (flag) {
PRINTK("mem pool info: poolAddr: %#x, poolSize: 0x%x\n", pool, pool->info.totalSize);
PRINTK("mem pool info: poolAddr: %#x, poolSize: 0x%x\n", (UINTPTR)pool, pool->info.totalSize);
#ifdef LOSCFG_MEM_WATERLINE
PRINTK("mem pool info: poolWaterLine: 0x%x, poolCurUsedSize: 0x%x\n", pool->info.waterLine,
pool->info.curUsedSize);
......@@ -1559,7 +1559,7 @@ OUT:
size = OS_MEM_NODE_GET_SIZE(sentinel->sizeAndFlag);
node = OsMemSentinelNodeGet(sentinel);
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
}
......@@ -1606,23 +1606,23 @@ STATIC VOID OsMemNodeInfo(const struct OsMemNodeHead *tmpNode,
if (OS_MEM_NODE_GET_USED_FLAG(tmpNode->sizeAndFlag)) {
usedNode = (struct OsMemUsedNodeHead *)tmpNode;
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 {
freeNode = (struct OsMemFreeNodeHead *)tmpNode;
PRINTK("\n broken node head: %#x %#x %#x %#x, ",
freeNode->header.ptr.prev, freeNode->next, freeNode->prev, freeNode->header.magic,
freeNode->header.sizeAndFlag);
(UINTPTR)freeNode->header.ptr.prev, (UINTPTR)freeNode->next, (UINTPTR)freeNode->prev,
freeNode->header.magic, freeNode->header.sizeAndFlag);
}
if (OS_MEM_NODE_GET_USED_FLAG(preNode->sizeAndFlag)) {
usedNode = (struct OsMemUsedNodeHead *)preNode;
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 {
freeNode = (struct OsMemFreeNodeHead *)preNode;
PRINTK("prev node head: %#x %#x %#x %#x, ",
freeNode->header.ptr.prev, freeNode->next, freeNode->prev, freeNode->header.magic,
freeNode->header.sizeAndFlag);
(UINTPTR)freeNode->header.ptr.prev, (UINTPTR)freeNode->next, (UINTPTR)freeNode->prev,
freeNode->header.magic, freeNode->header.sizeAndFlag);
}
#ifdef LOSCFG_MEM_LEAKCHECK
......@@ -1630,11 +1630,11 @@ STATIC VOID OsMemNodeInfo(const struct OsMemNodeHead *tmpNode,
#endif
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);
PRINTK("\n---------------------------------------------\n");
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));
PRINTK("\n---------------------------------------------\n");
}
......@@ -1669,10 +1669,10 @@ STATIC VOID OsMemIntegrityCheckError(struct OsMemPoolHead *pool,
}
MEM_UNLOCK(pool, intSave);
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
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
}
......@@ -1753,7 +1753,7 @@ UINT32 LOS_MemInfoGet(VOID *pool, LOS_MEM_POOL_STATUS *poolStatus)
}
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;
}
......
......@@ -100,7 +100,7 @@ VOID OsExcStackInfo(VOID)
stack = (UINTPTR *)((UINTPTR)stackTop + g_stackInfo[index].stackSize);
(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);
}
}
......
......@@ -63,7 +63,7 @@ VOID OsDumpMemByte(size_t length, UINTPTR addr)
}
while (dataLen) {
if (IS_ALIGNED(count, sizeof(CHAR *))) {
PRINTK("\n 0x%lx :", alignAddr);
PRINTK("\n 0x%lx :", (UINTPTR)alignAddr);
#ifdef LOSCFG_SAVE_EXCINFO
WriteExcInfoToBuf("\n 0x%lx :", alignAddr);
#endif
......
......@@ -111,7 +111,7 @@ STATIC VOID OsLockDepDumpLock(const LosTaskCB *task, const SPIN_LOCK_S *lock,
PrintExcInfo("lockdep check failed\n");
PrintExcInfo("error type : %s\n", OsLockDepErrorStringGet(errType));
PrintExcInfo("request addr : 0x%x\n", requestAddr);
PrintExcInfo("request addr : 0x%x\n", (UINTPTR)requestAddr);
while (1) {
PrintExcInfo("task name : %s\n", temp->taskName);
......@@ -121,7 +121,7 @@ STATIC VOID OsLockDepDumpLock(const LosTaskCB *task, const SPIN_LOCK_S *lock,
for (i = 0; i < lockDep->lockDepth; i++) {
if (lockDep->heldLocks[i].lockPtr == lock) {
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 {
PrintExcInfo("[%d] %s \n", i, LOCKDEP_GET_NAME(lockDep, i));
}
......
......@@ -920,7 +920,7 @@ VOID OsSchedStart(VOID)
OsPercpuGet()->responseID = 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);
}
......@@ -939,7 +939,7 @@ VOID OsSchedToUserReleaseLock(VOID)
STATIC VOID OsTaskStackCheck(LosTaskCB *runTask, LosTaskCB *newTask)
{
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) ||
......
......@@ -374,8 +374,8 @@ VOID OsDumpRegion2(LosVmSpace *space, LosVmMapRegion *region)
if (flagsStr == NULL) {
return;
}
PRINTK("\t %#010x %-32.32s %#010x %#010x %-15.15s %4d %4d\n",
region, OsGetRegionNameOrFilePath(region), region->range.base,
PRINTK("\t %#010x %-32.32s %#010x %#010x %-15.15s %4u %4u\n",
(UINTPTR)region, OsGetRegionNameOrFilePath(region), region->range.base,
region->range.size, flagsStr, regionPages, pssPages);
(VOID)LOS_MemFree(m_aucSysMem0, flagsStr);
}
......@@ -395,7 +395,7 @@ VOID OsDumpAspace(LosVmSpace *space)
spacePages = OsCountAspacePages(space);
PRINTK("\r\n PID aspace name base size pages \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);
PRINTK("\r\n\t region name base size mmu_flags pages pg/ref\n");
PRINTK("\t ------ ---- ---- ---- --------- ----- -----\n");
......@@ -468,7 +468,7 @@ VOID OsDumpPte(VADDR_T vaddr)
}
return;
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)
......@@ -505,7 +505,7 @@ VOID OsVmPhysDump(VOID)
PRINTK("\r\n phys_seg base size free_pages \n");
PRINTK(" -------- ------- ---------- --------- \n");
#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;
totalPages += (seg->size >> PAGE_SHIFT);
......
......@@ -163,7 +163,7 @@ STATIC VOID OsVmPhysFreeListAdd(LosVmPage *page, UINT8 order)
struct VmFreeList *list = NULL;
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;
......@@ -180,7 +180,7 @@ STATIC VOID OsVmPhysFreeListAddUnsafe(LosVmPage *page, UINT8 order)
struct VmFreeList *list = NULL;
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;
......@@ -242,7 +242,7 @@ LosVmPage *OsVmPhysToPage(paddr_t pa, UINT8 segID)
paddr_t offset;
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];
if ((pa < seg->start) || (pa >= (seg->start + seg->size))) {
......
......@@ -220,7 +220,7 @@ VOID *LOS_DoBrk(VOID *addr)
size = (UINTPTR)addr - (UINTPTR)space->heapBase;
size = ROUNDUP(size, PAGE_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);
if (addr < (VOID *)(UINTPTR)space->heapNow) {
......
......@@ -210,10 +210,10 @@ LITE_OS_SEC_TEXT_MINOR VOID OomSetCheckInterval(UINT32 checkInterval)
{
if ((checkInterval >= OOM_CHECK_MIN) && (checkInterval <= OOM_CHECK_MAX)) {
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);
} 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);
}
}
......
......@@ -214,7 +214,7 @@ UINT64 LOS_SizeStrToNum(CHAR *value)
UINT64 num = 0;
/* 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");
if (strspn(value, "0123456789abcdefABCDEF") < strlen(value)) {
goto ERROUT;
......@@ -223,7 +223,7 @@ UINT64 LOS_SizeStrToNum(CHAR *value)
}
/* 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");
CHAR *endPos = value + decOffset;
if ((ret <= 0) || (decOffset < (strlen(value) - 1))) {
......
......@@ -424,7 +424,7 @@ INT32 OsGetKernelVaddr(const LosVmSpace *space, VADDR_T vaddr, VADDR_T *kvaddr)
PADDR_T paddr = 0;
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;
}
......@@ -573,7 +573,7 @@ STATIC CHAR *OsGetParamPtr(CHAR * const *ptr, INT32 index)
}
ret = LOS_GetUser(&userStrPtr, (UINTPTR *)(ptr + index));
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;
}
......@@ -868,7 +868,7 @@ STATIC INT32 OsPutParamToStack(ELFLoadInfo *loadInfo, const UINTPTR *auxVecInfo,
size = LOS_ArchCopyToUser(argsPtr, auxVecInfo, vecIndex * sizeof(UINTPTR));
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;
}
......
......@@ -111,7 +111,7 @@ LITE_OS_SEC_TEXT_INIT UINT32 OsLiteIpcInit(VOID)
}
ret = (UINT32)register_driver(LITEIPC_DRIVER, &g_liteIpcFops, LITEIPC_DRIVER_MODE, NULL);
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));
for (i = 0; i < LOSCFG_BASE_CORE_PROCESS_LIMIT; i++) {
......@@ -294,15 +294,15 @@ LITE_OS_SEC_TEXT STATIC VOID EnableIpcNodeFreeByUser(UINT32 processID, VOID *buf
LITE_OS_SEC_TEXT STATIC VOID *LiteIpcNodeAlloc(UINT32 processID, UINT32 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",
processID, OS_PCB_FROM_PID(processID)->ipcInfo.pool.kvaddr, ptr, size);
PRINT_INFO("LiteIpcNodeAlloc pid:%u, pool:%x buf:%x size:%u\n",
processID, (UINTPTR)OS_PCB_FROM_PID(processID)->ipcInfo.pool.kvaddr, (UINTPTR)ptr, size);
return ptr;
}
LITE_OS_SEC_TEXT STATIC UINT32 LiteIpcNodeFree(UINT32 processID, VOID *buf)
{
PRINT_INFO("LiteIpcNodeFree pid:%d, pool:%x buf:%x\n",
processID, OS_PCB_FROM_PID(processID)->ipcInfo.pool.kvaddr, buf);
PRINT_INFO("LiteIpcNodeFree pid:%u, pool:%x buf:%x\n",
processID, (UINTPTR)OS_PCB_FROM_PID(processID)->ipcInfo.pool.kvaddr, (UINTPTR)buf);
return LOS_MemFree(OS_PCB_FROM_PID(processID)->ipcInfo.pool.kvaddr, buf);
}
......@@ -454,7 +454,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 SetIpcTask(VOID)
OsCurrProcessGet()->ipcInfo.ipcTaskID = LOS_CurTaskIDGet();
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;
}
......@@ -811,7 +811,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 CopyDataFromUser(IpcListNode *node, UINT32 bufSz,
node->msg.offsets = (VOID *)((UINTPTR)node + sizeof(IpcListNode) + msg->dataSz);
ret = copy_from_user((VOID *)(node->msg.offsets), msg->offsets, msg->spObjNum * sizeof(UINT32));
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;
}
} else {
......@@ -898,7 +898,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 CheckPara(IpcContent *content, UINT32 *dstTid)
#endif
OsHookCall(LOS_HOOK_TYPE_IPC_WRITE_DROP, msg, *dstTid,
(*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;
}
#endif
......@@ -1090,7 +1090,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 LiteIpcMsgHandle(IpcContent *con)
if ((content->flag & BUFF_FREE) == BUFF_FREE) {
ret = CheckUsedBuffer(content->buffToFree, &nodeNeedFree);
if (ret != LOS_OK) {
PRINT_ERR("CheckUsedBuffer failed:%d\n", ret);
PRINT_ERR("CheckUsedBuffer failed:%u\n", ret);
return ret;
}
}
......@@ -1136,7 +1136,7 @@ BUFFER_FREE:
UINT32 offset = LOS_OFF_SET_OF(IpcContent, inMsg);
ret = copy_to_user((char*)con + offset, (char*)content + offset, sizeof(IpcMsg *));
if (ret != LOS_OK) {
PRINT_ERR("%s, %d, %d\n", __FUNCTION__, __LINE__, ret);
PRINT_ERR("%s, %d, %u\n", __FUNCTION__, __LINE__, ret);
return -EINVAL;
}
}
......
......@@ -179,7 +179,7 @@ static ssize_t HiLogRead(struct file *filep, char *buffer, size_t bufLen)
}
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;
goto out;
}
......
......@@ -104,7 +104,7 @@ VOID OsArmA32SyscallHandle(TaskContext *regs)
UINT32 cmd = regs->reserved2;
if (cmd >= SYS_CALL_NUM) {
PRINT_ERR("Syscall ID: error %d !!!\n", cmd);
PRINT_ERR("Syscall ID: error %u !!!\n", cmd);
return;
}
......@@ -112,7 +112,7 @@ VOID OsArmA32SyscallHandle(TaskContext *regs)
nArgs = g_syscallNArgs[cmd / NARG_PER_BYTE]; /* 4bit per nargs */
nArgs = (cmd & 1) ? (nArgs >> NARG_BITS) : (nArgs & NARG_MASK);
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;
return;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册