Mercurial > flash_v2
comparison packages/io/flash/current/src/legacy_dev.c @ 1758:400806bc9c4f flash_v2_20041123
Remove unnecessary .2ram section attributes. These functions do not
manipulate the hardware directly so do not need special treatment
| author | bartv |
|---|---|
| date | Mon, 22 Nov 2004 21:27:43 +0000 |
| parents | 61fbcc1cb232 |
| children | 9c1d9e5039c2 |
comparison
equal
deleted
inserted
replaced
| 1757:a8729175ad24 | 1758:400806bc9c4f |
|---|---|
| 111 } | 111 } |
| 112 | 112 |
| 113 static size_t | 113 static size_t |
| 114 legacy_flash_query (struct cyg_flash_dev *dev, | 114 legacy_flash_query (struct cyg_flash_dev *dev, |
| 115 void * data, | 115 void * data, |
| 116 const size_t len) | 116 size_t len) |
| 117 __attribute__ ((section (".2ram.flash_program_buf"))); | |
| 118 | |
| 119 static size_t | |
| 120 legacy_flash_query (struct cyg_flash_dev *dev, | |
| 121 void * data, | |
| 122 const size_t len) | |
| 123 { | 117 { |
| 124 typedef void code_fun(void*); | 118 typedef void code_fun(void*); |
| 125 code_fun *_flash_query; | 119 code_fun *_flash_query; |
| 126 | 120 |
| 127 _flash_query = (code_fun*) __anonymizer(&flash_query); | 121 _flash_query = (code_fun*) __anonymizer(&flash_query); |
| 132 } | 126 } |
| 133 | 127 |
| 134 static int | 128 static int |
| 135 legacy_flash_erase_block (struct cyg_flash_dev *dev, | 129 legacy_flash_erase_block (struct cyg_flash_dev *dev, |
| 136 cyg_flashaddr_t block_base) | 130 cyg_flashaddr_t block_base) |
| 137 __attribute__ ((section (".2ram.flash_program_buf"))); | |
| 138 | |
| 139 static int | |
| 140 legacy_flash_erase_block (struct cyg_flash_dev *dev, | |
| 141 cyg_flashaddr_t block_base) | |
| 142 { | 131 { |
| 143 typedef int code_fun(cyg_flashaddr_t, unsigned int); | 132 typedef int code_fun(cyg_flashaddr_t, unsigned int); |
| 144 code_fun *_flash_erase_block; | 133 code_fun *_flash_erase_block; |
| 145 size_t block_size = dev->block_info[0].block_size; | 134 size_t block_size = dev->block_info[0].block_size; |
| 146 | 135 |
| 147 _flash_erase_block = (code_fun*) __anonymizer(&flash_erase_block); | 136 _flash_erase_block = (code_fun*) __anonymizer(&flash_erase_block); |
| 148 | 137 |
| 149 return (*_flash_erase_block)(block_base, block_size); | 138 return (*_flash_erase_block)(block_base, block_size); |
| 150 } | 139 } |
| 151 | |
| 152 static int | |
| 153 legacy_flash_program(struct cyg_flash_dev *dev, | |
| 154 cyg_flashaddr_t base, | |
| 155 const void* data, const size_t len) | |
| 156 __attribute__ ((section (".2ram.flash_program_buf"))); | |
| 157 | 140 |
| 158 static int | 141 static int |
| 159 legacy_flash_program(struct cyg_flash_dev *dev, | 142 legacy_flash_program(struct cyg_flash_dev *dev, |
| 160 cyg_flashaddr_t base, | 143 cyg_flashaddr_t base, |
| 161 const void* data, size_t len) | 144 const void* data, size_t len) |
| 173 #ifdef CYGSEM_IO_FLASH_READ_INDIRECT | 156 #ifdef CYGSEM_IO_FLASH_READ_INDIRECT |
| 174 static int | 157 static int |
| 175 legacy_flash_read (struct cyg_flash_dev *dev, | 158 legacy_flash_read (struct cyg_flash_dev *dev, |
| 176 const cyg_flashaddr_t base, | 159 const cyg_flashaddr_t base, |
| 177 void* data, size_t len) | 160 void* data, size_t len) |
| 178 __attribute__ ((section (".2ram.flash_program_buf"))); | |
| 179 | |
| 180 static int | |
| 181 legacy_flash_read (struct cyg_flash_dev *dev, | |
| 182 const cyg_flashaddr_t base, | |
| 183 void* data, size_t len) | |
| 184 { | 161 { |
| 185 typedef int code_fun(const cyg_flashaddr_t, void *, int, unsigned long, int); | 162 typedef int code_fun(const cyg_flashaddr_t, void *, int, unsigned long, int); |
| 186 code_fun *_flash_read_buf; | 163 code_fun *_flash_read_buf; |
| 187 size_t block_size = dev->block_info[0].block_size; | 164 size_t block_size = dev->block_info[0].block_size; |
| 188 size_t block_mask = ~(block_mask -1); | 165 size_t block_mask = ~(block_mask -1); |
| 200 | 177 |
| 201 #ifdef CYGHWR_IO_FLASH_BLOCK_LOCKING | 178 #ifdef CYGHWR_IO_FLASH_BLOCK_LOCKING |
| 202 static int | 179 static int |
| 203 legacy_flash_block_lock (struct cyg_flash_dev *dev, | 180 legacy_flash_block_lock (struct cyg_flash_dev *dev, |
| 204 const cyg_flashaddr_t block_base) | 181 const cyg_flashaddr_t block_base) |
| 205 __attribute__ ((section (".2ram.flash_program_buf"))); | |
| 206 | |
| 207 static int | |
| 208 legacy_flash_block_lock (struct cyg_flash_dev *dev, | |
| 209 const cyg_flashaddr_t block_base) | |
| 210 { | 182 { |
| 211 typedef int code_fun(cyg_flashaddr_t); | 183 typedef int code_fun(cyg_flashaddr_t); |
| 212 code_fun *_flash_lock_block; | 184 code_fun *_flash_lock_block; |
| 213 | 185 |
| 214 _flash_lock_block = (code_fun*) __anonymizer(&flash_lock_block); | 186 _flash_lock_block = (code_fun*) __anonymizer(&flash_lock_block); |
| 217 } | 189 } |
| 218 | 190 |
| 219 static int | 191 static int |
| 220 legacy_flash_block_unlock (struct cyg_flash_dev *dev, | 192 legacy_flash_block_unlock (struct cyg_flash_dev *dev, |
| 221 const cyg_flashaddr_t block_base) | 193 const cyg_flashaddr_t block_base) |
| 222 __attribute__ ((section (".2ram.flash_program_buf"))); | |
| 223 | |
| 224 static int | |
| 225 legacy_flash_block_unlock (struct cyg_flash_dev *dev, | |
| 226 const cyg_flashaddr_t block_base) | |
| 227 { | 194 { |
| 228 typedef int code_fun(cyg_flashaddr_t, int, int); | 195 typedef int code_fun(cyg_flashaddr_t, int, int); |
| 229 code_fun *_flash_unlock_block; | 196 code_fun *_flash_unlock_block; |
| 230 size_t block_size = dev->block_info[0].block_size; | 197 size_t block_size = dev->block_info[0].block_size; |
| 231 cyg_uint32 blocks = dev->block_info[0].blocks; | 198 cyg_uint32 blocks = dev->block_info[0].blocks; |
| 235 return (*_flash_unlock_block)(block_base, block_size, blocks); | 202 return (*_flash_unlock_block)(block_base, block_size, blocks); |
| 236 } | 203 } |
| 237 #endif | 204 #endif |
| 238 | 205 |
| 239 // Map a hardware status to a package error | 206 // Map a hardware status to a package error |
| 240 static int | |
| 241 legacy_flash_hwr_map_error (struct cyg_flash_dev *dev, int err) | |
| 242 __attribute__ ((section (".2ram.flash_program_buf"))); | |
| 243 | |
| 244 static int | 207 static int |
| 245 legacy_flash_hwr_map_error (struct cyg_flash_dev *dev, int err) | 208 legacy_flash_hwr_map_error (struct cyg_flash_dev *dev, int err) |
| 246 { | 209 { |
| 247 return flash_hwr_map_error(err); | 210 return flash_hwr_map_error(err); |
| 248 } | 211 } |
