memblock: Move memblock arrays to static storage in memblock.c and make their size a variable

This is in preparation for having resizable arrays.

Note that we still allocate one more than needed, this is unchanged from
the previous implementation.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This commit is contained in:
Benjamin Herrenschmidt
2010-07-06 15:39:06 -07:00
parent 4734b594c6
commit bf23c51f1f
2 changed files with 13 additions and 4 deletions

View File

@@ -18,7 +18,7 @@
#include <asm/memblock.h>
#define MAX_MEMBLOCK_REGIONS 128
#define INIT_MEMBLOCK_REGIONS 128
struct memblock_region {
phys_addr_t base;
@@ -26,8 +26,9 @@ struct memblock_region {
};
struct memblock_type {
unsigned long cnt;
struct memblock_region regions[MAX_MEMBLOCK_REGIONS+1];
unsigned long cnt; /* number of regions */
unsigned long max; /* size of the allocated array */
struct memblock_region *regions;
};
struct memblock {