2 * drivers/s390/cio/airq.c
3 * S/390 common I/O routines -- support for adapter interruptions
7 * Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH,
9 * Author(s): Ingo Adlung (adlung@de.ibm.com)
10 * Cornelia Huck (cohuck@de.ibm.com)
11 * Arnd Bergmann (arndb@de.ibm.com)
14 #include <linux/init.h>
15 #include <linux/module.h>
16 #include <linux/slab.h>
17 #include <linux/rcupdate.h>
19 #include "cio_debug.h"
22 static adapter_int_handler_t adapter_handler
;
25 * register for adapter interrupts
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 ...
36 s390_register_adapter_interrupt (adapter_int_handler_t handler
)
41 CIO_TRACE_EVENT (4, "rgaint");
46 ret
= (cmpxchg(&adapter_handler
, NULL
, handler
) ? -EBUSY
: 0);
48 synchronize_sched(); /* Allow interrupts to complete. */
50 sprintf (dbf_txt
, "ret:%d", ret
);
51 CIO_TRACE_EVENT (4, dbf_txt
);
57 s390_unregister_adapter_interrupt (adapter_int_handler_t handler
)
62 CIO_TRACE_EVENT (4, "urgaint");
67 adapter_handler
= NULL
;
68 synchronize_sched(); /* Allow interrupts to complete. */
71 sprintf (dbf_txt
, "ret:%d", ret
);
72 CIO_TRACE_EVENT (4, dbf_txt
);
80 CIO_TRACE_EVENT (6, "doaio");
83 (*adapter_handler
) ();
86 EXPORT_SYMBOL (s390_register_adapter_interrupt
);
87 EXPORT_SYMBOL (s390_unregister_adapter_interrupt
);