Lines Matching refs:base
174 /* adjust *@size so that (@base + *@size) doesn't overflow, return new size */
175 static inline phys_addr_t memblock_cap_size(phys_addr_t base, phys_addr_t *size)
177 return *size = min(*size, PHYS_ADDR_MAX - base);
191 phys_addr_t base, phys_addr_t size)
195 memblock_cap_size(base, &size);
198 if (memblock_addrs_overlap(base, size, type->regions[i].base,
360 type->regions[0].base = 0;
525 if (this->base + this->size != next->base ||
529 BUG_ON(this->base + this->size > next->base);
546 * @base: base address of the new region
551 * Insert new memblock region [@base, @base + @size) into @type at @idx.
555 int idx, phys_addr_t base,
564 rgn->base = base;
575 * @base: base address of the new region
580 * Add new memblock region [@base, @base + @size) into @type. The new region
589 phys_addr_t base, phys_addr_t size,
593 phys_addr_t obase = base;
594 phys_addr_t end = base + memblock_cap_size(base, &size);
604 type->regions[0].base = base;
628 base = obase;
632 phys_addr_t rbase = rgn->base;
637 if (rend <= base)
643 if (rbase > base) {
653 memblock_insert_region(type, idx++, base,
654 rbase - base, nid,
659 base = min(rend, end);
663 if (base < end) {
669 memblock_insert_region(type, idx, base, end - base,
695 * @base: base address of the new region
700 * Add new memblock region [@base, @base + @size) to the "memory"
706 int __init_memblock memblock_add_node(phys_addr_t base, phys_addr_t size,
709 phys_addr_t end = base + size - 1;
712 &base, &end, nid, flags, (void *)_RET_IP_);
714 return memblock_add_range(&memblock.memory, base, size, nid, flags);
719 * @base: base address of the new region
722 * Add new memblock region [@base, @base + @size) to the "memory"
728 int __init_memblock memblock_add(phys_addr_t base, phys_addr_t size)
730 phys_addr_t end = base + size - 1;
733 &base, &end, (void *)_RET_IP_);
735 return memblock_add_range(&memblock.memory, base, size, MAX_NUMNODES, 0);
741 * @base: base of range to isolate
747 * [@base, @base + @size). Crossing regions are split at the boundaries,
755 phys_addr_t base, phys_addr_t size,
758 phys_addr_t end = base + memblock_cap_size(base, &size);
769 if (memblock_double_array(type, base, size) < 0)
773 phys_addr_t rbase = rgn->base;
778 if (rend <= base)
781 if (rbase < base) {
786 rgn->base = base;
787 rgn->size -= base - rbase;
788 type->total_size -= base - rbase;
789 memblock_insert_region(type, idx, rbase, base - rbase,
797 rgn->base = end;
815 phys_addr_t base, phys_addr_t size)
820 ret = memblock_isolate_range(type, base, size, &start_rgn, &end_rgn);
829 int __init_memblock memblock_remove(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_remove_range(&memblock.memory, base, size);
855 * @base: phys starting address of the boot memory block
861 int __init_memblock memblock_phys_free(phys_addr_t base, phys_addr_t size)
863 phys_addr_t end = base + size - 1;
866 &base, &end, (void *)_RET_IP_);
868 kmemleak_free_part_phys(base, size);
869 return memblock_remove_range(&memblock.reserved, base, size);
872 int __init_memblock memblock_reserve(phys_addr_t base, phys_addr_t size)
874 phys_addr_t end = base + size - 1;
877 &base, &end, (void *)_RET_IP_);
879 return memblock_add_range(&memblock.reserved, base, size, MAX_NUMNODES, 0);
883 int __init_memblock memblock_physmem_add(phys_addr_t base, phys_addr_t size)
885 phys_addr_t end = base + size - 1;
888 &base, &end, (void *)_RET_IP_);
890 return memblock_add_range(&physmem, base, size, MAX_NUMNODES, 0);
896 * @base: base address of the region
901 * This function isolates region [@base, @base + @size), and sets/clears flag
905 static int __init_memblock memblock_setclr_flag(phys_addr_t base,
911 ret = memblock_isolate_range(type, base, size, &start_rgn, &end_rgn);
930 * @base: the base phys addr of the region
935 int __init_memblock memblock_mark_hotplug(phys_addr_t base, phys_addr_t size)
937 return memblock_setclr_flag(base, size, 1, MEMBLOCK_HOTPLUG);
942 * @base: the base phys addr of the region
947 int __init_memblock memblock_clear_hotplug(phys_addr_t base, phys_addr_t size)
949 return memblock_setclr_flag(base, size, 0, MEMBLOCK_HOTPLUG);
954 * @base: the base phys addr of the region
959 int __init_memblock memblock_mark_mirror(phys_addr_t base, phys_addr_t size)
966 return memblock_setclr_flag(base, size, 1, MEMBLOCK_MIRROR);
971 * @base: the base phys addr of the region
984 int __init_memblock memblock_mark_nomap(phys_addr_t base, phys_addr_t size)
986 return memblock_setclr_flag(base, size, 1, MEMBLOCK_NOMAP);
991 * @base: the base phys addr of the region
996 int __init_memblock memblock_clear_nomap(phys_addr_t base, phys_addr_t size)
998 return memblock_setclr_flag(base, size, 0, MEMBLOCK_NOMAP);
1076 phys_addr_t m_start = m->base;
1077 phys_addr_t m_end = m->base + m->size;
1102 r_start = idx_b ? r[-1].base + r[-1].size : 0;
1104 r->base : PHYS_ADDR_MAX;
1180 phys_addr_t m_start = m->base;
1181 phys_addr_t m_end = m->base + m->size;
1206 r_start = idx_b ? r[-1].base + r[-1].size : 0;
1208 r->base : PHYS_ADDR_MAX;
1252 if (PFN_UP(r->base) >= PFN_DOWN(r->base + r->size))
1263 *out_start_pfn = PFN_UP(r->base);
1265 *out_end_pfn = PFN_DOWN(r->base + r->size);
1272 * @base: base of area to set node ID for
1277 * Set the nid of memblock @type regions in [@base, @base + @size) to @nid.
1283 int __init_memblock memblock_set_node(phys_addr_t base, phys_addr_t size,
1290 ret = memblock_isolate_range(type, base, size, &start_rgn, &end_rgn);
1652 * @base: phys starting address of the boot memory block
1659 void __init memblock_free_late(phys_addr_t base, phys_addr_t size)
1663 end = base + size - 1;
1665 __func__, &base, &end, (void *)_RET_IP_);
1666 kmemleak_free_part_phys(base, size);
1667 cursor = PFN_UP(base);
1668 end = PFN_DOWN(base + size);
1693 return memblock.memory.regions[0].base;
1700 return (memblock.memory.regions[idx].base + memblock.memory.regions[idx].size);
1715 max_addr = r->base + limit;
1744 void __init memblock_cap_memory_range(phys_addr_t base, phys_addr_t size)
1757 ret = memblock_isolate_range(&memblock.memory, base, size,
1772 memblock_remove_range(&memblock.reserved, 0, base);
1774 base + size, PHYS_ADDR_MAX);
1800 if (addr < type->regions[mid].base)
1802 else if (addr >= (type->regions[mid].base +
1839 *start_pfn = PFN_DOWN(type->regions[mid].base);
1840 *end_pfn = PFN_DOWN(type->regions[mid].base + type->regions[mid].size);
1847 * @base: base of region to check
1850 * Check if the region [@base, @base + @size) is a subset of a memory block.
1855 bool __init_memblock memblock_is_region_memory(phys_addr_t base, phys_addr_t size)
1857 int idx = memblock_search(&memblock.memory, base);
1858 phys_addr_t end = base + memblock_cap_size(base, &size);
1862 return (memblock.memory.regions[idx].base +
1868 * @base: base of region to check
1871 * Check if the region [@base, @base + @size) intersects a reserved
1877 bool __init_memblock memblock_is_region_reserved(phys_addr_t base, phys_addr_t size)
1879 return memblock_overlaps_region(&memblock.reserved, base, size);
1888 orig_start = r->base;
1889 orig_end = r->base + r->size;
1897 r->base = start;
1919 phys_addr_t base, end, size;
1929 base = rgn->base;
1931 end = base + size - 1;
1939 type->name, idx, &base, &end, &size, nid_buf, flags);
2108 start = region->base;
2120 start = region->base;
2207 end = reg->base + reg->size - 1;
2211 seq_printf(m, "%pa..%pa ", ®->base, &end);