This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
RedBoot: Use workspace memory section if defined (was: RedBoot: Loadingfiles from JFFS2 problem)
- From: David Vrabel <dvrabel at arcom dot com>
- To: ecos-discuss <ecos-discuss at sources dot redhat dot com>
- Cc: ecos-patches at sources dot redhat dot com
- Date: Wed, 10 Mar 2004 17:54:23 +0000
- Subject: RedBoot: Use workspace memory section if defined (was: RedBoot: Loadingfiles from JFFS2 problem)
- Organization: Arcom Control Systems Ltd
- References: <404F218B.4000405@arcom.com>
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;