diff options
author | David S. Miller <davem@davemloft.net> | 2009-01-30 00:22:47 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-01-30 03:03:53 -0500 |
commit | e5553a6d04421eec326a629571d696e8e745a0e4 (patch) | |
tree | b6fe49a18135dbe27a464fb78828b2150c679689 /arch/sparc/kernel/pcr.c | |
parent | c3cf5e8cc56d272f828a66610bb78bbb727b2ce1 (diff) |
sparc64: Implement NMI watchdog on capable cpus.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/kernel/pcr.c')
-rw-r--r-- | arch/sparc/kernel/pcr.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/arch/sparc/kernel/pcr.c b/arch/sparc/kernel/pcr.c index c4f24703b165..92e0dda141a4 100644 --- a/arch/sparc/kernel/pcr.c +++ b/arch/sparc/kernel/pcr.c | |||
@@ -9,12 +9,22 @@ | |||
9 | 9 | ||
10 | #include <asm/pil.h> | 10 | #include <asm/pil.h> |
11 | #include <asm/pcr.h> | 11 | #include <asm/pcr.h> |
12 | #include <asm/nmi.h> | ||
12 | 13 | ||
13 | /* This code is shared between various users of the performance | 14 | /* This code is shared between various users of the performance |
14 | * counters. Users will be oprofile, pseudo-NMI watchdog, and the | 15 | * counters. Users will be oprofile, pseudo-NMI watchdog, and the |
15 | * perf_counter support layer. | 16 | * perf_counter support layer. |
16 | */ | 17 | */ |
17 | 18 | ||
19 | #define PCR_SUN4U_ENABLE (PCR_PIC_PRIV | PCR_STRACE | PCR_UTRACE) | ||
20 | #define PCR_N2_ENABLE (PCR_PIC_PRIV | PCR_STRACE | PCR_UTRACE | \ | ||
21 | PCR_N2_TOE_OV1 | \ | ||
22 | (2 << PCR_N2_SL1_SHIFT) | \ | ||
23 | (0xff << PCR_N2_MASK1_SHIFT)) | ||
24 | |||
25 | u64 pcr_enable; | ||
26 | unsigned int picl_shift; | ||
27 | |||
18 | /* Performance counter interrupts run unmasked at PIL level 15. | 28 | /* Performance counter interrupts run unmasked at PIL level 15. |
19 | * Therefore we can't do things like wakeups and other work | 29 | * Therefore we can't do things like wakeups and other work |
20 | * that expects IRQ disabling to be adhered to in locking etc. | 30 | * that expects IRQ disabling to be adhered to in locking etc. |
@@ -117,12 +127,15 @@ int __init pcr_arch_init(void) | |||
117 | switch (tlb_type) { | 127 | switch (tlb_type) { |
118 | case hypervisor: | 128 | case hypervisor: |
119 | pcr_ops = &n2_pcr_ops; | 129 | pcr_ops = &n2_pcr_ops; |
130 | pcr_enable = PCR_N2_ENABLE; | ||
131 | picl_shift = 2; | ||
120 | break; | 132 | break; |
121 | 133 | ||
122 | case spitfire: | ||
123 | case cheetah: | 134 | case cheetah: |
124 | case cheetah_plus: | 135 | case cheetah_plus: |
136 | case spitfire: | ||
125 | pcr_ops = &direct_pcr_ops; | 137 | pcr_ops = &direct_pcr_ops; |
138 | pcr_enable = PCR_SUN4U_ENABLE; | ||
126 | break; | 139 | break; |
127 | 140 | ||
128 | default: | 141 | default: |
@@ -130,7 +143,7 @@ int __init pcr_arch_init(void) | |||
130 | goto out_unregister; | 143 | goto out_unregister; |
131 | } | 144 | } |
132 | 145 | ||
133 | return 0; | 146 | return nmi_init(); |
134 | 147 | ||
135 | out_unregister: | 148 | out_unregister: |
136 | unregister_perf_hsvc(); | 149 | unregister_perf_hsvc(); |