diff options
author | Jan Glauber <jang@linux.vnet.ibm.com> | 2012-03-23 11:13:05 +0100 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2012-03-23 11:13:24 +0100 |
commit | b03d541aa45b52e1b723890121a9fe3920eb438b (patch) | |
tree | 923c4bc9c618614634b536199ec1e4d1c74cdc83 /arch/s390/kernel/irq.c | |
parent | 61d84979ab9826c292812059f99248603da28fba (diff) | |
download | linux-stable-b03d541aa45b52e1b723890121a9fe3920eb438b.tar.gz linux-stable-b03d541aa45b52e1b723890121a9fe3920eb438b.tar.bz2 linux-stable-b03d541aa45b52e1b723890121a9fe3920eb438b.zip |
[S390] oprofile: Allow multiple users of the measurement alert interrupt
Prepare the measurement facility which is currently only used by oprofile
for multiple users. To achieve that the measurement alert interrupt control
bit needs to be protected. The measurement alert definitions are moved
to a header file and an interrupt mask is added so that users can discard
interrupts if they are for a different measurement subsystem.
Reviewed-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/irq.c')
-rw-r--r-- | arch/s390/kernel/irq.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/s390/kernel/irq.c b/arch/s390/kernel/irq.c index 2429ecd68872..1c2cdd59ccd0 100644 --- a/arch/s390/kernel/irq.c +++ b/arch/s390/kernel/irq.c @@ -255,3 +255,26 @@ void service_subclass_irq_unregister(void) spin_unlock(&sc_irq_lock); } EXPORT_SYMBOL(service_subclass_irq_unregister); + +static DEFINE_SPINLOCK(ma_subclass_lock); +static int ma_subclass_refcount; + +void measurement_alert_subclass_register(void) +{ + spin_lock(&ma_subclass_lock); + if (!ma_subclass_refcount) + ctl_set_bit(0, 5); + ma_subclass_refcount++; + spin_unlock(&ma_subclass_lock); +} +EXPORT_SYMBOL(measurement_alert_subclass_register); + +void measurement_alert_subclass_unregister(void) +{ + spin_lock(&ma_subclass_lock); + ma_subclass_refcount--; + if (!ma_subclass_refcount) + ctl_clear_bit(0, 5); + spin_unlock(&ma_subclass_lock); +} +EXPORT_SYMBOL(measurement_alert_subclass_unregister); |