Mercurial > flash_v2
comparison packages/io/flash/current/src/flash.c @ 1746:172edf8a96d8
Eliminate cyg_flash_code_overlaps()
| author | bartv |
|---|---|
| date | Sun, 21 Nov 2004 18:39:15 +0000 |
| parents | f854ed1e81db |
| children | a221170fac3d |
comparison
equal
deleted
inserted
replaced
| 1745:49e24a462730 | 1746:172edf8a96d8 |
|---|---|
| 230 for (dev = flash_head; dev; dev=dev->next) { | 230 for (dev = flash_head; dev; dev=dev->next) { |
| 231 if ((dev->start <= address) && (address <= dev->end)) | 231 if ((dev->start <= address) && (address <= dev->end)) |
| 232 return CYG_FLASH_ERR_OK; | 232 return CYG_FLASH_ERR_OK; |
| 233 } | 233 } |
| 234 return CYG_FLASH_ERR_INVALID; | 234 return CYG_FLASH_ERR_INVALID; |
| 235 } | |
| 236 | |
| 237 // See if a range of FLASH addresses overlaps currently running code | |
| 238 __externC bool cyg_flash_code_overlaps(const cyg_flashaddr_t start, | |
| 239 const cyg_flashaddr_t end) | |
| 240 { | |
| 241 extern char _stext[], _etext[]; | |
| 242 | |
| 243 return ((((unsigned long)&_stext >= (unsigned long)start) && | |
| 244 ((unsigned long)&_stext < (unsigned long)end)) || | |
| 245 (((unsigned long)&_etext >= (unsigned long)start) && | |
| 246 ((unsigned long)&_etext < (unsigned long)end))); | |
| 247 } | 235 } |
| 248 | 236 |
| 249 // Return information about the Nth driver | 237 // Return information about the Nth driver |
| 250 __externC int | 238 __externC int |
| 251 cyg_flash_get_info(cyg_uint32 Nth, cyg_flash_info_t * info) | 239 cyg_flash_get_info(cyg_uint32 Nth, cyg_flash_info_t * info) |
