rominit.c
资源名称:8202s.rar [点击查看]
上传用户:poi891205
上传日期:2013-07-15
资源大小:9745k
文件大小:2k
源码类别:
DVD
开发平台:
C/C++
- #include "ver.h"
- extern int _data[];
- extern int _edata[];
- extern int _data_ps[];
- extern int _data_pe[];
- extern int _bstart[];
- extern int _bend[];
- extern int _sdram[];
- extern int _esdram[];
- extern int _textf_ps[];
- extern int _textf[];
- extern int _etextf[];
- extern void reset_system(void);
- //#define ROMINIT_DBG 1
- /*
- ** FUNCTION
- ** rominit
- **
- ** DESCRIPTION
- ** Initialize memory contents that need to be initialized.
- */
- void rominit(void)
- {
- int *src;
- int *dst;
- int *ending;
- /* ROM has data at end of text; copy it. */
- src = _data_ps;
- dst = _data;
- ending = _edata;
- do {
- *dst++ = *src++;
- } while (dst<ending);
- /* Zero out bss */
- dst = _bstart;
- ending = _bend;
- do {
- *dst++ = 0;
- } while (dst<ending);
- #ifdef SPHE1000
- extern int _boot_start[];
- extern int _boot_end[];
- extern int _bstext[];
- src = _bstext;
- dst = _boot_start;
- ending = _boot_end;
- do {
- *dst++ = *src++;
- } while (dst<ending);
- src = 0x88000080;
- dst = 0x80000480;
- ending = 0x80000490;
- do {
- *dst++ = *src++;
- } while (dst<ending);
- #endif
- #if 0
- //
- src = _textf_ps;
- dst = _textf;
- ending = _etextf;
- while (dst<ending)
- {
- *dst++ = *src++;
- }
- #endif
- /*
- ** reset system interface
- */
- //reset_system();
- }
- void ramfinit()
- {
- #if 0
- int *src;
- int *dst;
- int *ending;
- src = _textf_ps;
- dst = _textf;
- ending = _etextf;
- while (dst<ending)
- {
- *dst++ = *src++;
- }
- #endif
- }