Lines Matching refs:base

165 /* adjust *@size so that (@base + *@size) doesn't overflow, return new size */
166 static inline phys_addr_t memblock_cap_size(phys_addr_t base, phys_addr_t *size)
168 return *size = min(*size, PHYS_ADDR_MAX - base);
181 phys_addr_t base, phys_addr_t size)
185 memblock_cap_size(base, &size);
188 if (memblock_addrs_overlap(base, size, type->regions[i].base,
350 type->regions[0].base = 0;
511 if (this->base + this->size != next->base ||
515 BUG_ON(this->base + this->size > next->base);
531 * @base: base address of the new region
536 * Insert new memblock region [@base, @base + @size) into @type at @idx.
540 int idx, phys_addr_t base,
549 rgn->base = base;
560 * @base: base address of the new region
565 * Add new memblock region [@base, @base + @size) into @type. The new region
574 phys_addr_t base, phys_addr_t size,
578 phys_addr_t obase = base;
579 phys_addr_t end = base + memblock_cap_size(base, &size);
589 type->regions[0].base = base;
602 base = obase;
606 phys_addr_t rbase = rgn->base;
611 if (rend <= base)
617 if (rbase > base) {
624 memblock_insert_region(type, idx++, base,
625 rbase - base, nid,
629 base = min(rend, end);
633 if (base < end) {
636 memblock_insert_region(type, idx, base, end - base,
661 * @base: base address of the new region
665 * Add new memblock region [@base, @base + @size) to the "memory"
671 int __init_memblock memblock_add_node(phys_addr_t base, phys_addr_t size,
674 return memblock_add_range(&memblock.memory, base, size, nid, 0);
679 * @base: base address of the new region
682 * Add new memblock region [@base, @base + @size) to the "memory"
688 int __init_memblock memblock_add(phys_addr_t base, phys_addr_t size)
690 phys_addr_t end = base + size - 1;
693 &base, &end, (void *)_RET_IP_);
695 return memblock_add_range(&memblock.memory, base, size, MAX_NUMNODES, 0);
701 * @base: base of range to isolate
707 * [@base, @base + @size). Crossing regions are split at the boundaries,
715 phys_addr_t base, phys_addr_t size,
718 phys_addr_t end = base + memblock_cap_size(base, &size);
729 if (memblock_double_array(type, base, size) < 0)
733 phys_addr_t rbase = rgn->base;
738 if (rend <= base)
741 if (rbase < base) {
746 rgn->base = base;
747 rgn->size -= base - rbase;
748 type->total_size -= base - rbase;
749 memblock_insert_region(type, idx, rbase, base - rbase,
757 rgn->base = end;
775 phys_addr_t base, phys_addr_t size)
780 ret = memblock_isolate_range(type, base, size, &start_rgn, &end_rgn);
789 int __init_memblock memblock_remove(phys_addr_t base, phys_addr_t size)
791 phys_addr_t end = base + size - 1;
794 &base, &end, (void *)_RET_IP_);
796 return memblock_remove_range(&memblock.memory, base, size);
801 * @base: phys starting address of the boot memory block
807 int __init_memblock memblock_free(phys_addr_t base, phys_addr_t size)
809 phys_addr_t end = base + size - 1;
812 &base, &end, (void *)_RET_IP_);
814 kmemleak_free_part_phys(base, size);
815 return memblock_remove_range(&memblock.reserved, base, size);
818 int __init_memblock memblock_reserve(phys_addr_t base, phys_addr_t size)
820 phys_addr_t end = base + size - 1;
823 &base, &end, (void *)_RET_IP_);
825 return memblock_add_range(&memblock.reserved, base, size, MAX_NUMNODES, 0);
829 int __init_memblock memblock_physmem_add(phys_addr_t base, phys_addr_t size)
831 phys_addr_t end = base + size - 1;
834 &base, &end, (void *)_RET_IP_);
836 return memblock_add_range(&physmem, base, size, MAX_NUMNODES, 0);
842 * @base: base address of the region
847 * This function isolates region [@base, @base + @size), and sets/clears flag
851 static int __init_memblock memblock_setclr_flag(phys_addr_t base,
857 ret = memblock_isolate_range(type, base, size, &start_rgn, &end_rgn);
876 * @base: the base phys addr of the region
881 int __init_memblock memblock_mark_hotplug(phys_addr_t base, phys_addr_t size)
883 return memblock_setclr_flag(base, size, 1, MEMBLOCK_HOTPLUG);
888 * @base: the base phys addr of the region
893 int __init_memblock memblock_clear_hotplug(phys_addr_t base, phys_addr_t size)
895 return memblock_setclr_flag(base, size, 0, MEMBLOCK_HOTPLUG);
900 * @base: the base phys addr of the region
905 int __init_memblock memblock_mark_mirror(phys_addr_t base, phys_addr_t size)
909 return memblock_setclr_flag(base, size, 1, MEMBLOCK_MIRROR);
914 * @base: the base phys addr of the region
919 int __init_memblock memblock_mark_nomap(phys_addr_t base, phys_addr_t size)
921 return memblock_setclr_flag(base, size, 1, MEMBLOCK_NOMAP);
926 * @base: the base phys addr of the region
931 int __init_memblock memblock_clear_nomap(phys_addr_t base, phys_addr_t size)
933 return memblock_setclr_flag(base, size, 0, MEMBLOCK_NOMAP);
1007 phys_addr_t m_start = m->base;
1008 phys_addr_t m_end = m->base + m->size;
1033 r_start = idx_b ? r[-1].base + r[-1].size : 0;
1035 r->base : PHYS_ADDR_MAX;
1111 phys_addr_t m_start = m->base;
1112 phys_addr_t m_end = m->base + m->size;
1137 r_start = idx_b ? r[-1].base + r[-1].size : 0;
1139 r->base : PHYS_ADDR_MAX;
1183 if (PFN_UP(r->base) >= PFN_DOWN(r->base + r->size))
1194 *out_start_pfn = PFN_UP(r->base);
1196 *out_end_pfn = PFN_DOWN(r->base + r->size);
1203 * @base: base of area to set node ID for
1208 * Set the nid of memblock @type regions in [@base, @base + @size) to @nid.
1214 int __init_memblock memblock_set_node(phys_addr_t base, phys_addr_t size,
1221 ret = memblock_isolate_range(type, base, size, &start_rgn, &end_rgn);
1581 * @base: phys starting address of the boot memory block
1588 void __init __memblock_free_late(phys_addr_t base, phys_addr_t size)
1592 end = base + size - 1;
1594 __func__, &base, &end, (void *)_RET_IP_);
1595 kmemleak_free_part_phys(base, size);
1596 cursor = PFN_UP(base);
1597 end = PFN_DOWN(base + size);
1622 return memblock.memory.regions[0].base;
1629 return (memblock.memory.regions[idx].base + memblock.memory.regions[idx].size);
1644 max_addr = r->base + limit;
1673 void __init memblock_cap_memory_range(phys_addr_t base, phys_addr_t size)
1681 ret = memblock_isolate_range(&memblock.memory, base, size,
1696 memblock_remove_range(&memblock.reserved, 0, base);
1698 base + size, PHYS_ADDR_MAX);
1724 if (addr < type->regions[mid].base)
1726 else if (addr >= (type->regions[mid].base +
1763 *start_pfn = PFN_DOWN(type->regions[mid].base);
1764 *end_pfn = PFN_DOWN(type->regions[mid].base + type->regions[mid].size);
1771 * @base: base of region to check
1774 * Check if the region [@base, @base + @size) is a subset of a memory block.
1779 bool __init_memblock memblock_is_region_memory(phys_addr_t base, phys_addr_t size)
1781 int idx = memblock_search(&memblock.memory, base);
1782 phys_addr_t end = base + memblock_cap_size(base, &size);
1786 return (memblock.memory.regions[idx].base +
1792 * @base: base of region to check
1795 * Check if the region [@base, @base + @size) intersects a reserved
1801 bool __init_memblock memblock_is_region_reserved(phys_addr_t base, phys_addr_t size)
1803 return memblock_overlaps_region(&memblock.reserved, base, size);
1812 orig_start = r->base;
1813 orig_end = r->base + r->size;
1821 r->base = start;
1843 phys_addr_t base, end, size;
1853 base = rgn->base;
1855 end = base + size - 1;
1863 type->name, idx, &base, &end, &size, nid_buf, flags);
2005 end = reg->base + reg->size - 1;
2008 seq_printf(m, "%pa..%pa\n", &reg->base, &end);