Skip to content

Commit

Permalink
Merge branch 'lmb-to-memblock' of git://git.kernel.org/pub/scm/linux/…
Browse files Browse the repository at this point in the history
…kernel/git/benh/powerpc

* 'lmb-to-memblock' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
  lmb: rename to memblock
  • Loading branch information
torvalds committed Jul 15, 2010
2 parents ea4c1a7 + 95f72d1 commit 6f7dd68
Show file tree
Hide file tree
Showing 72 changed files with 1,025 additions and 1,025 deletions.
2 changes: 1 addition & 1 deletion Documentation/kernel-parameters.txt
Expand Up @@ -1265,7 +1265,7 @@ and is between 256 and 4096 characters. It is defined in the file
If there are multiple matching configurations changing
the same attribute, the last one is used.

lmb=debug [KNL] Enable lmb debug messages.
memblock=debug [KNL] Enable memblock debug messages.

load_ramdisk= [RAM] List of ramdisks to load from floppy
See Documentation/blockdev/ramdisk.txt.
Expand Down
2 changes: 1 addition & 1 deletion arch/microblaze/Kconfig
Expand Up @@ -5,7 +5,7 @@ mainmenu "Linux/Microblaze Kernel Configuration"

config MICROBLAZE
def_bool y
select HAVE_LMB
select HAVE_MEMBLOCK
select HAVE_FUNCTION_TRACER
select HAVE_FUNCTION_TRACE_MCOUNT_TEST
select HAVE_FUNCTION_GRAPH_TRACER
Expand Down
Expand Up @@ -6,12 +6,12 @@
* for more details.
*/

#ifndef _ASM_MICROBLAZE_LMB_H
#define _ASM_MICROBLAZE_LMB_H
#ifndef _ASM_MICROBLAZE_MEMBLOCK_H
#define _ASM_MICROBLAZE_MEMBLOCK_H

/* LMB limit is OFF */
#define LMB_REAL_LIMIT 0xFFFFFFFF
/* MEMBLOCK limit is OFF */
#define MEMBLOCK_REAL_LIMIT 0xFFFFFFFF

#endif /* _ASM_MICROBLAZE_LMB_H */
#endif /* _ASM_MICROBLAZE_MEMBLOCK_H */


14 changes: 7 additions & 7 deletions arch/microblaze/kernel/prom.c
Expand Up @@ -29,7 +29,7 @@
#include <linux/kexec.h>
#include <linux/debugfs.h>
#include <linux/irq.h>
#include <linux/lmb.h>
#include <linux/memblock.h>

#include <asm/prom.h>
#include <asm/page.h>
Expand All @@ -49,12 +49,12 @@ void __init early_init_dt_scan_chosen_arch(unsigned long node)

void __init early_init_dt_add_memory_arch(u64 base, u64 size)
{
lmb_add(base, size);
memblock_add(base, size);
}

u64 __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
{
return lmb_alloc(size, align);
return memblock_alloc(size, align);
}

#ifdef CONFIG_EARLY_PRINTK
Expand Down Expand Up @@ -104,18 +104,18 @@ void __init early_init_devtree(void *params)
*/
of_scan_flat_dt(early_init_dt_scan_chosen, NULL);

/* Scan memory nodes and rebuild LMBs */
lmb_init();
/* Scan memory nodes and rebuild MEMBLOCKs */
memblock_init();
of_scan_flat_dt(early_init_dt_scan_root, NULL);
of_scan_flat_dt(early_init_dt_scan_memory, NULL);

/* Save command line for /proc/cmdline and then parse parameters */
strlcpy(boot_command_line, cmd_line, COMMAND_LINE_SIZE);
parse_early_param();

lmb_analyze();
memblock_analyze();

pr_debug("Phys. mem: %lx\n", (unsigned long) lmb_phys_mem_size());
pr_debug("Phys. mem: %lx\n", (unsigned long) memblock_phys_mem_size());

pr_debug(" <- early_init_devtree()\n");
}
Expand Down
40 changes: 20 additions & 20 deletions arch/microblaze/mm/init.c
Expand Up @@ -10,7 +10,7 @@
#include <linux/bootmem.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/lmb.h>
#include <linux/memblock.h>
#include <linux/mm.h> /* mem_init */
#include <linux/initrd.h>
#include <linux/pagemap.h>
Expand Down Expand Up @@ -76,10 +76,10 @@ void __init setup_memory(void)
u32 kernel_align_start, kernel_align_size;

