364 VM_ERR(
"vm space not exists, vaddr: %#x", vaddr);
365 status = LOS_ERRNO_VM_NOT_FOUND;
371 VM_ERR(
"user space not allowed to access invalid address: %#x", vaddr);
372 return LOS_ERRNO_VM_ACCESS_DENIED;
377 if (region == NULL) {
378 VM_ERR(
"region not exists, vaddr: %#x", vaddr);
379 status = LOS_ERRNO_VM_NOT_FOUND;
384 if (status != LOS_OK) {
385 status = LOS_ERRNO_VM_ACCESS_DENIED;
395 status = LOS_ERRNO_VM_NO_MEMORY;
399 vaddr = ROUNDDOWN(vaddr, PAGE_SIZE);
405 vmPgFault.
vaddr = vaddr;
407 vmPgFault.
flags = flags;
412 VM_ERR(
"vm fault error, status=%d", status);
420 if (newPage == NULL) {
421 status = LOS_ERRNO_VM_NO_MEMORY;
425 newPaddr = VM_PAGE_TO_PHYS(newPage);
432 if (newPaddr == oldPaddr) {
440 VM_ERR(
"failed to map replacement page, status:%d", status);
441 status = LOS_ERRNO_VM_MAP_FAILED;
452 VM_ERR(
"failed to map page, status:%d", status);
453 status = LOS_ERRNO_VM_MAP_FAILED;
461 if (newPage != NULL) {
LITE_OS_SEC_TEXT_MINOR BOOL OomCheckProcess(VOID)
STATIC VOID OsFaultTryFixup(ExcContext *frame, VADDR_T excVaddr, STATUS_T *status)
STATIC STATUS_T OsVmRegionPermissionCheck(LosVmMapRegion *region, UINT32 flags)
STATIC STATUS_T OsDoFileFault(LosVmMapRegion *region, LosVmPgFault *vmPgFault, UINT32 flags)
BOOL LOS_IsRegionFileValid(LosVmMapRegion *region)
映射类型为文件的线性区是否有效
LosVmSpace * LOS_SpaceGet(VADDR_T vaddr)
获取虚拟地址对应的进程空间结构体指针
STATIC INLINE BOOL LOS_IsUserAddress(VADDR_T vaddr)
虚拟地址是否在用户空间
LosVmMapRegion * LOS_RegionFind(LosVmSpace *vmSpace, VADDR_T addr)
查找线性区 根据起始地址在进程空间内查找是否存在