Commit d6fa5d1a authored by Richard Russon's avatar Richard Russon

Merge flatcap.org:/home/flatcap/backup/bk/ntfs-2.6

into flatcap.org:/home/flatcap/backup/bk/ntfs-2.6-devel
parents 30788d3f 9b9407e8
...@@ -587,19 +587,20 @@ static unsigned long __init prom_next_cell(int s, cell_t **cellp) ...@@ -587,19 +587,20 @@ static unsigned long __init prom_next_cell(int s, cell_t **cellp)
static void reserve_mem(unsigned long base, unsigned long size) static void reserve_mem(unsigned long base, unsigned long size)
{ {
unsigned long offset = reloc_offset(); unsigned long offset = reloc_offset();
unsigned long top = base + size;
unsigned long cnt = RELOC(mem_reserve_cnt); unsigned long cnt = RELOC(mem_reserve_cnt);
if (!size) if (size == 0)
return; return;
base = _ALIGN_DOWN(base, PAGE_SIZE); /* We need to always keep one empty entry so that we
size = _ALIGN_UP(size, PAGE_SIZE);
/*
* We need to always keep one empty entry so that we
* have our terminator with "size" set to 0 since we are * have our terminator with "size" set to 0 since we are
* dumb and just copy this entire array to the boot params * dumb and just copy this entire array to the boot params
*/ */
base = _ALIGN_DOWN(base, PAGE_SIZE);
top = _ALIGN_UP(top, PAGE_SIZE);
size = top - base;
if (cnt >= (MEM_RESERVE_MAP_SIZE - 1)) if (cnt >= (MEM_RESERVE_MAP_SIZE - 1))
prom_panic("Memory reserve map exhausted !\n"); prom_panic("Memory reserve map exhausted !\n");
RELOC(mem_reserve_map)[cnt].base = base; RELOC(mem_reserve_map)[cnt].base = base;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment