This is the mail archive of the ecos-patches@sourceware.org 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]

FLASH/FIS memory allocation


Could be wrong if some other function (in the cited case,
Intel NPE driver) allocated some memory from the workspace.

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------
Index: redboot/current/ChangeLog
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/redboot/current/ChangeLog,v
retrieving revision 1.256
diff -u -5 -p -r1.256 ChangeLog
--- redboot/current/ChangeLog	9 Aug 2007 12:13:26 -0000	1.256
+++ redboot/current/ChangeLog	28 Aug 2007 10:58:06 -0000
@@ -1,5 +1,11 @@
+2007-08-28  Gary Thomas  <gary@mlbassoc.com>
+
+	* src/flash.c (do_flash_init): Memory allocation was slightly
+	incorrect - 'workspace_end' should always be used to find 
+	the end of available memory.
+
 2007-08-08  Peter Korsgaard  <peter.korsgaard@barco.com>
 
 	* include/net/http.h:
 	* src/net/http_client.c: Add HTTP_FORBIDDEN error code for 403
 	Forbidden response.
Index: redboot/current/src/flash.c
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/redboot/current/src/flash.c,v
retrieving revision 1.83
diff -u -5 -p -r1.83 flash.c
--- redboot/current/src/flash.c	2 Jun 2007 17:50:33 -0000	1.83
+++ redboot/current/src/flash.c	28 Aug 2007 10:58:07 -0000
@@ -1598,11 +1598,11 @@ do_flash_init(void)
 	if(CYGNUM_REDBOOT_FIS_ZLIB_COMMON_BUFFER_SIZE < fisdir_size) {
             diag_printf("FLASH: common buffer too small\n");
             return -1;
 	}
 # else
-        workspace_end = (unsigned char *)(workspace_end_init-fisdir_size);
+        workspace_end = (unsigned char *)(workspace_end-fisdir_size);
         fis_work_block = workspace_end;
 # endif
         if (CYGNUM_REDBOOT_FIS_DIRECTORY_BLOCK < 0) {
             fis_addr = (void *)((CYG_ADDRESS)flash_end + 1 +
                                 (CYGNUM_REDBOOT_FIS_DIRECTORY_BLOCK*flash_block_size));

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