time.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * arch/arm/include/asm/mach/time.h
  3. *
  4. * Copyright (C) 2004 MontaVista Software, Inc.
  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_MACH_TIME_H
  11. #define __ASM_ARM_MACH_TIME_H
  12. /*
  13. * This is our kernel timer structure.
  14. *
  15. * - init
  16. * Initialise the kernels jiffy timer source, claim interrupt
  17. * using setup_irq. This is called early on during initialisation
  18. * while interrupts are still disabled on the local CPU.
  19. * - suspend
  20. * Suspend the kernel jiffy timer source, if necessary. This
  21. * is called with interrupts disabled, after all normal devices
  22. * have been suspended. If no action is required, set this to
  23. * NULL.
  24. * - resume
  25. * Resume the kernel jiffy timer source, if necessary. This
  26. * is called with interrupts disabled before any normal devices
  27. * are resumed. If no action is required, set this to NULL.
  28. * - offset
  29. * Return the timer offset in microseconds since the last timer
  30. * interrupt. Note: this must take account of any unprocessed
  31. * timer interrupt which may be pending.
  32. */
  33. struct sys_timer {
  34. void (*init)(void);
  35. void (*suspend)(void);
  36. void (*resume)(void);
  37. #ifdef CONFIG_ARCH_USES_GETTIMEOFFSET
  38. unsigned long (*offset)(void);
  39. #endif
  40. };
  41. extern void timer_tick(void);
  42. struct timespec;
  43. typedef void (*clock_access_fn)(struct timespec *);
  44. extern int register_persistent_clock(clock_access_fn read_boot,
  45. clock_access_fn read_persistent);
  46. #endif