summaryrefslogtreecommitdiffstats
path: root/include/asm-s390/idals.h
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2001-03-09 20:33:35 +0000
committerRalf Baechle <ralf@linux-mips.org>2001-03-09 20:33:35 +0000
commit116674acc97ba75a720329996877077d988443a2 (patch)
tree6a3f2ff0b612ae2ee8a3f3509370c9e6333a53b3 /include/asm-s390/idals.h
parent71118c319fcae4a138f16e35b4f7e0a6d53ce2ca (diff)
Merge with Linux 2.4.2.
Diffstat (limited to 'include/asm-s390/idals.h')
-rw-r--r--include/asm-s390/idals.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/include/asm-s390/idals.h b/include/asm-s390/idals.h
new file mode 100644
index 000000000..7d5232b65
--- /dev/null
+++ b/include/asm-s390/idals.h
@@ -0,0 +1,57 @@
+/*
+ * File...........: linux/include/asm-s390x/idals.h
+ * Author(s)......: Holger Smolinski <Holger.Smolinski@de.ibm.com>
+ * Bugreports.to..: <Linux390@de.ibm.com>
+ * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 2000a
+
+ * History of changes
+ * 07/24/00 new file
+ */
+#include <linux/config.h>
+#include <asm/irq.h>
+
+typedef unsigned long idaw_t;
+
+static inline idaw_t *
+idal_alloc ( int nridaws )
+{
+ if ( nridaws > 33 )
+ BUG();
+ return kmalloc(nridaws * sizeof(idaw_t), GFP_ATOMIC | GFP_DMA );
+}
+
+static inline void
+idal_free ( idaw_t *idal )
+{
+ kfree (idal);
+}
+
+/*
+ * Function: set_normalized_cda
+ * sets the address of the data in CCW
+ * if necessary it allocates an IDAL and sets sthe appropriate flags
+ */
+#if defined (CONFIG_ARCH_S390X)
+extern void set_normalized_cda(ccw1_t * ccw, unsigned long address);
+#else
+static inline void
+set_normalized_cda(ccw1_t * ccw, unsigned long address)
+{
+ ccw->cda = address;
+}
+#endif
+
+/*
+ * Function: clear_normalized_cda
+ * releases any allocated IDAL related to the CCW
+ */
+static inline void
+clear_normalized_cda ( ccw1_t * ccw )
+{
+ if ( ccw -> flags & CCW_FLAG_IDA ) {
+ idal_free ( (idaw_t *) (ccw -> cda ));
+ ccw -> flags &= ~CCW_FLAG_IDA;
+ }
+ ccw -> cda = 0;
+}
+