timer_32.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * timer.h: Definitions for the timer chips on the Sparc.
  3. *
  4. * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
  5. */
  6. #ifndef _SPARC_TIMER_H
  7. #define _SPARC_TIMER_H
  8. #include <asm/system.h> /* For SUN4M_NCPUS */
  9. #include <asm/btfixup.h>
  10. /* Timer structures. The interrupt timer has two properties which
  11. * are the counter (which is handled in do_timer in sched.c) and the limit.
  12. * This limit is where the timer's counter 'wraps' around. Oddly enough,
  13. * the sun4c timer when it hits the limit wraps back to 1 and not zero
  14. * thus when calculating the value at which it will fire a microsecond you
  15. * must adjust by one. Thanks SUN for designing such great hardware ;(
  16. */
  17. /* Note that I am only going to use the timer that interrupts at
  18. * Sparc IRQ 10. There is another one available that can fire at
  19. * IRQ 14. Currently it is left untouched, we keep the PROM's limit
  20. * register value and let the prom take these interrupts. This allows
  21. * L1-A to work.
  22. */
  23. struct sun4c_timer_info {
  24. __volatile__ unsigned int cur_count10;
  25. __volatile__ unsigned int timer_limit10;
  26. __volatile__ unsigned int cur_count14;
  27. __volatile__ unsigned int timer_limit14;
  28. };
  29. #define SUN_TIMER_PHYSADDR 0xf3000000
  30. extern __volatile__ unsigned int *master_l10_counter;
  31. extern __volatile__ unsigned int *master_l10_limit;
  32. /* FIXME: Make do_[gs]ettimeofday btfixup calls */
  33. BTFIXUPDEF_CALL(int, bus_do_settimeofday, struct timespec *tv)
  34. #define bus_do_settimeofday(tv) BTFIXUP_CALL(bus_do_settimeofday)(tv)
  35. #endif /* !(_SPARC_TIMER_H) */