Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* tick14.c |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | #include <linux/kernel.h> |
Al Viro | 32231a6 | 2007-07-21 19:18:57 -0700 | [diff] [blame] | 10 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 11 | extern unsigned long lvl14_save[5]; |
| 12 | static unsigned long *linux_lvl14 = NULL; |
| 13 | static unsigned long obp_lvl14[4]; |
| 14 | |
| 15 | /* |
| 16 | * Call with timer IRQ closed. |
| 17 | * First time we do it with disable_irq, later prom code uses spin_lock_irq(). |
| 18 | */ |
| 19 | void install_linux_ticker(void) |
| 20 | { |
| 21 | |
| 22 | if (!linux_lvl14) |
| 23 | return; |
| 24 | linux_lvl14[0] = lvl14_save[0]; |
| 25 | linux_lvl14[1] = lvl14_save[1]; |
| 26 | linux_lvl14[2] = lvl14_save[2]; |
| 27 | linux_lvl14[3] = lvl14_save[3]; |
| 28 | } |
| 29 | |
| 30 | void install_obp_ticker(void) |
| 31 | { |
| 32 | |
| 33 | if (!linux_lvl14) |
| 34 | return; |
| 35 | linux_lvl14[0] = obp_lvl14[0]; |
| 36 | linux_lvl14[1] = obp_lvl14[1]; |
| 37 | linux_lvl14[2] = obp_lvl14[2]; |
| 38 | linux_lvl14[3] = obp_lvl14[3]; |
| 39 | } |