This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RedBoot: Use workspace memory section if defined (was: RedBoot: Loadingfiles from JFFS2 problem)


David Vrabel wrote:
Would two regions/heaps (?) be the solution? One as an actual heap and one where RedBoot can load images too?

Done this now. I added a 2nd workspace memory section and made RedBoot use that as its workspace. Seems to work fine.


Attached is the simple patch I made to RedBoot to get it to use the workspace memory region.

2004-03-10 David Vrabel <dvrabel@arcom.com>

	* src/main.c (cyg_start): Use the workspace memory section
	(CYGMEM_SECTION_workspace) as the workspace if it is defined.
	This prevents the user from trampling over the heap1 section.

David Vrabel
--
David Vrabel, Design Engineer

Arcom, Clifton Road           Tel: +44 (0)1223 411200 ext. 3233
Cambridge CB1 7EA, UK         Web: http://www.arcom.com/
Index: redboot/current/src/main.c
===================================================================
RCS file: /var/cvs/ecos/packages/redboot/current/src/main.c,v
retrieving revision 1.8
diff -u -B -p -r1.8 main.c
--- redboot/current/src/main.c	2 Mar 2004 13:24:06 -0000	1.8
+++ redboot/current/src/main.c	10 Mar 2004 17:47:23 -0000
@@ -301,7 +301,11 @@ cyg_start(void)
     }
 #endif
 
-#ifdef CYGMEM_SECTION_heap1
+#if defined(CYGMEM_SECTION_workspace)
+    workspace_start = (unsigned char *)CYGMEM_SECTION_workspace;
+    workspace_end = (unsigned char *)(CYGMEM_SECTION_workspace+CYGMEM_SECTION_workspace_SIZE);
+    workspace_size = CYGMEM_SECTION_workspace_SIZE;
+#elif defined(CYGMEM_SECTION_heap1)
     workspace_start = (unsigned char *)CYGMEM_SECTION_heap1;
     workspace_end = (unsigned char *)(CYGMEM_SECTION_heap1+CYGMEM_SECTION_heap1_SIZE);
     workspace_size = CYGMEM_SECTION_heap1_SIZE;

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]