cpu.c 806 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * File : cpu.c
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2013, RT-Thread Develop 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. * 2013-07-20 Bernard first version
  13. */
  14. #include <rthw.h>
  15. #include <rtthread.h>
  16. #include "zynq7000.h"
  17. /**
  18. * reset cpu by dog's time-out
  19. *
  20. */
  21. void rt_hw_cpu_reset()
  22. {
  23. while (1); /* loop forever and wait for reset to happen */
  24. /* NEVER REACHED */
  25. }
  26. /**
  27. * shutdown CPU
  28. *
  29. */
  30. void rt_hw_cpu_shutdown()
  31. {
  32. rt_uint32_t level;
  33. rt_kprintf("shutdown...\n");
  34. level = rt_hw_interrupt_disable();
  35. while (level)
  36. {
  37. RT_ASSERT(0);
  38. }
  39. }