This is the mail archive of the ecos-discuss@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]

Re: Bugs in Legacy API for FlashV2


Andrew Lunn wrote:
Like the attached?

Nearly. There is no need to put in comments about bugs in the code.

OK, here comes.


Rutger
? patch-legacy-flash
Index: ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/io/flash/current/ChangeLog,v
retrieving revision 1.38.2.27
diff -c -r1.38.2.27 ChangeLog
*** ChangeLog	27 Sep 2006 14:24:46 -0000	1.38.2.27
--- ChangeLog	2 Feb 2007 19:43:12 -0000
***************
*** 1,3 ****
--- 1,10 ----
+ 
+ 2005-02-02  Rutger Hofman   <rutger@cs.vu.nl>
+ 
+ 	* src/legacy_dev.c (legacy_flash_program): Added missing definition
+ 	of block_size.
+ 	* legacy_api.c: Added missing wrappers for flash_lock and flash_unlock
+ 
  2005-01-28  Nick Garnett  <nickg@ecoscentric.com>
  
  	* src/legacy_dev.c (legacy_flash_init): Assign flash_info.pf from
Index: src/legacy_api.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/io/flash/current/src/Attic/legacy_api.c,v
retrieving revision 1.1.2.4
diff -c -r1.1.2.4 legacy_api.c
*** src/legacy_api.c	22 Feb 2005 23:21:13 -0000	1.1.2.4
--- src/legacy_api.c	2 Feb 2007 19:43:12 -0000
***************
*** 141,144 ****
--- 141,159 ----
    return (char *)cyg_flash_errmsg(err);
  }
  
+ #ifdef CYGHWR_IO_FLASH_BLOCK_LOCKING
+ int flash_lock(void *base, int len, void **err_address)
+ {
+     return cyg_flash_lock((const cyg_flashaddr_t)base,
+                           len, (cyg_flashaddr_t *)err_address);
+ }
+ 
+ int flash_unlock(void *base, int len, void **err_address)
+ {
+     return cyg_flash_unlock((const cyg_flashaddr_t)base,
+                             len, (cyg_flashaddr_t *)err_address);
+ }
+ #endif
+ 
+ 
  // EOF legacy_api.c
Index: src/legacy_dev.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/io/flash/current/src/Attic/legacy_dev.c,v
retrieving revision 1.1.2.14
diff -c -r1.1.2.14 legacy_dev.c
*** src/legacy_dev.c	27 Sep 2006 14:24:46 -0000	1.1.2.14
--- src/legacy_dev.c	2 Feb 2007 19:43:12 -0000
***************
*** 142,147 ****
--- 142,148 ----
  {
    typedef int code_fun(cyg_flashaddr_t, const void *, int, unsigned long, int);
    code_fun *_flash_program_buf;
+   size_t block_size = dev->block_info[0].block_size;
    size_t block_mask = ~(block_size -1);
    int    stat;
    

-- 
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]