Linux Kernel
3.7.1
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
drivers
s390
cio
isc.c
Go to the documentation of this file.
1
/*
2
* Functions for registration of I/O interruption subclasses on s390.
3
*
4
* Copyright IBM Corp. 2008
5
* Authors: Sebastian Ott <
[email protected]
>
6
*/
7
8
#include <
linux/spinlock.h
>
9
#include <linux/module.h>
10
#include <
asm/isc.h
>
11
12
static
unsigned
int
isc_refs[
MAX_ISC
+ 1];
13
static
DEFINE_SPINLOCK
(isc_ref_lock);
14
15
26
void
isc_register
(
unsigned
int
isc
)
27
{
28
if
(isc >
MAX_ISC
) {
29
WARN_ON
(1);
30
return
;
31
}
32
33
spin_lock(&isc_ref_lock);
34
if
(isc_refs[isc] == 0)
35
ctl_set_bit
(6, 31 - isc);
36
isc_refs[
isc
]++;
37
spin_unlock(&isc_ref_lock);
38
}
39
EXPORT_SYMBOL_GPL
(
isc_register
);
40
54
void
isc_unregister
(
unsigned
int
isc
)
55
{
56
spin_lock(&isc_ref_lock);
57
/* check for misuse */
58
if
(isc >
MAX_ISC
|| isc_refs[isc] == 0) {
59
WARN_ON
(1);
60
goto
out_unlock;
61
}
62
if
(isc_refs[isc] == 1)
63
ctl_clear_bit
(6, 31 - isc);
64
isc_refs[
isc
]--;
65
out_unlock:
66
spin_unlock(&isc_ref_lock);
67
}
68
EXPORT_SYMBOL_GPL
(
isc_unregister
);
Generated on Thu Jan 10 2013 14:17:53 for Linux Kernel by
1.8.2