This source file includes following definitions.
- isc_register
- isc_unregister
1
2
3
4
5
6
7
8
9 #include <linux/spinlock.h>
10 #include <linux/module.h>
11 #include <asm/isc.h>
12
13 static unsigned int isc_refs[MAX_ISC + 1];
14 static DEFINE_SPINLOCK(isc_ref_lock);
15
16
17
18
19
20
21
22
23
24
25
26
27 void isc_register(unsigned int isc)
28 {
29 if (isc > MAX_ISC) {
30 WARN_ON(1);
31 return;
32 }
33
34 spin_lock(&isc_ref_lock);
35 if (isc_refs[isc] == 0)
36 ctl_set_bit(6, 31 - isc);
37 isc_refs[isc]++;
38 spin_unlock(&isc_ref_lock);
39 }
40 EXPORT_SYMBOL_GPL(isc_register);
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55 void isc_unregister(unsigned int isc)
56 {
57 spin_lock(&isc_ref_lock);
58
59 if (isc > MAX_ISC || isc_refs[isc] == 0) {
60 WARN_ON(1);
61 goto out_unlock;
62 }
63 if (isc_refs[isc] == 1)
64 ctl_clear_bit(6, 31 - isc);
65 isc_refs[isc]--;
66 out_unlock:
67 spin_unlock(&isc_ref_lock);
68 }
69 EXPORT_SYMBOL_GPL(isc_unregister);