linux-mips
[Top] [All Lists]

[PATCH] Reserve stack/heap area for RP program

To: linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: [PATCH] Reserve stack/heap area for RP program
From: Tiejun Chen <tiejun.chen@windriver.com>
Date: Thu, 30 Oct 2008 19:15:45 +0800
Cc: Tiejun Chen <tiejun.chen@windriver.com>
In-reply-to: <1225365345-15635-1-git-send-email-tiejun.chen@windriver.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1225365345-15635-1-git-send-email-tiejun.chen@windriver.com>
Sender: linux-mips-bounce@linux-mips.org
When you want to run a program on RP it's necessary to reserve corresponding 
stack/heap
area of that program.

Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com>
---
 arch/mips/mti-malta/malta-memory.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/arch/mips/mti-malta/malta-memory.c 
b/arch/mips/mti-malta/malta-memory.c
index 61888ff..d8c0834 100644
--- a/arch/mips/mti-malta/malta-memory.c
+++ b/arch/mips/mti-malta/malta-memory.c
@@ -87,6 +87,19 @@ static struct prom_pmemblock * __init prom_getmdesc(void)
        else
                memsize = physical_memsize;
 
+#ifdef CONFIG_MIPS_VPE_LOADER
+       /*
+         * The default DFLT_STACK_SIZE and DFLT_HEAP_SIZE will be known 
+         * from sde-kit. Actually it should define according to the different 
RP
+         * application. In the future we might want to improve it.
+         */
+#define DFLT_STACK_SIZE (65536)
+#define DFLT_HEAP_SIZE  (1048576) 
+        /* Reserve area used by building stack and heap for running RP. 
+         */
+        memsize -= (DFLT_HEAP_SIZE + DFLT_STACK_SIZE + PAGE_SIZE);
+#endif
+
        memset(mdesc, 0, sizeof(mdesc));
 
        mdesc[0].type = yamon_dontuse;
-- 
1.5.5.1


<Prev in Thread] Current Thread [Next in Thread>