Lines Matching refs:top
552 static inline int ehea_init_bmap(struct ehea_bmap *ehea_bmap, int top, int dir) in ehea_init_bmap() argument
554 if (!ehea_bmap->top[top]) { in ehea_init_bmap()
555 ehea_bmap->top[top] = in ehea_init_bmap()
557 if (!ehea_bmap->top[top]) in ehea_init_bmap()
560 return ehea_init_top_bmap(ehea_bmap->top[top], dir); in ehea_init_bmap()
572 int top, dir, idx; in ehea_rebuild_busmap() local
574 for (top = 0; top < EHEA_MAP_ENTRIES; top++) { in ehea_rebuild_busmap()
578 if (!ehea_bmap->top[top]) in ehea_rebuild_busmap()
580 ehea_top = ehea_bmap->top[top]; in ehea_rebuild_busmap()
602 ehea_bmap->top[top] = NULL; in ehea_rebuild_busmap()
626 int top = ehea_calc_index(i, EHEA_TOP_INDEX_SHIFT); in ehea_update_busmap() local
631 int ret = ehea_init_bmap(ehea_bmap, top, dir); in ehea_update_busmap()
637 if (!ehea_bmap->top[top]) in ehea_update_busmap()
639 if (!ehea_bmap->top[top]->dir[dir]) in ehea_update_busmap()
645 ehea_bmap->top[top]->dir[dir]->ent[idx] = flag; in ehea_update_busmap()
732 int top, dir; in ehea_destroy_busmap() local
737 for (top = 0; top < EHEA_MAP_ENTRIES; top++) { in ehea_destroy_busmap()
738 if (!ehea_bmap->top[top]) in ehea_destroy_busmap()
742 if (!ehea_bmap->top[top]->dir[dir]) in ehea_destroy_busmap()
745 kfree(ehea_bmap->top[top]->dir[dir]); in ehea_destroy_busmap()
748 kfree(ehea_bmap->top[top]); in ehea_destroy_busmap()
759 int top, dir, idx; in ehea_map_vaddr() local
766 top = (index >> EHEA_TOP_INDEX_SHIFT) & EHEA_INDEX_MASK; in ehea_map_vaddr()
767 if (!ehea_bmap->top[top]) in ehea_map_vaddr()
771 if (!ehea_bmap->top[top]->dir[dir]) in ehea_map_vaddr()
775 if (!ehea_bmap->top[top]->dir[dir]->ent[idx]) in ehea_map_vaddr()
779 return ehea_bmap->top[top]->dir[dir]->ent[idx] | offset; in ehea_map_vaddr()
782 static inline void *ehea_calc_sectbase(int top, int dir, int idx) in ehea_calc_sectbase() argument
786 ret |= top << EHEA_TOP_INDEX_SHIFT; in ehea_calc_sectbase()
790 static u64 ehea_reg_mr_section(int top, int dir, int idx, u64 *pt, in ehea_reg_mr_section() argument
799 void *sectbase = ehea_calc_sectbase(top, dir, idx); in ehea_reg_mr_section()
821 static u64 ehea_reg_mr_sections(int top, int dir, u64 *pt, in ehea_reg_mr_sections() argument
829 if (!ehea_bmap->top[top]->dir[dir]->ent[idx]) in ehea_reg_mr_sections()
832 hret = ehea_reg_mr_section(top, dir, idx, pt, adapter, mr); in ehea_reg_mr_sections()
839 static u64 ehea_reg_mr_dir_sections(int top, u64 *pt, in ehea_reg_mr_dir_sections() argument
847 if (!ehea_bmap->top[top]->dir[dir]) in ehea_reg_mr_dir_sections()
850 hret = ehea_reg_mr_sections(top, dir, pt, adapter, mr); in ehea_reg_mr_dir_sections()
864 unsigned long top; in ehea_reg_kernel_mr() local
890 for (top = 0; top < EHEA_MAP_ENTRIES; top++) { in ehea_reg_kernel_mr()
891 if (!ehea_bmap->top[top]) in ehea_reg_kernel_mr()
894 hret = ehea_reg_mr_dir_sections(top, pt, adapter, mr); in ehea_reg_kernel_mr()