Received: from mail.onstor.com ([66.201.51.107]) by onstor-exch02.onstor.net with Microsoft SMTPSVC(6.0.3790.3959);
	 Thu, 30 Oct 2008 04:19:32 -0700
Received: from ausesmta2-1.messageone.com ([64.20.241.45]) by mail.onstor.com with Microsoft SMTPSVC(6.0.3790.3959);
	 Thu, 30 Oct 2008 04:19:32 -0700
Received: from ftp.linux-mips.org (ftp.linux-mips.org [213.58.128.207])
	by ausesmta2-1.messageone.com (8.13.8/8.13.8) with ESMTP id m9UBJT8X011088
	for <andy.sharp@onstor.com>; Thu, 30 Oct 2008 06:19:31 -0500
Received: from localhost.localdomain ([127.0.0.1]:64710 "EHLO
	ftp.linux-mips.org") by ftp.linux-mips.org with ESMTP
	id S22721933AbYJ3LPv (ORCPT <rfc822;andy.sharp@onstor.com>);
	Thu, 30 Oct 2008 11:15:51 +0000
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 30 Oct 2008 11:15:34 +0000 (GMT)
Received: from mail.windriver.com ([147.11.1.11]:17150 "EHLO mail.wrs.com")
	by ftp.linux-mips.org with ESMTP id S22721846AbYJ3LO5 (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 30 Oct 2008 11:14:57 +0000
Received: from ALA-MAIL03.corp.ad.wrs.com (ala-mail03 [147.11.57.144])
	by mail.wrs.com (8.13.6/8.13.6) with ESMTP id m9UBEmet002655;
	Thu, 30 Oct 2008 04:14:48 -0700 (PDT)
Received: from localhost.localdomain ([128.224.162.71]) by ALA-MAIL03.corp.ad.wrs.com with Microsoft SMTPSVC(6.0.3790.1830);
	 Thu, 30 Oct 2008 04:14:47 -0700
From: Tiejun Chen <tiejun.chen@windriver.com>
To: linux-mips@linux-mips.org, ralf@linux-mips.org
Cc: Tiejun Chen <tiejun.chen@windriver.com>
Subject: [PATCH] Reserve stack/heap area for RP program
Date: 	Thu, 30 Oct 2008 19:15:45 +0800
Message-Id: <1225365345-15635-2-git-send-email-tiejun.chen@windriver.com>
X-Mailer: git-send-email 1.5.5.1
In-Reply-To: <1225365345-15635-1-git-send-email-tiejun.chen@windriver.com>
References: <1225365345-15635-1-git-send-email-tiejun.chen@windriver.com>
X-OriginalArrivalTime: 30 Oct 2008 11:14:48.0029 (UTC) FILETIME=[B85FF0D0:01C93A80]
X-archive-position: 21111
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: tiejun.chen@windriver.com
Precedence: bulk
X-list: 	linux-mips
X-MessageOne-Virus-Version: vendor=fsecure engine=4.65.7400:2.4.4,1.2.40,4.0.164 definitions=2008-10-30_03:2008-10-10,2008-10-30,2008-10-30 signatures=0
X-MessageOne-Virus-Scanned: Clean
X-MessageOne-Envelope-Sender: linux-mips-bounce@linux-mips.org
X-MessageOne-Spam-Details: rule=m773emszm_notspam policy=m773emszm score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=3.1.0-0810130000 definitions=main-0810300042
X-MessageOne-Spam-Score: 0
X-MessageOne-Spam-Bar: 
Return-Path: 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


