fiq.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * arch/arm/include/asm/fiq.h
  3. *
  4. * Support for FIQ on ARM architectures.
  5. * Written by Philip Blundell <philb@gnu.org>, 1998
  6. * Re-written by Russell King
  7. *
  8. * NOTE: The FIQ mode registers are not magically preserved across
  9. * suspend/resume.
  10. *
  11. * Drivers which require these registers to be preserved across power
  12. * management operations must implement appropriate suspend/resume handlers to
  13. * save and restore them.
  14. */
  15. #ifndef __ASM_FIQ_H
  16. #define __ASM_FIQ_H
  17. #include <asm/ptrace.h>
  18. struct fiq_handler {
  19. struct fiq_handler *next;
  20. /* Name
  21. */
  22. const char *name;
  23. /* Called to ask driver to relinquish/
  24. * reacquire FIQ
  25. * return zero to accept, or -<errno>
  26. */
  27. int (*fiq_op)(void *, int relinquish);
  28. /* data for the relinquish/reacquire functions
  29. */
  30. void *dev_id;
  31. };
  32. #ifdef CONFIG_FIQ
  33. extern int claim_fiq(struct fiq_handler *f);
  34. extern void release_fiq(struct fiq_handler *f);
  35. extern void set_fiq_handler(void *start, unsigned int length);
  36. extern void enable_fiq(int fiq);
  37. extern void disable_fiq(int fiq);
  38. extern void fiq_set_type(int fiq, unsigned int type);
  39. #else
  40. static inline int claim_fiq(struct fiq_handler *f)
  41. {
  42. return 0;
  43. }
  44. static inline void release_fiq(struct fiq_handler *f) { }
  45. static inline void set_fiq_handler(void *start, unsigned int length) { }
  46. static inline void enable_fiq(int fiq) { }
  47. static inline void disable_fiq(int fiq) { }
  48. static inline void fiq_set_type(int fiq, unsigned int type) { }
  49. #endif
  50. /* helpers defined in fiqasm.S: */
  51. extern void __set_fiq_regs(unsigned long const *regs);
  52. extern void __get_fiq_regs(unsigned long *regs);
  53. static inline void set_fiq_regs(struct pt_regs const *regs)
  54. {
  55. __set_fiq_regs(&regs->ARM_r8);
  56. }
  57. static inline void get_fiq_regs(struct pt_regs *regs)
  58. {
  59. __get_fiq_regs(&regs->ARM_r8);
  60. }
  61. #endif