vbus_hw.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * VMM Bus
  3. *
  4. * COPYRIGHT (C) 2015, Shanghai Real-Thread Technology Co., Ltd
  5. *
  6. * This file is part of RT-Thread (http://www.rt-thread.org)
  7. *
  8. * All rights reserved.
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License as published by
  12. * the Free Software Foundation; either version 2 of the License, or
  13. * (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License along
  21. * with this program; if not, write to the Free Software Foundation, Inc.,
  22. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  23. *
  24. * Change Logs:
  25. * Date Author Notes
  26. * 2015-01-07 Grissiom init commit
  27. */
  28. #include <rtthread.h>
  29. #include <stddef.h>
  30. #include <gic.h>
  31. rt_inline void rt_vbus_tick(unsigned int target_cpu, unsigned int irqnr)
  32. {
  33. arm_gic_trigger(0, 1, irqnr);
  34. }
  35. /* Read memory barrier. */
  36. rt_inline void rt_vbus_smp_rmb(void)
  37. {
  38. asm volatile ("dsb" : : : "memory");
  39. }
  40. /* Write memory barrier. */
  41. rt_inline void rt_vbus_smp_wmb(void)
  42. {
  43. asm volatile ("dsb" : : : "memory");
  44. }
  45. /* General memory barrier. */
  46. rt_inline void rt_vbus_smp_mb(void)
  47. {
  48. asm volatile ("dsb" : : : "memory");
  49. }