Lines Matching refs:m

333 	struct mobj_protmem *m = NULL;  in check_protmem_conflict()  local
336 SLIST_FOREACH(m, &protmem_list, next) { in check_protmem_conflict()
337 res = check_reg_shm_conflict(r, m->pa, m->mobj.size); in check_protmem_conflict()
420 struct mobj_protmem *m = NULL; in protmem_find_unlocked() local
422 SLIST_FOREACH(m, &protmem_list, next) in protmem_find_unlocked()
423 if (m->cookie == cookie) in protmem_find_unlocked()
424 return m; in protmem_find_unlocked()
434 struct mobj *m = NULL; in mobj_reg_shm_get_by_cookie() local
439 m = mobj_get(&rs->mobj); in mobj_reg_shm_get_by_cookie()
444 m = mobj_get(&rm->mobj); in mobj_reg_shm_get_by_cookie()
449 return m; in mobj_reg_shm_get_by_cookie()
564 static TEE_Result protect_mem(struct mobj_protmem *m) in protect_mem() argument
566 if ((m->pa | m->mobj.size) & SMALL_PAGE_MASK) in protect_mem()
570 m->use_case, m->pa, m->mobj.size); in protect_mem()
572 return plat_set_protmem_range(m->use_case, m->pa, m->mobj.size); in protect_mem()
575 static TEE_Result restore_mem(struct mobj_protmem *m) in restore_mem() argument
578 m->use_case, m->pa, m->mobj.size); in restore_mem()
580 return plat_set_protmem_range(MOBJ_USE_CASE_NS_SHM, m->pa, in restore_mem()
581 m->mobj.size); in restore_mem()
587 struct mobj_protmem *m = to_mobj_protmem(mobj); in mobj_protmem_get_pa() local
596 p = m->pa + offs; in mobj_protmem_get_pa()
695 struct mobj_protmem *m = NULL; in mobj_protmem_alloc() local
702 m = calloc(1, sizeof(*m)); in mobj_protmem_alloc()
703 if (!m) in mobj_protmem_alloc()
706 m->mobj.ops = &mobj_protmem_ops; in mobj_protmem_alloc()
707 m->use_case = use_case; in mobj_protmem_alloc()
708 m->mobj.size = size; in mobj_protmem_alloc()
709 m->mobj.phys_granule = SMALL_PAGE_SIZE; in mobj_protmem_alloc()
710 refcount_set(&m->mobj.refc, 1); in mobj_protmem_alloc()
711 m->cookie = cookie; in mobj_protmem_alloc()
712 m->pa = pa; in mobj_protmem_alloc()
719 res = protect_mem(m); in mobj_protmem_alloc()
722 SLIST_INSERT_HEAD(&protmem_list, m, next); in mobj_protmem_alloc()
727 free(m); in mobj_protmem_alloc()
731 return &m->mobj; in mobj_protmem_alloc()
795 struct mobj_protmem *m = NULL; in protmem_find_by_pa_unlocked() local
800 SLIST_FOREACH(m, &protmem_list, next) in protmem_find_by_pa_unlocked()
801 if (core_is_buffer_inside(pa, sz, m->pa, m->mobj.size)) in protmem_find_by_pa_unlocked()
802 return m; in protmem_find_by_pa_unlocked()