tick14.c 883 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /* tick14.c
  2. *
  3. * Copyright (C) 1996 David Redman (djhr@tadpole.co.uk)
  4. *
  5. * This file handles the Sparc specific level14 ticker
  6. * This is really useful for profiling OBP uses it for keyboard
  7. * aborts and other stuff.
  8. */
  9. #include <linux/kernel.h>
  10. extern unsigned long lvl14_save[5];
  11. static unsigned long *linux_lvl14 = NULL;
  12. static unsigned long obp_lvl14[4];
  13. /*
  14. * Call with timer IRQ closed.
  15. * First time we do it with disable_irq, later prom code uses spin_lock_irq().
  16. */
  17. void install_linux_ticker(void)
  18. {
  19. if (!linux_lvl14)
  20. return;
  21. linux_lvl14[0] = lvl14_save[0];
  22. linux_lvl14[1] = lvl14_save[1];
  23. linux_lvl14[2] = lvl14_save[2];
  24. linux_lvl14[3] = lvl14_save[3];
  25. }
  26. void install_obp_ticker(void)
  27. {
  28. if (!linux_lvl14)
  29. return;
  30. linux_lvl14[0] = obp_lvl14[0];
  31. linux_lvl14[1] = obp_lvl14[1];
  32. linux_lvl14[2] = obp_lvl14[2];
  33. linux_lvl14[3] = obp_lvl14[3];
  34. }