Lines Matching refs:um_info

440 static u64 *check_realloc_usable_mem(struct umem_info *um_info, int cnt)  in check_realloc_usable_mem()  argument
445 if ((um_info->idx + cnt) <= um_info->max_entries) in check_realloc_usable_mem()
446 return um_info->buf; in check_realloc_usable_mem()
448 new_size = um_info->size + MEM_RANGE_CHUNK_SZ; in check_realloc_usable_mem()
449 tbuf = krealloc(um_info->buf, new_size, GFP_KERNEL); in check_realloc_usable_mem()
451 um_info->buf = tbuf; in check_realloc_usable_mem()
452 um_info->size = new_size; in check_realloc_usable_mem()
453 um_info->max_entries = (um_info->size / sizeof(u64)); in check_realloc_usable_mem()
468 static int add_usable_mem(struct umem_info *um_info, u64 base, u64 end) in add_usable_mem() argument
474 for (i = 0; i < um_info->nr_ranges; i++) { in add_usable_mem()
476 loc_base = um_info->ranges[i].start; in add_usable_mem()
477 loc_end = um_info->ranges[i].end; in add_usable_mem()
489 if (!check_realloc_usable_mem(um_info, 2)) in add_usable_mem()
492 um_info->buf[um_info->idx++] = cpu_to_be64(loc_base); in add_usable_mem()
493 um_info->buf[um_info->idx++] = in add_usable_mem()
514 struct umem_info *um_info; in kdump_setup_usable_lmb() local
527 um_info = data; in kdump_setup_usable_lmb()
528 tmp_idx = um_info->idx; in kdump_setup_usable_lmb()
529 if (!check_realloc_usable_mem(um_info, 1)) in kdump_setup_usable_lmb()
532 um_info->idx++; in kdump_setup_usable_lmb()
535 ret = add_usable_mem(um_info, base, end); in kdump_setup_usable_lmb()
541 um_info->buf[tmp_idx] = in kdump_setup_usable_lmb()
542 cpu_to_be64((um_info->idx - tmp_idx - 1) / 2); in kdump_setup_usable_lmb()
559 struct umem_info *um_info) in add_usable_mem_property() argument
590 um_info->idx = 0; in add_usable_mem_property()
591 if (!check_realloc_usable_mem(um_info, 2)) { in add_usable_mem_property()
614 ret = add_usable_mem(um_info, base, end); in add_usable_mem_property()
624 if (um_info->idx == 0) { in add_usable_mem_property()
625 um_info->buf[0] = 0; in add_usable_mem_property()
626 um_info->buf[1] = 0; in add_usable_mem_property()
627 um_info->idx = 2; in add_usable_mem_property()
630 ret = fdt_setprop(fdt, node, "linux,usable-memory", um_info->buf, in add_usable_mem_property()
631 (um_info->idx * sizeof(u64))); in add_usable_mem_property()
650 struct umem_info um_info; in update_usable_mem_fdt() local
667 um_info.buf = NULL; in update_usable_mem_fdt()
668 um_info.size = 0; in update_usable_mem_fdt()
669 um_info.max_entries = 0; in update_usable_mem_fdt()
670 um_info.idx = 0; in update_usable_mem_fdt()
672 um_info.ranges = &(usable_mem->ranges[0]); in update_usable_mem_fdt()
673 um_info.nr_ranges = usable_mem->nr_ranges; in update_usable_mem_fdt()
677 ret = walk_drmem_lmbs(dn, &um_info, kdump_setup_usable_lmb); in update_usable_mem_fdt()
686 um_info.buf, (um_info.idx * sizeof(u64))); in update_usable_mem_fdt()
698 ret = add_usable_mem_property(fdt, dn, &um_info); in update_usable_mem_fdt()
707 kfree(um_info.buf); in update_usable_mem_fdt()