Lines Matching refs:um_info
442 static u64 *check_realloc_usable_mem(struct umem_info *um_info, int cnt) in check_realloc_usable_mem() argument
447 if ((um_info->idx + cnt) <= um_info->max_entries) in check_realloc_usable_mem()
448 return um_info->buf; in check_realloc_usable_mem()
450 new_size = um_info->size + MEM_RANGE_CHUNK_SZ; in check_realloc_usable_mem()
451 tbuf = krealloc(um_info->buf, new_size, GFP_KERNEL); in check_realloc_usable_mem()
453 um_info->buf = tbuf; in check_realloc_usable_mem()
454 um_info->size = new_size; in check_realloc_usable_mem()
455 um_info->max_entries = (um_info->size / sizeof(u64)); in check_realloc_usable_mem()
470 static int add_usable_mem(struct umem_info *um_info, u64 base, u64 end) in add_usable_mem() argument
476 for (i = 0; i < um_info->nr_ranges; i++) { in add_usable_mem()
478 loc_base = um_info->ranges[i].start; in add_usable_mem()
479 loc_end = um_info->ranges[i].end; in add_usable_mem()
491 if (!check_realloc_usable_mem(um_info, 2)) in add_usable_mem()
494 um_info->buf[um_info->idx++] = cpu_to_be64(loc_base); in add_usable_mem()
495 um_info->buf[um_info->idx++] = in add_usable_mem()
516 struct umem_info *um_info; in kdump_setup_usable_lmb() local
529 um_info = data; in kdump_setup_usable_lmb()
530 tmp_idx = um_info->idx; in kdump_setup_usable_lmb()
531 if (!check_realloc_usable_mem(um_info, 1)) in kdump_setup_usable_lmb()
534 um_info->idx++; in kdump_setup_usable_lmb()
537 ret = add_usable_mem(um_info, base, end); in kdump_setup_usable_lmb()
543 um_info->buf[tmp_idx] = in kdump_setup_usable_lmb()
544 cpu_to_be64((um_info->idx - tmp_idx - 1) / 2); in kdump_setup_usable_lmb()
561 struct umem_info *um_info) in add_usable_mem_property() argument
592 um_info->idx = 0; in add_usable_mem_property()
593 if (!check_realloc_usable_mem(um_info, 2)) { in add_usable_mem_property()
616 ret = add_usable_mem(um_info, base, end); in add_usable_mem_property()
626 if (um_info->idx == 0) { in add_usable_mem_property()
627 um_info->buf[0] = 0; in add_usable_mem_property()
628 um_info->buf[1] = 0; in add_usable_mem_property()
629 um_info->idx = 2; in add_usable_mem_property()
632 ret = fdt_setprop(fdt, node, "linux,usable-memory", um_info->buf, in add_usable_mem_property()
633 (um_info->idx * sizeof(u64))); in add_usable_mem_property()
652 struct umem_info um_info; in update_usable_mem_fdt() local
669 um_info.buf = NULL; in update_usable_mem_fdt()
670 um_info.size = 0; in update_usable_mem_fdt()
671 um_info.max_entries = 0; in update_usable_mem_fdt()
672 um_info.idx = 0; in update_usable_mem_fdt()
674 um_info.ranges = &(usable_mem->ranges[0]); in update_usable_mem_fdt()
675 um_info.nr_ranges = usable_mem->nr_ranges; in update_usable_mem_fdt()
679 ret = walk_drmem_lmbs(dn, &um_info, kdump_setup_usable_lmb); in update_usable_mem_fdt()
688 um_info.buf, (um_info.idx * sizeof(u64))); in update_usable_mem_fdt()
700 ret = add_usable_mem_property(fdt, dn, &um_info); in update_usable_mem_fdt()
710 kfree(um_info.buf); in update_usable_mem_fdt()