constrain MEMSIZE to avoid stepping out of smallest-case

Gemini CPU Remap Control remapped-private memory size
"bad" things can happen if the gzboot heap is in
non-core-private memory.
This commit is contained in:
cliff 2008-11-11 06:32:15 +00:00
parent 2ca1f539aa
commit ba1eaeccf6

View File

@ -1,4 +1,4 @@
/* $NetBSD: gemini_mem.c,v 1.1 2008/10/30 06:23:13 cliff Exp $ */
/* $NetBSD: gemini_mem.c,v 1.2 2008/11/11 06:32:15 cliff Exp $ */
/* adapted from:
* NetBSD: integrator_mem.c,v 1.4 2006/01/16 19:34:53 he Exp
@ -49,14 +49,20 @@
#include "board.h"
#define MEMSIZE (128 * 1024 * 1024) /* XXX */
/*
* constrain MEMSIZE to avoid stepping out of smallest-case
* Gemini CPU Remap Control remapped-private memory size
* "bad" things can happen if the gzboot heap is in
* non-core-private memory.
*/
#define MEMSIZE (32 * 1024 * 1024) /* 32MB */
void
mem_init(void)
{
uint32_t heap, size;
size = MEMSIZE; /* XXX */
size = MEMSIZE;
/* Start is always 0. */
heap = size - BOARD_HEAP_SIZE;