localtimer.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * arch/arm/include/asm/localtimer.h
  3. *
  4. * Copyright (C) 2004-2005 ARM Ltd.
  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 version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #ifndef __ASM_ARM_LOCALTIMER_H
  11. #define __ASM_ARM_LOCALTIMER_H
  12. #include <linux/errno.h>
  13. struct clock_event_device;
  14. struct local_timer_ops {
  15. int (*setup)(struct clock_event_device *);
  16. void (*stop)(struct clock_event_device *);
  17. };
  18. /*
  19. * Setup a per-cpu timer, whether it be a local timer or dummy broadcast
  20. */
  21. void percpu_timer_setup(void);
  22. #ifdef CONFIG_LOCAL_TIMERS
  23. /*
  24. * Stop the local timer
  25. */
  26. void local_timer_stop(struct clock_event_device *);
  27. /*
  28. * Setup a local timer interrupt for a CPU.
  29. */
  30. int local_timer_setup(struct clock_event_device *);
  31. /*
  32. * Register a local timer driver
  33. */
  34. int local_timer_register(struct local_timer_ops *);
  35. #else
  36. static inline int local_timer_setup(struct clock_event_device *evt)
  37. {
  38. return -ENXIO;
  39. }
  40. static inline void local_timer_stop(struct clock_event_device *evt)
  41. {
  42. }
  43. static inline int local_timer_register(struct local_timer_ops *ops)
  44. {
  45. return -ENXIO;
  46. }
  47. #endif
  48. #endif