setup enviroment for compilation
[linux-2.4.21-pre4.git] / drivers / s390 / idals.c
1 /* 
2    * File...........: linux/drivers/s390x/idals.c
3    * Author(s)......: Holger Smolinski <Holger.Smolinski@de.ibm.com>
4    * Bugreports.to..: <Linux390@de.ibm.com>
5    * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 2000a
6    
7    * History of changes
8    * 07/24/00 new file
9    * 12/13/00 changed IDALs to 4kByte-IDALs
10  */
11
12 #include <linux/module.h>
13 #include <linux/config.h>
14 #include <linux/slab.h>
15
16 #include <asm/irq.h>
17 #include <asm/idals.h>
18
19 #ifdef CONFIG_ARCH_S390X
20
21 unsigned long __create_idal (unsigned long address, int count)
22 {
23         int nridaws;
24         unsigned long *idal, *tmp;
25
26         nridaws = ((address & (IDA_BLOCK_SIZE-1)) + count + 
27                    (IDA_BLOCK_SIZE-1)) >> IDA_SIZE_LOG;
28         idal = idal_alloc(nridaws);
29         if (idal != NULL) {
30                 tmp = idal;
31                 *tmp++ = address;
32                 address &= -IDA_BLOCK_SIZE;
33                 while (--nridaws > 0) {
34                         address += IDA_BLOCK_SIZE;
35                         *tmp++ = address;
36                 }
37         }
38         return (unsigned long) idal;
39 }
40
41 EXPORT_SYMBOL (__create_idal);
42
43 #endif