cpu.c 952 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * File : cpu.c
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2006 - 2010, RT-Thread Development Team
  5. *
  6. * The license and distribution terms for this file may be
  7. * found in the file LICENSE in this distribution or at
  8. * http://www.rt-thread.org/license/LICENSE
  9. *
  10. * Change Logs:
  11. * Date Author Notes
  12. * 2010-07-09 Bernard first version
  13. * 2010-09-11 Bernard add CPU reset implementation
  14. */
  15. #include <rtthread.h>
  16. #include <soc3210.h>
  17. /**
  18. * @addtogroup Loongson SoC3210
  19. */
  20. /*@{*/
  21. /**
  22. * this function will reset CPU
  23. *
  24. */
  25. void rt_hw_cpu_reset(void)
  26. {
  27. /* open the watch-dog */
  28. WD_TIMER = 0x01; /* watch dog will be timeout after 1 tick */
  29. WD_CTRL |= 0x01;
  30. rt_kprintf("reboot system...\n");
  31. while (1);
  32. }
  33. /**
  34. * this function will shutdown CPU
  35. *
  36. */
  37. void rt_hw_cpu_shutdown(void)
  38. {
  39. rt_kprintf("shutdown...\n");
  40. while (1);
  41. }
  42. /*@}*/