startup.c 1011 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #include "platform.h"
  2. extern void _INITSCT(void);
  3. //extern void R_SET_USP(void *); //init u stack pointer
  4. //extern void R_SET_INTB(void *); //init interrupt table register
  5. //extern void R_SET_EXTB(void *); //init exception table register
  6. extern void bsp_ram_initialize(void);
  7. extern int main(void);
  8. //do floating point init
  9. //set operating frequency
  10. // init c runtime
  11. // bsp_ram_initialize
  12. // bsp_interrupt_open
  13. // bsp_register_protect_open
  14. // hardware_setup()
  15. // R_SET_PSW() //enable interrupt and select I or U stack
  16. //void startup(void)
  17. void PowerON_Reset_PC_Prg(void)
  18. {
  19. R_SET_USP(R_SECEND_USTACK);
  20. R_SET_INTB(R_SECTOP_INTVECTTBL);
  21. R_SET_EXTB(R_SECTOP_EXCEPTVECTTBL);
  22. operating_frequency_set();
  23. _INITSCT();
  24. //R_SET_FPSW(FPSW_init | FPU_ROUND | FPU_DENOM);
  25. //bsp_interrupt_open();
  26. //bsp_register_protect_open();
  27. hardware_setup();
  28. //R_SET_PSW(PSW_init);
  29. //R_BSP_Change_PSW_PM_to_UserMode(); //maybe???
  30. int rv = main();
  31. for (;;) {
  32. }
  33. }