Commit c3d255d
Vorago VA416x0: harden iram_write/iram_fill per review
Two follow-ups to the IRAM shadow update fix (da96f5a):
1. Mark the bulk-copy destination as volatile uint32_t * so the compiler
cannot lower a 32-bit assignment into byte/halfword stores. Sub-word
stores are silently dropped by the IRAM ECC, so a future codegen
change could have broken the workaround.
2. Use (uintptr_t)3u / ~(uintptr_t)3u for alignment masking. On targets
where uintptr_t is wider than unsigned int the bare ~3u would zero
the high half of the address; harmless on Cortex-M4 today, but the
helper pattern is easy to copy elsewhere.
The int len type is kept to match the wolfBoot ext_flash_* HAL signature
convention across all ports.
Verified with arm-none-eabi-objdump: aligned bulk path emits only 32-bit
str instructions (no strb/strh).1 parent 08c6673 commit c3d255d
1 file changed
Lines changed: 14 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
376 | 376 | | |
377 | 377 | | |
378 | 378 | | |
379 | | - | |
380 | | - | |
381 | | - | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
382 | 384 | | |
383 | 385 | | |
384 | 386 | | |
385 | 387 | | |
386 | 388 | | |
387 | 389 | | |
388 | | - | |
| 390 | + | |
389 | 391 | | |
390 | 392 | | |
391 | 393 | | |
392 | 394 | | |
393 | 395 | | |
394 | | - | |
395 | | - | |
| 396 | + | |
| 397 | + | |
396 | 398 | | |
397 | 399 | | |
398 | 400 | | |
| |||
410 | 412 | | |
411 | 413 | | |
412 | 414 | | |
413 | | - | |
414 | | - | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
415 | 418 | | |
416 | 419 | | |
417 | 420 | | |
418 | 421 | | |
419 | | - | |
| 422 | + | |
420 | 423 | | |
421 | 424 | | |
422 | | - | |
423 | | - | |
| 425 | + | |
| 426 | + | |
424 | 427 | | |
425 | 428 | | |
426 | 429 | | |
| |||
0 commit comments