Lines Matching refs:mgr
112 struct tee_shm_pool_mgr *mgr; in tee_shm_pool_mgr_alloc_res_mem() local
119 mgr = kzalloc(sizeof(*mgr), GFP_KERNEL); in tee_shm_pool_mgr_alloc_res_mem()
120 if (!mgr) in tee_shm_pool_mgr_alloc_res_mem()
123 mgr->private_data = gen_pool_create(min_alloc_order, -1); in tee_shm_pool_mgr_alloc_res_mem()
124 if (!mgr->private_data) { in tee_shm_pool_mgr_alloc_res_mem()
129 gen_pool_set_algo(mgr->private_data, gen_pool_best_fit, NULL); in tee_shm_pool_mgr_alloc_res_mem()
130 rc = gen_pool_add_virt(mgr->private_data, vaddr, paddr, size, -1); in tee_shm_pool_mgr_alloc_res_mem()
132 gen_pool_destroy(mgr->private_data); in tee_shm_pool_mgr_alloc_res_mem()
136 mgr->ops = &pool_ops_generic; in tee_shm_pool_mgr_alloc_res_mem()
138 return mgr; in tee_shm_pool_mgr_alloc_res_mem()
140 kfree(mgr); in tee_shm_pool_mgr_alloc_res_mem()
146 static bool check_mgr_ops(struct tee_shm_pool_mgr *mgr) in check_mgr_ops() argument
148 return mgr && mgr->ops && mgr->ops->alloc && mgr->ops->free && in check_mgr_ops()
149 mgr->ops->destroy_poolmgr; in check_mgr_ops()