2 * drivers/s390/cio/airq.c
3 * S/390 common I/O routines -- support for adapter interruptions
5 * Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH,
7 * Author(s): Ingo Adlung (adlung@de.ibm.com)
8 * Cornelia Huck (cornelia.huck@de.ibm.com)
9 * Arnd Bergmann (arndb@de.ibm.com)
12 #include <linux/init.h>
13 #include <linux/module.h>
14 #include <linux/slab.h>
15 #include <linux/rcupdate.h>
17 #include "cio_debug.h"
20 static adapter_int_handler_t adapter_handler
;
23 * register for adapter interrupts
25 * With HiperSockets the zSeries architecture provides for
26 * means of adapter interrups, pseudo I/O interrupts that are
27 * not tied to an I/O subchannel, but to an adapter. However,
28 * it doesn't disclose the info how to enable/disable them, but
29 * to recognize them only. Perhaps we should consider them
30 * being shared interrupts, and thus build a linked list
31 * of adapter handlers ... to be evaluated ...
34 s390_register_adapter_interrupt (adapter_int_handler_t handler
)
39 CIO_TRACE_EVENT (4, "rgaint");
44 ret
= (cmpxchg(&adapter_handler
, NULL
, handler
) ? -EBUSY
: 0);
46 synchronize_sched(); /* Allow interrupts to complete. */
48 sprintf (dbf_txt
, "ret:%d", ret
);
49 CIO_TRACE_EVENT (4, dbf_txt
);
55 s390_unregister_adapter_interrupt (adapter_int_handler_t handler
)
60 CIO_TRACE_EVENT (4, "urgaint");
65 adapter_handler
= NULL
;
66 synchronize_sched(); /* Allow interrupts to complete. */
69 sprintf (dbf_txt
, "ret:%d", ret
);
70 CIO_TRACE_EVENT (4, dbf_txt
);
78 CIO_TRACE_EVENT (6, "doaio");
81 (*adapter_handler
) ();
84 EXPORT_SYMBOL (s390_register_adapter_interrupt
);
85 EXPORT_SYMBOL (s390_unregister_adapter_interrupt
);