patch-2.3.1 linux/include/asm-sparc64/ide.h
Next file: linux/include/asm-sparc64/io.h
Previous file: linux/include/asm-sparc64/hdreg.h
Back to the patch index
Back to the overall index
- Lines: 92
- Date:
Thu May 13 11:00:09 1999
- Orig file:
v2.3.0/linux/include/asm-sparc64/ide.h
- Orig date:
Thu Apr 22 19:24:52 1999
diff -u --recursive --new-file v2.3.0/linux/include/asm-sparc64/ide.h linux/include/asm-sparc64/ide.h
@@ -12,8 +12,6 @@
#include <asm/pgtable.h>
-typedef unsigned long ide_ioreg_t;
-
#undef MAX_HWIFS
#define MAX_HWIFS 2
@@ -29,21 +27,42 @@
return 0;
}
-static __inline__ void ide_init_hwif_ports(ide_ioreg_t *p, ide_ioreg_t base, int *irq)
+static __inline__ void ide_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data_port, ide_ioreg_t ctrl_port, int *irq)
{
+ ide_ioreg_t reg = data_port;
int i;
- /* These are simply offsets from base. */
- for (i = 0; i < 8; i++)
- *p++ = base++;
- /* PCI code needs to figure out these. */
- for ( ; i < 10; i++)
- *p++ = 0;
- /* PCI code needs to figure out this. */
+ for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
+ hw->io_ports[i] = reg;
+ reg += 1;
+ }
+ if (ctrl_port) {
+ hw->io_ports[IDE_CONTROL_OFFSET] = ctrl_port;
+ } else {
+ hw->io_ports[IDE_CONTROL_OFFSET] = 0;
+ }
if (irq != NULL)
*irq = 0;
}
+/*
+ * This registers the standard ports for this architecture with the IDE
+ * driver.
+ */
+static __inline__ void ide_init_default_hwifs(void)
+{
+#ifdef __DO_I_NEED_THIS
+ hw_regs_t hw;
+ int index;
+
+ for (index = 0; index < MAX_HWIFS; index++) {
+ ide_init_hwif_ports(&hw, ide_default_io_base(index), 0, 0);
+ hw.irq = ide_default_irq(ide_default_io_base(index));
+ ide_register_hw(&hw, NULL);
+ }
+#endif /* __DO_I_NEED_THIS */
+}
+
typedef union {
unsigned int all : 8; /* all of the bits together */
struct {
@@ -92,11 +111,6 @@
#undef HD_DATA
#define HD_DATA ((ide_ioreg_t)0)
-static __inline__ int ide_ack_intr(ide_ioreg_t status_port, ide_ioreg_t irq_port)
-{
- return 1;
-}
-
/* From m68k code... */
#ifdef insl
@@ -255,13 +269,12 @@
}
}
-static __inline__ void ide_release_lock (int *ide_lock)
-{
-}
-
-static __inline__ void ide_get_lock (int *ide_lock, void (*handler)(int, void *, struct pt_regs *), void *data)
-{
-}
+/*
+ * The following are not needed for the non-m68k ports
+ */
+#define ide_ack_intr(hwif) (1)
+#define ide_release_lock(lock) do {} while (0)
+#define ide_get_lock(lock, hdlr, data) do {} while (0)
#endif /* __KERNEL__ */
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)