cpu.c 899 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * File : cpu.c
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2006, 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://openlab.rt-thread.com/license/LICENSE
  9. *
  10. * Change Logs:
  11. * Date Author Notes
  12. * 2008-12-11 XuXinming first version
  13. * 2013-05-24 Grissiom port to RM48x50
  14. */
  15. #include <rtthread.h>
  16. /**
  17. * @addtogroup RM48x50
  18. */
  19. /*@{*/
  20. /**
  21. * this function will reset CPU
  22. *
  23. */
  24. void rt_hw_cpu_reset()
  25. {
  26. }
  27. /**
  28. * this function will shutdown CPU
  29. *
  30. */
  31. void rt_hw_cpu_shutdown()
  32. {
  33. rt_kprintf("shutdown...\n");
  34. while (1);
  35. }
  36. #ifdef RT_USING_CPU_FFS
  37. int __rt_ffs(int value)
  38. {
  39. if (value == 0)
  40. return value;
  41. __asm(" rsb r1, r0, #0");
  42. __asm(" and r1, r1, r0");
  43. __asm(" clz r1, r1");
  44. __asm(" rsb r0, r1, #32");
  45. }
  46. #endif
  47. /*@}*/