Lines Matching full:mi
25 static int add_extra_kernel_map(struct extra_kernel_map_info *mi, u64 start, in add_extra_kernel_map() argument
28 if (mi->cnt >= mi->max_cnt) { in add_extra_kernel_map()
32 mi->max_cnt = mi->max_cnt ? mi->max_cnt * 2 : 32; in add_extra_kernel_map()
33 sz = sizeof(struct extra_kernel_map) * mi->max_cnt; in add_extra_kernel_map()
34 buf = realloc(mi->maps, sz); in add_extra_kernel_map()
37 mi->maps = buf; in add_extra_kernel_map()
40 mi->maps[mi->cnt].start = start; in add_extra_kernel_map()
41 mi->maps[mi->cnt].end = end; in add_extra_kernel_map()
42 mi->maps[mi->cnt].pgoff = pgoff; in add_extra_kernel_map()
43 strlcpy(mi->maps[mi->cnt].name, name, KMAP_NAME_LEN); in add_extra_kernel_map()
45 mi->cnt += 1; in add_extra_kernel_map()
53 struct extra_kernel_map_info *mi = arg; in find_extra_kernel_maps() local
55 if (!mi->entry_trampoline && kallsyms2elf_binding(type) == STB_GLOBAL && in find_extra_kernel_maps()
57 mi->entry_trampoline = start; in find_extra_kernel_maps()
64 return add_extra_kernel_map(mi, start, end, 0, name); in find_extra_kernel_maps()
73 struct extra_kernel_map_info mi = { .cnt = 0, }; in machine__create_extra_kernel_maps() local
83 ret = kallsyms__parse(filename, &mi, find_extra_kernel_maps); in machine__create_extra_kernel_maps()
87 if (!mi.entry_trampoline) in machine__create_extra_kernel_maps()
90 for (i = 0; i < mi.cnt; i++) { in machine__create_extra_kernel_maps()
91 struct extra_kernel_map *xm = &mi.maps[i]; in machine__create_extra_kernel_maps()
93 xm->pgoff = mi.entry_trampoline; in machine__create_extra_kernel_maps()
99 machine->trampolines_mapped = mi.cnt; in machine__create_extra_kernel_maps()
101 free(mi.maps); in machine__create_extra_kernel_maps()