summaryrefslogtreecommitdiffstats
path: root/c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-10-05 14:39:26 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-10-05 14:39:26 +0000
commit37f9717a4b15ecc3ae515594b1ea18715b8985b8 (patch)
tree2be3184454987c140b88b69e000aae1e8280d2e7 /c
parentadd missing files (diff)
downloadrtems-37f9717a4b15ecc3ae515594b1ea18715b8985b8.tar.bz2
2009-10-05 Joel Sherrill <joel.sherrill@oarcorp.com>
* libchip/ide/ata.c: Revert previous change. Not all ARM BSPs use a shared irq.h yet and this breaks a significant number of them.
Diffstat (limited to 'c')
-rw-r--r--c/src/ChangeLog5
-rw-r--r--c/src/libchip/ide/ata.c26
2 files changed, 24 insertions, 7 deletions
diff --git a/c/src/ChangeLog b/c/src/ChangeLog
index f0701c85f4..3f5b915c41 100644
--- a/c/src/ChangeLog
+++ b/c/src/ChangeLog
@@ -1,3 +1,8 @@
+2009-10-05 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * libchip/ide/ata.c: Revert previous change. Not all ARM BSPs use a
+ shared irq.h yet and this breaks a significant number of them.
+
2009-10-01 Joel Sherrill <joel.sherrill@oarcorp.com>
* libchip/ide/ata.c: Use simple vectored CPU macro to select interrupt
diff --git a/c/src/libchip/ide/ata.c b/c/src/libchip/ide/ata.c
index 9ebf199e27..9582d45b29 100644
--- a/c/src/libchip/ide/ata.c
+++ b/c/src/libchip/ide/ata.c
@@ -32,7 +32,19 @@
#include <stdio.h>
#endif
-#if (CPU_SIMPLE_VECTORED_INTERRUPTS != TRUE)
+/*
+ * FIXME: make this better...
+ * find out, which exception model is used
+ * assume, that all i386 BSPs use new exception handling
+ * assume, that some PPC BSPs use new exception handling
+ * assume, that all other BSPs use old exception handling
+ */
+#if defined(_OLD_EXCEPTIONS) || (!defined(__i386__) && !defined(__PPC__))
+
+#define ATA_USE_OLD_EXCEPTIONS
+#endif
+
+#if !defined(ATA_USE_OLD_EXCEPTIONS)
#include <bsp/irq.h>
#define ATA_IRQ_CHAIN_MAX_CNT 4 /* support up to 4 ATA devices */
typedef struct {
@@ -140,7 +152,7 @@ static bool ata_initialized = false;
static rtems_id ata_task_id;
static rtems_id ata_queue_id;
-#if (CPU_SIMPLE_VECTORED_INTERRUPTS == TRUE)
+#if defined (ATA_USE_OLD_EXCEPTIONS)
/* Mapping of interrupt vectors to devices */
static rtems_chain_control ata_int_vec[ATA_MAX_RTEMS_INT_VEC_NUMBER + 1];
#endif
@@ -660,7 +672,7 @@ ata_add_to_controller_queue(rtems_device_minor_number ctrl_minor,
* RETURNS:
* NONE
*/
-#if (CPU_SIMPLE_VECTORED_INTERRUPTS == TRUE)
+#if defined(ATA_USE_OLD_EXCEPTIONS)
rtems_isr
ata_interrupt_handler(rtems_vector_number vec)
{
@@ -1085,7 +1097,7 @@ rtems_ata_initialize(rtems_device_major_number major,
dev_t device;
ata_int_st_t *int_st;
-#if (CPU_SIMPLE_VECTORED_INTERRUPTS == TRUE)
+#if defined(ATA_USE_OLD_EXCEPTIONS)
rtems_isr_entry old_isr;
#else
int ata_irq_chain_use;
@@ -1170,7 +1182,7 @@ rtems_ata_initialize(rtems_device_major_number major,
for (i = 0; i < (2 * IDE_CTRL_MAX_MINOR_NUMBER); i++)
ata_devs[i].device = ATA_UNDEFINED_VALUE;
-#if (CPU_SIMPLE_VECTORED_INTERRUPTS == TRUE)
+#if defined(ATA_USE_OLD_EXCEPTIONS)
/* prepare ATA driver for handling interrupt driven devices */
for (i = 0; i < ATA_MAX_RTEMS_INT_VEC_NUMBER; i++)
rtems_chain_initialize_empty(&ata_int_vec[i]);
@@ -1216,7 +1228,7 @@ rtems_ata_initialize(rtems_device_major_number major,
}
int_st->ctrl_minor = ctrl_minor;
-#if (CPU_SIMPLE_VECTORED_INTERRUPTS == TRUE)
+#if defined(ATA_USE_OLD_EXCEPTIONS)
status = rtems_interrupt_catch(
ata_interrupt_handler,
IDE_Controller_Table[ctrl_minor].int_vec,
@@ -1268,7 +1280,7 @@ rtems_ata_initialize(rtems_device_major_number major,
rtems_disk_io_done();
return status;
}
-#if (CPU_SIMPLE_VECTORED_INTERRUPTS == TRUE)
+#if defined(ATA_USE_OLD_EXCEPTIONS)
rtems_chain_append(
&ata_int_vec[IDE_Controller_Table[ctrl_minor].int_vec],
&int_st->link);