Skip to content

Commit

Permalink
sh: Add a machvec callback for early memblock reservations.
Browse files Browse the repository at this point in the history
This adds in a callback to the machvec to allow platforms to do early
reservations through memblock.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Paul Mundt committed Jan 11, 2011
1 parent e54be89 commit 2f59986
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions arch/sh/include/asm/machvec.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ struct sh_machine_vector {
int (*mv_mode_pins)(void);

void (*mv_mem_init)(void);
void (*mv_mem_reserve)(void);
};

extern struct sh_machine_vector sh_mv;
Expand Down
10 changes: 8 additions & 2 deletions arch/sh/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* linux/arch/sh/mm/init.c
*
* Copyright (C) 1999 Niibe Yutaka
* Copyright (C) 2002 - 2010 Paul Mundt
* Copyright (C) 2002 - 2011 Paul Mundt
*
* Based on linux/arch/i386/mm/init.c:
* Copyright (C) 1995 Linus Torvalds
Expand Down Expand Up @@ -325,11 +325,17 @@ void __init paging_init(void)
int nid;

memblock_init();

sh_mv.mv_mem_init();

early_reserve_mem();

/*
* Once the early reservations are out of the way, give the
* platforms a chance to kick out some memory.
*/
if (sh_mv.mv_mem_reserve)
sh_mv.mv_mem_reserve();

memblock_enforce_memory_limit(memory_limit);
memblock_analyze();

Expand Down

0 comments on commit 2f59986

Please sign in to comment.