diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
commit | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch) | |
tree | 0bba044c4ce775e45a88a51686b5d9f90697ea9d /drivers/s390/cio/airq.c |
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.
Let it rip!
Diffstat (limited to 'drivers/s390/cio/airq.c')
-rw-r--r-- | drivers/s390/cio/airq.c | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/drivers/s390/cio/airq.c b/drivers/s390/cio/airq.c new file mode 100644 index 000000000000..3720e77b465f --- /dev/null +++ b/drivers/s390/cio/airq.c | |||
@@ -0,0 +1,87 @@ | |||
1 | /* | ||
2 | * drivers/s390/cio/airq.c | ||
3 | * S/390 common I/O routines -- support for adapter interruptions | ||
4 | * | ||
5 | * $Revision: 1.12 $ | ||
6 | * | ||
7 | * Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH, | ||
8 | * IBM Corporation | ||
9 | * Author(s): Ingo Adlung (adlung@de.ibm.com) | ||
10 | * Cornelia Huck (cohuck@de.ibm.com) | ||
11 | * Arnd Bergmann (arndb@de.ibm.com) | ||
12 | */ | ||
13 | |||
14 | #include <linux/init.h> | ||
15 | #include <linux/module.h> | ||
16 | #include <linux/slab.h> | ||
17 | #include <linux/rcupdate.h> | ||
18 | |||
19 | #include "cio_debug.h" | ||
20 | #include "airq.h" | ||
21 | |||
22 | static adapter_int_handler_t adapter_handler; | ||
23 | |||
24 | /* | ||
25 | * register for adapter interrupts | ||
26 | * | ||
27 | * With HiperSockets the zSeries architecture provides for | ||
28 | * means of adapter interrups, pseudo I/O interrupts that are | ||
29 | * not tied to an I/O subchannel, but to an adapter. However, | ||
30 | * it doesn't disclose the info how to enable/disable them, but | ||
31 | * to recognize them only. Perhaps we should consider them | ||
32 | * being shared interrupts, and thus build a linked list | ||
33 | * of adapter handlers ... to be evaluated ... | ||
34 | */ | ||
35 | int | ||
36 | s390_register_adapter_interrupt (adapter_int_handler_t handler) | ||
37 | { | ||
38 | int ret; | ||
39 | char dbf_txt[15]; | ||
40 | |||
41 | CIO_TRACE_EVENT (4, "rgaint"); | ||
42 | |||
43 | if (handler == NULL) | ||
44 | ret = -EINVAL; | ||
45 | else | ||
46 | ret = (cmpxchg(&adapter_handler, NULL, handler) ? -EBUSY : 0); | ||
47 | if (!ret) | ||
48 | synchronize_kernel(); | ||
49 | |||
50 | sprintf (dbf_txt, "ret:%d", ret); | ||
51 | CIO_TRACE_EVENT (4, dbf_txt); | ||
52 | |||
53 | return ret; | ||
54 | } | ||
55 | |||
56 | int | ||
57 | s390_unregister_adapter_interrupt (adapter_int_handler_t handler) | ||
58 | { | ||
59 | int ret; | ||
60 | char dbf_txt[15]; | ||
61 | |||
62 | CIO_TRACE_EVENT (4, "urgaint"); | ||
63 | |||
64 | if (handler == NULL) | ||
65 | ret = -EINVAL; | ||
66 | else { | ||
67 | adapter_handler = NULL; | ||
68 | synchronize_kernel(); | ||
69 | ret = 0; | ||
70 | } | ||
71 | sprintf (dbf_txt, "ret:%d", ret); | ||
72 | CIO_TRACE_EVENT (4, dbf_txt); | ||
73 | |||
74 | return ret; | ||
75 | } | ||
76 | |||
77 | void | ||
78 | do_adapter_IO (void) | ||
79 | { | ||
80 | CIO_TRACE_EVENT (6, "doaio"); | ||
81 | |||
82 | if (adapter_handler) | ||
83 | (*adapter_handler) (); | ||
84 | } | ||
85 | |||
86 | EXPORT_SYMBOL (s390_register_adapter_interrupt); | ||
87 | EXPORT_SYMBOL (s390_unregister_adapter_interrupt); | ||