Lines Matching refs:mem

923 				       struct param_mem *mem, void **user_va)  in param_mem_to_user_va()  argument
933 if (mem->mobj != region->mobj) in param_mem_to_user_va()
936 phys_offs = mobj_get_phys_offs(mem->mobj, in param_mem_to_user_va()
938 phys_offs += mem->offs; in param_mem_to_user_va()
985 struct param_mem mem[TEE_NUM_PARAMS]; in vm_map_param() local
987 memset(mem, 0, sizeof(mem)); in vm_map_param()
996 phys_offs = mobj_get_phys_offs(param->u[n].mem.mobj, in vm_map_param()
998 mem[n].mobj = param->u[n].mem.mobj; in vm_map_param()
999 mem[n].offs = ROUNDDOWN(phys_offs + param->u[n].mem.offs, in vm_map_param()
1001 mem[n].size = ROUNDUP(phys_offs + param->u[n].mem.offs - in vm_map_param()
1002 mem[n].offs + param->u[n].mem.size, in vm_map_param()
1008 if (!mem[n].size) in vm_map_param()
1009 mem[n].size = CORE_MMU_USER_PARAM_SIZE; in vm_map_param()
1020 qsort(mem, TEE_NUM_PARAMS, sizeof(struct param_mem), cmp_param_mem); in vm_map_param()
1022 for (n = 1, m = 0; n < TEE_NUM_PARAMS && mem[n].mobj; n++) { in vm_map_param()
1023 if (mem[n].mobj == mem[m].mobj && in vm_map_param()
1024 (mem[n].offs == (mem[m].offs + mem[m].size) || in vm_map_param()
1025 core_is_buffer_intersect(mem[m].offs, mem[m].size, in vm_map_param()
1026 mem[n].offs, mem[n].size))) { in vm_map_param()
1027 mem[m].size = mem[n].offs + mem[n].size - mem[m].offs; in vm_map_param()
1032 mem[m] = mem[n]; in vm_map_param()
1039 if (mem[0].mobj) in vm_map_param()
1047 res = vm_map(uctx, &va, mem[n].size, in vm_map_param()
1050 mem[n].mobj, mem[n].offs); in vm_map_param()
1062 if (!param->u[n].mem.mobj) in vm_map_param()
1065 res = param_mem_to_user_va(uctx, &param->u[n].mem, in vm_map_param()