romfs.S 885 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /* romfs move to __ebss */
  2. #include <asm/linkage.h>
  3. #if defined(__H8300H__)
  4. .h8300h
  5. #endif
  6. #if defined(__H8300S__)
  7. .h8300s
  8. #endif
  9. #define BLKOFFSET 512
  10. .text
  11. .globl __move_romfs
  12. _romfs_sig_len = 8
  13. __move_romfs:
  14. mov.l #__sbss,er0
  15. mov.l #_romfs_sig,er1
  16. mov.b #_romfs_sig_len,r3l
  17. 1: /* check romfs image */
  18. mov.b @er0+,r2l
  19. mov.b @er1+,r2h
  20. cmp.b r2l,r2h
  21. bne 2f
  22. dec.b r3l
  23. bne 1b
  24. /* find romfs image */
  25. mov.l @__sbss+8,er0 /* romfs length(be) */
  26. mov.l #__sbss,er1
  27. add.l er0,er1 /* romfs image end */
  28. mov.l #__ebss,er2
  29. add.l er0,er2 /* distination address */
  30. #if defined(CONFIG_INTELFLASH)
  31. add.l #BLKOFFSET,er2
  32. #endif
  33. adds #2,er0
  34. adds #1,er0
  35. shlr er0
  36. shlr er0 /* transfer length */
  37. 1:
  38. mov.l @er1,er3 /* copy image */
  39. mov.l er3,@er2
  40. subs #4,er1
  41. subs #4,er2
  42. dec.l #1,er0
  43. bpl 1b
  44. 2:
  45. rts
  46. .section .rodata
  47. _romfs_sig:
  48. .ascii "-rom1fs-"
  49. .end