Use a spinlock to protect the vdma data structures.
[linux-2.6/linux-mips.git] / include / asm-alpha / ide.h
blob603d85ab15d96fb4b200595aaf2116e7d7ea520a
1 /*
2 * linux/include/asm-alpha/ide.h
4 * Copyright (C) 1994-1996 Linus Torvalds & authors
5 */
7 /*
8 * This file contains the alpha architecture specific IDE code.
9 */
11 #ifndef __ASMalpha_IDE_H
12 #define __ASMalpha_IDE_H
14 #ifdef __KERNEL__
16 #include <linux/config.h>
18 #ifndef MAX_HWIFS
19 #define MAX_HWIFS CONFIG_IDE_MAX_HWIFS
20 #endif
22 static __inline__ int ide_default_irq(ide_ioreg_t base)
24 switch (base) {
25 case 0x1f0: return 14;
26 case 0x170: return 15;
27 case 0x1e8: return 11;
28 case 0x168: return 10;
29 default:
30 return 0;
34 static __inline__ ide_ioreg_t ide_default_io_base(int index)
36 switch (index) {
37 case 0: return 0x1f0;
38 case 1: return 0x170;
39 case 2: return 0x1e8;
40 case 3: return 0x168;
41 default:
42 return 0;
46 static __inline__ void ide_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data_port, ide_ioreg_t ctrl_port, int *irq)
48 ide_ioreg_t reg = data_port;
49 int i;
51 for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
52 hw->io_ports[i] = reg;
53 reg += 1;
55 if (ctrl_port) {
56 hw->io_ports[IDE_CONTROL_OFFSET] = ctrl_port;
57 } else {
58 hw->io_ports[IDE_CONTROL_OFFSET] = hw->io_ports[IDE_DATA_OFFSET] + 0x206;
60 if (irq != NULL)
61 *irq = 0;
62 hw->io_ports[IDE_IRQ_OFFSET] = 0;
66 * This registers the standard ports for this architecture with the IDE
67 * driver.
69 static __inline__ void ide_init_default_hwifs(void)
71 #ifndef CONFIG_PCI
72 hw_regs_t hw;
73 int index;
75 for (index = 0; index < MAX_HWIFS; index++) {
76 ide_init_hwif_ports(&hw, ide_default_io_base(index), 0, NULL);
77 hw.irq = ide_default_irq(ide_default_io_base(index));
78 ide_register_hw(&hw, NULL);
80 #endif
83 #include <asm-generic/ide_iops.h>
85 #endif /* __KERNEL__ */
87 #endif /* __ASMalpha_IDE_H */