ipipe_base.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /* -*- linux-c -*-
  2. * include/asm-blackfin/_baseipipe.h
  3. *
  4. * Copyright (C) 2007 Philippe Gerum.
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139,
  9. * USA; either version 2 of the License, or (at your option) any later
  10. * version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  20. */
  21. #ifndef __ASM_BLACKFIN_IPIPE_BASE_H
  22. #define __ASM_BLACKFIN_IPIPE_BASE_H
  23. #ifdef CONFIG_IPIPE
  24. #define IPIPE_NR_XIRQS NR_IRQS
  25. #define IPIPE_IRQ_ISHIFT 5 /* 2^5 for 32bits arch. */
  26. /* Blackfin-specific, global domain flags */
  27. #define IPIPE_ROOTLOCK_FLAG 1 /* Lock pipeline for root */
  28. /* Blackfin traps -- i.e. exception vector numbers */
  29. #define IPIPE_NR_FAULTS 52 /* We leave a gap after VEC_ILL_RES. */
  30. /* Pseudo-vectors used for kernel events */
  31. #define IPIPE_FIRST_EVENT IPIPE_NR_FAULTS
  32. #define IPIPE_EVENT_SYSCALL (IPIPE_FIRST_EVENT)
  33. #define IPIPE_EVENT_SCHEDULE (IPIPE_FIRST_EVENT + 1)
  34. #define IPIPE_EVENT_SIGWAKE (IPIPE_FIRST_EVENT + 2)
  35. #define IPIPE_EVENT_SETSCHED (IPIPE_FIRST_EVENT + 3)
  36. #define IPIPE_EVENT_INIT (IPIPE_FIRST_EVENT + 4)
  37. #define IPIPE_EVENT_EXIT (IPIPE_FIRST_EVENT + 5)
  38. #define IPIPE_EVENT_CLEANUP (IPIPE_FIRST_EVENT + 6)
  39. #define IPIPE_LAST_EVENT IPIPE_EVENT_CLEANUP
  40. #define IPIPE_NR_EVENTS (IPIPE_LAST_EVENT + 1)
  41. #define IPIPE_TIMER_IRQ IRQ_CORETMR
  42. #ifndef __ASSEMBLY__
  43. #include <linux/bitops.h>
  44. extern int test_bit(int nr, const void *addr);
  45. extern unsigned long __ipipe_root_status; /* Alias to ipipe_root_cpudom_var(status) */
  46. static inline void __ipipe_stall_root(void)
  47. {
  48. volatile unsigned long *p = &__ipipe_root_status;
  49. set_bit(0, p);
  50. }
  51. static inline unsigned long __ipipe_test_and_stall_root(void)
  52. {
  53. volatile unsigned long *p = &__ipipe_root_status;
  54. return test_and_set_bit(0, p);
  55. }
  56. static inline unsigned long __ipipe_test_root(void)
  57. {
  58. const unsigned long *p = &__ipipe_root_status;
  59. return test_bit(0, p);
  60. }
  61. #endif /* !__ASSEMBLY__ */
  62. #endif /* CONFIG_IPIPE */
  63. #endif /* !__ASM_BLACKFIN_IPIPE_BASE_H */