# HG changeset patch # User asl # Date 1069751131 0 # Node ID 707a873489c895a424fb7ec8c36c6b1ae82a650b # Parent 1bc2e99ec44b8571dc6f105a5dc6d0814e9be460 * src/flash.c: gcc 3.x vs gcc 2.x problems. diff --git a/packages/io/flash/current/ChangeLog b/packages/io/flash/current/ChangeLog --- a/packages/io/flash/current/ChangeLog +++ b/packages/io/flash/current/ChangeLog @@ -1,3 +1,7 @@ +2003-11-25 Andrew Lunn + + * src/flash.c: gcc 3.x vs gcc 2.x problems. + 2003-11-24 Jani Monoses * cdl/io_flash.cdl: diff --git a/packages/io/flash/current/src/flash.c b/packages/io/flash/current/src/flash.c --- a/packages/io/flash/current/src/flash.c +++ b/packages/io/flash/current/src/flash.c @@ -72,6 +72,16 @@ struct flash_info flash_info; +// These are the functions in the HW specific driver we need to call. +typedef void code_fun(void*); + +externC code_fun flash_query; +externC code_fun flash_erase_block; +externC code_fun flash_program_buf; +externC code_fun flash_read_buf; +externC code_fun flash_lock_block; +externC code_fun flash_unlock_block; + int flash_init(_printf *pf) { @@ -105,7 +115,6 @@ flash_dev_query(void* data) code_fun *_flash_query; int d_cache, i_cache; - externC code_fun flash_query; _flash_query = (code_fun*) __anonymizer(&flash_query); HAL_FLASH_CACHES_OFF(d_cache, i_cache); @@ -167,7 +176,6 @@ flash_erase(void *addr, int len, void ** return FLASH_ERR_PROTECT; #endif - externC code_fun flash_erase_block; _flash_erase_block = (code_fun*) __anonymizer(&flash_erase_block); block = (unsigned short *)((CYG_ADDRESS)addr & flash_info.block_mask); @@ -254,7 +262,6 @@ flash_program(void *_addr, void *_data, return FLASH_ERR_PROTECT; #endif - externC code_fun flash_program_buf; _flash_program_buf = (code_fun*) __anonymizer(&flash_program_buf); #ifdef CYGSEM_IO_FLASH_CHATTER @@ -328,7 +335,6 @@ flash_read(void *_addr, void *_data, int return FLASH_ERR_PROTECT; #endif - externC code_fun flash_read_buf; _flash_read_buf = (code_fun*) __anonymizer(&flash_read_buf); #ifdef CYGSEM_IO_FLASH_CHATTER @@ -408,7 +414,6 @@ flash_lock(void *addr, int len, void **e return FLASH_ERR_PROTECT; #endif - externC code_fun flash_lock_block; _flash_lock_block = (code_fun*) __anonymizer(&flash_lock_block); block = (unsigned short *)((CYG_ADDRESS)addr & flash_info.block_mask); @@ -473,7 +478,6 @@ flash_unlock(void *addr, int len, void * return FLASH_ERR_PROTECT; #endif - externC code_fun flash_unlock_block; _flash_unlock_block = (code_fun*) __anonymizer(&flash_unlock_block); block = (unsigned short *)((CYG_ADDRESS)addr & flash_info.block_mask);