The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/include/asm-alpha/ide.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*
    2  *  linux/include/asm-alpha/ide.h
    3  *
    4  *  Copyright (C) 1994-1996  Linus Torvalds & authors
    5  */
    6 
    7 /*
    8  *  This file contains the alpha architecture specific IDE code.
    9  */
   10 
   11 #ifndef __ASMalpha_IDE_H
   12 #define __ASMalpha_IDE_H
   13 
   14 #ifdef __KERNEL__
   15 
   16 #include <linux/config.h>
   17 
   18 #ifndef MAX_HWIFS
   19 #define MAX_HWIFS       4
   20 #endif
   21 
   22 static __inline__ int ide_default_irq(ide_ioreg_t base)
   23 {
   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;
   31         }
   32 }
   33 
   34 static __inline__ ide_ioreg_t ide_default_io_base(int index)
   35 {
   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;
   43         }
   44 }
   45 
   46 static __inline__ void ide_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data_port, ide_ioreg_t ctrl_port, int *irq)
   47 {
   48         ide_ioreg_t reg = data_port;
   49         int i;
   50 
   51         for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
   52                 hw->io_ports[i] = reg;
   53                 reg += 1;
   54         }
   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;
   59         }
   60         if (irq != NULL)
   61                 *irq = 0;
   62         hw->io_ports[IDE_IRQ_OFFSET] = 0;
   63 }
   64 
   65 /*
   66  * This registers the standard ports for this architecture with the IDE
   67  * driver.
   68  */
   69 static __inline__ void ide_init_default_hwifs(void)
   70 {
   71 #ifndef CONFIG_BLK_DEV_IDEPCI
   72         hw_regs_t hw;
   73         int index;
   74 
   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);
   79         }
   80 #endif /* CONFIG_BLK_DEV_IDEPCI */
   81 }
   82 
   83 #include <asm-generic/ide_iops.h>
   84 
   85 #endif /* __KERNEL__ */
   86 
   87 #endif /* __ASMalpha_IDE_H */

Cache object: 10ddf2cb622dbe5ea3d062ea7eb5d3f8


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.