/* Find main memory where is the kernel */
for (i = 0; i < lmb.memory.cnt; i++) {
memory_start = (u32) lmb.memory.region[i].base;
memory_end = (u32) lmb.memory.region[i].base
+ (u32) lmb.memory.region[i].size;
for (i = 0; i < memblock.memory.cnt; i++) {
memory_start = (u32) memblock.memory.region[i].base;
memory_end = (u32) memblock.memory.region[i].base
+ (u32) memblock.memory.region[i].size;
if ((memory_start <= (u32)_text) &&
((u32)_text <= memory_end)) {
memory_size = memory_end - memory_start;
Expand All @@ -100,7 +100,7 @@ void __init setup_memory(void)
kernel_align_start = PAGE_DOWN((u32)_text);
/* ALIGN can be remove because _end in vmlinux.lds.S is align */
kernel_align_size = PAGE_UP((u32)klimit) - kernel_align_start;
lmb_reserve(kernel_align_start, kernel_align_size);
memblock_reserve(kernel_align_start, kernel_align_size);
printk(KERN_INFO "%s: kernel addr=0x%08x-0x%08x size=0x%08x\n",
__func__, kernel_align_start, kernel_align_start
+ kernel_align_size, kernel_align_size);
Expand Down Expand Up @@ -141,18 +141,18 @@ void __init setup_memory(void)
map_size = init_bootmem_node(&contig_page_data,
PFN_UP(TOPHYS((u32)klimit)), min_low_pfn, max_low_pfn);
#endif
lmb_reserve(PFN_UP(TOPHYS((u32)klimit)) << PAGE_SHIFT, map_size);
memblock_reserve(PFN_UP(TOPHYS((u32)klimit)) << PAGE_SHIFT, map_size);

/* free bootmem is whole main memory */
free_bootmem(memory_start, memory_size);

/* reserve allocate blocks */
for (i = 0; i < lmb.reserved.cnt; i++) {
for (i = 0; i < memblock.reserved.cnt; i++) {
pr_debug("reserved %d - 0x%08x-0x%08x\n", i,
(u32) lmb.reserved.region[i].base,
(u32) lmb_size_bytes(&lmb.reserved, i));
reserve_bootmem(lmb.reserved.region[i].base,
lmb_size_bytes(&lmb.reserved, i) - 1, BOOTMEM_DEFAULT);
(u32) memblock.reserved.region[i].base,
(u32) memblock_size_bytes(&memblock.reserved, i));
reserve_bootmem(memblock.reserved.region[i].base,
memblock_size_bytes(&memblock.reserved, i) - 1, BOOTMEM_DEFAULT);
}
#ifdef CONFIG_MMU
init_bootmem_done = 1;
Expand Down Expand Up @@ -235,7 +235,7 @@ static void mm_cmdline_setup(void)
if (maxmem && memory_size > maxmem) {
memory_size = maxmem;
memory_end = memory_start + memory_size;
lmb.memory.region[0].size = memory_size;
memblock.memory.region[0].size = memory_size;
}
}
}
Expand Down Expand Up @@ -273,19 +273,19 @@ asmlinkage void __init mmu_init(void)
{
unsigned int kstart, ksize;

if (!lmb.reserved.cnt) {
if (!memblock.reserved.cnt) {
printk(KERN_EMERG "Error memory count\n");
machine_restart(NULL);
}

if ((u32) lmb.memory.region[0].size < 0x1000000) {
if ((u32) memblock.memory.region[0].size < 0x1000000) {
printk(KERN_EMERG "Memory must be greater than 16MB\n");
machine_restart(NULL);
}
/* Find main memory where the kernel is */
memory_start = (u32) lmb.memory.region[0].base;
memory_end = (u32) lmb.memory.region[0].base +
(u32) lmb.memory.region[0].size;
memory_start = (u32) memblock.memory.region[0].base;
memory_end = (u32) memblock.memory.region[0].base +
(u32) memblock.memory.region[0].size;
memory_size = memory_end - memory_start;

mm_cmdline_setup(); /* FIXME parse args from command line - not used */
Expand All @@ -297,7 +297,7 @@ asmlinkage void __init mmu_init(void)
kstart = __pa(CONFIG_KERNEL_START); /* kernel start */
/* kernel size */
ksize = PAGE_ALIGN(((u32)_end - (u32)CONFIG_KERNEL_START));
lmb_reserve(kstart, ksize);
memblock_reserve(kstart, ksize);

#if defined(CONFIG_BLK_DEV_INITRD)
/* Remove the init RAM disk from the available memory. */
Expand Down Expand Up @@ -335,7 +335,7 @@ void __init *early_get_page(void)
* Mem start + 32MB -> here is limit
* because of mem mapping from head.S
*/
p = __va(lmb_alloc_base(PAGE_SIZE, PAGE_SIZE,
p = __va(memblock_alloc_base(PAGE_SIZE, PAGE_SIZE,
memory_start + 0x2000000));
}
return p;
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/Kconfig
Expand Up @@ -132,7 +132,7 @@ config PPC
select HAVE_ARCH_KGDB
select HAVE_KRETPROBES
select HAVE_ARCH_TRACEHOOK
select HAVE_LMB
select HAVE_MEMBLOCK
select HAVE_DMA_ATTRS
select HAVE_DMA_API_DEBUG
select USE_GENERIC_SMP_HELPERS if SMP
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/include/asm/abs_addr.h
Expand Up @@ -12,7 +12,7 @@
* 2 of the License, or (at your option) any later version.
*/

#include <linux/lmb.h>
#include <linux/memblock.h>

#include <asm/types.h>
#include <asm/page.h>
Expand Down
15 changes: 0 additions & 15 deletions arch/powerpc/include/asm/lmb.h

This file was deleted.

15 changes: 15 additions & 0 deletions arch/powerpc/include/asm/memblock.h
@@ -0,0 +1,15 @@
#ifndef _ASM_POWERPC_MEMBLOCK_H
#define _ASM_POWERPC_MEMBLOCK_H

#include <asm/udbg.h>

#define MEMBLOCK_DBG(fmt...) udbg_printf(fmt)

#ifdef CONFIG_PPC32
extern phys_addr_t lowmem_end_addr;
#define MEMBLOCK_REAL_LIMIT lowmem_end_addr
#else
#define MEMBLOCK_REAL_LIMIT 0
#endif

#endif /* _ASM_POWERPC_MEMBLOCK_H */
2 changes: 1 addition & 1 deletion arch/powerpc/kernel/btext.c
Expand Up @@ -7,7 +7,7 @@
#include <linux/string.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/lmb.h>
#include <linux/memblock.h>

#include <asm/sections.h>
#include <asm/prom.h>
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/kernel/crash.c
Expand Up @@ -24,7 +24,7 @@
#include <linux/init.h>
#include <linux/irq.h>
#include <linux/types.h>
#include <linux/lmb.h>
#include <linux/memblock.h>

#include <asm/processor.h>
#include <asm/machdep.h>
Expand Down
4 changes: 2 additions & 2 deletions arch/powerpc/kernel/crash_dump.c
Expand Up @@ -13,7 +13,7 @@

#include <linux/crash_dump.h>
#include <linux/bootmem.h>
#include <linux/lmb.h>
#include <linux/memblock.h>
#include <asm/code-patching.h>
#include <asm/kdump.h>
#include <asm/prom.h>
Expand All @@ -33,7 +33,7 @@ unsigned long long elfcorehdr_addr = ELFCORE_ADDR_MAX;
#ifndef CONFIG_RELOCATABLE
void __init reserve_kdump_trampoline(void)
{
lmb_reserve(0, KDUMP_RESERVE_LIMIT);
memblock_reserve(0, KDUMP_RESERVE_LIMIT);
}

static void __init create_trampoline(unsigned long addr)
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/kernel/dma-swiotlb.c
Expand Up @@ -71,7 +71,7 @@ static int ppc_swiotlb_bus_notify(struct notifier_block *nb,
sd->max_direct_dma_addr = 0;

/* May need to bounce if the device can't address all of DRAM */
if ((dma_get_mask(dev) + 1) < lmb_end_of_DRAM())
if ((dma_get_mask(dev) + 1) < memblock_end_of_DRAM())
set_dma_ops(dev, &swiotlb_dma_ops);

return NOTIFY_DONE;
Expand Down
4 changes: 2 additions & 2 deletions arch/powerpc/kernel/dma.c
Expand Up @@ -9,7 +9,7 @@
#include <linux/dma-mapping.h>
#include <linux/dma-debug.h>
#include <linux/gfp.h>
#include <linux/lmb.h>
#include <linux/memblock.h>
#include <asm/bug.h>
#include <asm/abs_addr.h>

Expand Down Expand Up @@ -89,7 +89,7 @@ static int dma_direct_dma_supported(struct device *dev, u64 mask)
/* Could be improved so platforms can set the limit in case
* they have limited DMA windows
*/
return mask >= (lmb_end_of_DRAM() - 1);
return mask >= (memblock_end_of_DRAM() - 1);
#else
return 1;
#endif
Expand Down
12 changes: 6 additions & 6 deletions arch/powerpc/kernel/machine_kexec.c
Expand Up @@ -12,7 +12,7 @@
#include <linux/kexec.h>
#include <linux/reboot.h>
#include <linux/threads.h>
#include <linux/lmb.h>
#include <linux/memblock.h>
#include <linux/of.h>
#include <asm/machdep.h>
#include <asm/prom.h>
Expand Down Expand Up @@ -66,11 +66,11 @@ void __init reserve_crashkernel(void)
unsigned long long crash_size, crash_base;
int ret;

/* this is necessary because of lmb_phys_mem_size() */
lmb_analyze();
/* this is necessary because of memblock_phys_mem_size() */
memblock_analyze();

/* use common parsing */
ret = parse_crashkernel(boot_command_line, lmb_phys_mem_size(),
ret = parse_crashkernel(boot_command_line, memblock_phys_mem_size(),
&crash_size, &crash_base);
if (ret == 0 && crash_size > 0) {
crashk_res.start = crash_base;
Expand Down Expand Up @@ -133,9 +133,9 @@ void __init reserve_crashkernel(void)
"for crashkernel (System RAM: %ldMB)\n",
(unsigned long)(crash_size >> 20),
(unsigned long)(crashk_res.start >> 20),
(unsigned long)(lmb_phys_mem_size() >> 20));
(unsigned long)(memblock_phys_mem_size() >> 20));

lmb_reserve(crashk_res.start, crash_size);
memblock_reserve(crashk_res.start, crash_size);
}

int overlaps_crashkernel(unsigned long start, unsigned long size)
Expand Down
8 changes: 4 additions & 4 deletions arch/powerpc/kernel/paca.c
Expand Up @@ -9,7 +9,7 @@

#include <linux/threads.h>
#include <linux/module.h>
#include <linux/lmb.h>
#include <linux/memblock.h>

#include <asm/firmware.h>
#include <asm/lppaca.h>
Expand Down Expand Up @@ -117,7 +117,7 @@ void __init allocate_pacas(void)
* the first segment. On iSeries they must be within the area mapped
* by the HV, which is HvPagesToMap * HVPAGESIZE bytes.
*/
limit = min(0x10000000ULL, lmb.rmo_size);
limit = min(0x10000000ULL, memblock.rmo_size);
if (firmware_has_feature(FW_FEATURE_ISERIES))
limit = min(limit, HvPagesToMap * HVPAGESIZE);

Expand All @@ -128,7 +128,7 @@ void __init allocate_pacas(void)

paca_size = PAGE_ALIGN(sizeof(struct paca_struct) * nr_cpus);

paca = __va(lmb_alloc_base(paca_size, PAGE_SIZE, limit));
paca = __va(memblock_alloc_base(paca_size, PAGE_SIZE, limit));
memset(paca, 0, paca_size);

printk(KERN_DEBUG "Allocated %u bytes for %d pacas at %p\n",
Expand All @@ -148,7 +148,7 @@ void __init free_unused_pacas(void)
if (new_size >= paca_size)
return;

lmb_free(__pa(paca) + new_size, paca_size - new_size);
memblock_free(__pa(paca) + new_size, paca_size - new_size);

printk(KERN_DEBUG "Freed %u bytes for unused pacas\n",
paca_size - new_size);
Expand Down

0 comments on commit 6f7dd68

Please sign in to comment.