summaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/airq.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 15:20:36 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 15:20:36 -0700
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /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.c87
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 00000000000..3720e77b465
--- /dev/null
+++ b/drivers/s390/cio/airq.c
@@ -0,0 +1,87 @@
+/*
+ * drivers/s390/cio/airq.c
+ * S/390 common I/O routines -- support for adapter interruptions
+ *
+ * $Revision: 1.12 $
+ *
+ * Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH,
+ * IBM Corporation
+ * Author(s): Ingo Adlung (adlung@de.ibm.com)
+ * Cornelia Huck (cohuck@de.ibm.com)
+ * Arnd Bergmann (arndb@de.ibm.com)
+ */
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/slab.h>
+#include <linux/rcupdate.h>
+
+#include "cio_debug.h"
+#include "airq.h"
+
+static adapter_int_handler_t adapter_handler;
+
+/*
+ * register for adapter interrupts
+ *
+ * With HiperSockets the zSeries architecture provides for
+ * means of adapter interrups, pseudo I/O interrupts that are
+ * not tied to an I/O subchannel, but to an adapter. However,
+ * it doesn't disclose the info how to enable/disable them, but
+ * to recognize them only. Perhaps we should consider them
+ * being shared interrupts, and thus build a linked list
+ * of adapter handlers ... to be evaluated ...
+ */
+int
+s390_register_adapter_interrupt (adapter_int_handler_t handler)
+{
+ int ret;
+ char dbf_txt[15];
+
+ CIO_TRACE_EVENT (4, "rgaint");
+
+ if (handler == NULL)
+ ret = -EINVAL;
+ else
+ ret = (cmpxchg(&adapter_handler, NULL, handler) ? -EBUSY : 0);
+ if (!ret)
+ synchronize_kernel();
+
+ sprintf (dbf_txt, "ret:%d", ret);
+ CIO_TRACE_EVENT (4, dbf_txt);
+
+ return ret;
+}
+
+int
+s390_unregister_adapter_interrupt (adapter_int_handler_t handler)
+{
+ int ret;
+ char dbf_txt[15];
+
+ CIO_TRACE_EVENT (4, "urgaint");
+
+ if (handler == NULL)
+ ret = -EINVAL;
+ else {
+ adapter_handler = NULL;
+ synchronize_kernel();
+ ret = 0;
+ }
+ sprintf (dbf_txt, "ret:%d", ret);
+ CIO_TRACE_EVENT (4, dbf_txt);
+
+ return ret;
+}
+
+void
+do_adapter_IO (void)
+{
+ CIO_TRACE_EVENT (6, "doaio");
+
+ if (adapter_handler)
+ (*adapter_handler) ();
+}
+
+EXPORT_SYMBOL (s390_register_adapter_interrupt);
+EXPORT_SYMBOL (s390_unregister_adapter_interrupt);