user_accessible_timer.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* Copyright (c) 2012, The Linux Foundation. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. */
  12. #ifndef _ARM_KERNEL_USER_ACCESSIBLE_TIMER_H_
  13. #define _ARM_KERNEL_USER_ACCESSIBLE_TIMER_H_
  14. #define ARM_USER_ACCESSIBLE_TIMERS_INVALID_PAGE -1
  15. extern unsigned long zero_pfn;
  16. #ifdef CONFIG_ARM_USE_USER_ACCESSIBLE_TIMERS
  17. #ifndef CONFIG_ARM_USER_ACCESSIBLE_TIMER_BASE
  18. #define CONFIG_ARM_USER_ACCESSIBLE_TIMER_BASE 0xfffef000
  19. #endif
  20. extern void setup_user_timer_offset(unsigned long addr);
  21. extern int get_timer_page_address(void);
  22. static inline int get_user_accessible_timers_base(void)
  23. {
  24. return CONFIG_ARM_USER_ACCESSIBLE_TIMER_BASE;
  25. }
  26. extern void set_user_accessible_timer_flag(bool flag);
  27. #else
  28. #define CONFIG_ARM_USER_ACCESSIBLE_TIMER_BASE 0
  29. static inline void setup_user_timer_offset(unsigned long addr)
  30. {
  31. }
  32. static inline int get_timer_page_address(void)
  33. {
  34. return ARM_USER_ACCESSIBLE_TIMERS_INVALID_PAGE;
  35. }
  36. static inline int get_user_accessible_timers_base(void)
  37. {
  38. return 0;
  39. }
  40. static inline void set_user_accessible_timer_flag(bool flag)
  41. {
  42. }
  43. #endif
  44. #endif