rominit.c
上传用户:caisangzi8
上传日期:2013-10-25
资源大小:15756k
文件大小:2k
源码类别:

DVD

开发平台:

C/C++

  1. #include "ver.h"
  2. extern int _data[];
  3. extern int _edata[];
  4. extern int _data_ps[];
  5. extern int _data_pe[];
  6. extern int _bstart[];
  7. extern  int _bend[];
  8. extern int _sdram[];
  9. extern int _esdram[];
  10. extern int _textf_ps[];
  11. extern int _textf[];
  12. extern int _etextf[];
  13. extern void reset_system(void);
  14. //#define     ROMINIT_DBG     1
  15. /*
  16. ** FUNCTION
  17. ** rominit
  18. **
  19. ** DESCRIPTION
  20. ** Initialize memory contents that need to be initialized.
  21. */
  22. void rominit(void)
  23. {
  24.   int *src;
  25.   int *dst;
  26.   int *ending;
  27.   /* ROM has data at end of text; copy it. */
  28.   src    = _data_ps;
  29.   dst    = _data;
  30.   ending = _edata;
  31.   do {
  32.     *dst++ = *src++;
  33.   } while (dst<ending);
  34.   /* Zero out bss */
  35.   dst    = _bstart;
  36.   ending = _bend;
  37.   do {
  38.     *dst++ = 0;
  39.   } while (dst<ending);
  40. #ifdef SPHE1000
  41. extern int _boot_start[];
  42. extern  int _boot_end[];
  43. extern  int _bstext[];
  44.   src    = _bstext;
  45.   dst    = _boot_start;
  46.   ending = _boot_end;
  47.   do {
  48.     *dst++ = *src++;
  49.   } while (dst<ending);
  50.   src    = 0x88000080;
  51.   dst    = 0x80000480;
  52.   ending = 0x80000490;
  53.   do {
  54.     *dst++ = *src++;
  55.   } while (dst<ending);
  56. #endif
  57. #if 0
  58.   //
  59.   src    = _textf_ps;
  60.   dst    = _textf;
  61.   ending = _etextf;
  62.   while (dst<ending)
  63.   {
  64.     *dst++ = *src++;
  65.   }
  66. #endif
  67.   /*
  68.   ** reset system interface
  69.   */
  70.   //reset_system();
  71. }
  72. void ramfinit()
  73. {
  74. #if 0
  75.   int *src;
  76.   int *dst;
  77.   int *ending;
  78.   src    = _textf_ps;
  79.   dst    = _textf;
  80.   ending = _etextf;
  81.   while (dst<ending)
  82.   {
  83.     *dst++ = *src++;
  84.   }
  85. #endif
  86. }