File: idals.c

package info (click to toggle)
kernel-source-2.2.19 2.2.19.1-4woody1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 92,100 kB
  • ctags: 276,892
  • sloc: ansic: 1,710,384; asm: 58,709; makefile: 10,198; sh: 2,398; perl: 907; tcl: 570; lisp: 218; cpp: 186; awk: 133; sed: 72
file content (44 lines) | stat: -rw-r--r-- 1,049 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/* 
   * File...........: linux/drivers/s390x/idals.c
   * 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/malloc.h>

#include <asm/irq.h>
#include <asm/idals.h>

#ifdef CONFIG_ARCH_S390X
void 
set_normalized_cda ( ccw1_t * cp, unsigned long address )
{
	int nridaws;
	idaw_t *idal;
        int count = cp->count;

	if (cp->flags & CCW_FLAG_IDA)
		BUG();
	if (((address + count) >> 31) == 0)
		cp -> cda = address;
		return;
        nridaws = ((address & 2047L) + count + 2047L) >> 11;
	idal = idal_alloc(nridaws);
	if ( idal == NULL ) {
		/* probably we should have a fallback here */
		panic ("Cannot allocate memory for IDAL\n");
	}
	cp->flags |= CCW_FLAG_IDA;
	cp->cda = (__u32)(unsigned long)(idaw_t *)idal;
        do {
		*idal++ = address;
		address = (address & -2048L) + 2048;
		nridaws --;
        } while ( nridaws > 0 );
	return;
}
#endif