mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-09 00:53:16 +00:00
2009-10-01 Joel Sherrill <joel.sherrill@oarcorp.com>
* libchip/ide/ata.c: Use simple vectored CPU macro to select interrupt model.
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
2009-10-01 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||||
|
|
||||||
|
* libchip/ide/ata.c: Use simple vectored CPU macro to select interrupt
|
||||||
|
model.
|
||||||
|
|
||||||
2009-09-30 Ralf Corsépius <ralf.corsepius@rtems.org>
|
2009-09-30 Ralf Corsépius <ralf.corsepius@rtems.org>
|
||||||
|
|
||||||
* libchip/serial/z85c30.c, libchip/serial/ns16550.c,
|
* libchip/serial/z85c30.c, libchip/serial/ns16550.c,
|
||||||
|
|||||||
@@ -32,19 +32,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#endif
|
#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>
|
#include <bsp/irq.h>
|
||||||
#define ATA_IRQ_CHAIN_MAX_CNT 4 /* support up to 4 ATA devices */
|
#define ATA_IRQ_CHAIN_MAX_CNT 4 /* support up to 4 ATA devices */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@@ -152,7 +140,7 @@ static bool ata_initialized = false;
|
|||||||
static rtems_id ata_task_id;
|
static rtems_id ata_task_id;
|
||||||
static rtems_id ata_queue_id;
|
static rtems_id ata_queue_id;
|
||||||
|
|
||||||
#if defined (ATA_USE_OLD_EXCEPTIONS)
|
#if (CPU_SIMPLE_VECTORED_INTERRUPTS == TRUE)
|
||||||
/* Mapping of interrupt vectors to devices */
|
/* Mapping of interrupt vectors to devices */
|
||||||
static rtems_chain_control ata_int_vec[ATA_MAX_RTEMS_INT_VEC_NUMBER + 1];
|
static rtems_chain_control ata_int_vec[ATA_MAX_RTEMS_INT_VEC_NUMBER + 1];
|
||||||
#endif
|
#endif
|
||||||
@@ -672,7 +660,7 @@ ata_add_to_controller_queue(rtems_device_minor_number ctrl_minor,
|
|||||||
* RETURNS:
|
* RETURNS:
|
||||||
* NONE
|
* NONE
|
||||||
*/
|
*/
|
||||||
#if defined(ATA_USE_OLD_EXCEPTIONS)
|
#if (CPU_SIMPLE_VECTORED_INTERRUPTS == TRUE)
|
||||||
rtems_isr
|
rtems_isr
|
||||||
ata_interrupt_handler(rtems_vector_number vec)
|
ata_interrupt_handler(rtems_vector_number vec)
|
||||||
{
|
{
|
||||||
@@ -1097,7 +1085,7 @@ rtems_ata_initialize(rtems_device_major_number major,
|
|||||||
dev_t device;
|
dev_t device;
|
||||||
ata_int_st_t *int_st;
|
ata_int_st_t *int_st;
|
||||||
|
|
||||||
#if defined(ATA_USE_OLD_EXCEPTIONS)
|
#if (CPU_SIMPLE_VECTORED_INTERRUPTS == TRUE)
|
||||||
rtems_isr_entry old_isr;
|
rtems_isr_entry old_isr;
|
||||||
#else
|
#else
|
||||||
int ata_irq_chain_use;
|
int ata_irq_chain_use;
|
||||||
@@ -1182,7 +1170,7 @@ rtems_ata_initialize(rtems_device_major_number major,
|
|||||||
for (i = 0; i < (2 * IDE_CTRL_MAX_MINOR_NUMBER); i++)
|
for (i = 0; i < (2 * IDE_CTRL_MAX_MINOR_NUMBER); i++)
|
||||||
ata_devs[i].device = ATA_UNDEFINED_VALUE;
|
ata_devs[i].device = ATA_UNDEFINED_VALUE;
|
||||||
|
|
||||||
#if defined(ATA_USE_OLD_EXCEPTIONS)
|
#if (CPU_SIMPLE_VECTORED_INTERRUPTS == TRUE)
|
||||||
/* prepare ATA driver for handling interrupt driven devices */
|
/* prepare ATA driver for handling interrupt driven devices */
|
||||||
for (i = 0; i < ATA_MAX_RTEMS_INT_VEC_NUMBER; i++)
|
for (i = 0; i < ATA_MAX_RTEMS_INT_VEC_NUMBER; i++)
|
||||||
rtems_chain_initialize_empty(&ata_int_vec[i]);
|
rtems_chain_initialize_empty(&ata_int_vec[i]);
|
||||||
@@ -1228,7 +1216,7 @@ rtems_ata_initialize(rtems_device_major_number major,
|
|||||||
}
|
}
|
||||||
|
|
||||||
int_st->ctrl_minor = ctrl_minor;
|
int_st->ctrl_minor = ctrl_minor;
|
||||||
#if defined(ATA_USE_OLD_EXCEPTIONS)
|
#if (CPU_SIMPLE_VECTORED_INTERRUPTS == TRUE)
|
||||||
status = rtems_interrupt_catch(
|
status = rtems_interrupt_catch(
|
||||||
ata_interrupt_handler,
|
ata_interrupt_handler,
|
||||||
IDE_Controller_Table[ctrl_minor].int_vec,
|
IDE_Controller_Table[ctrl_minor].int_vec,
|
||||||
@@ -1280,7 +1268,7 @@ rtems_ata_initialize(rtems_device_major_number major,
|
|||||||
rtems_disk_io_done();
|
rtems_disk_io_done();
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
#if defined(ATA_USE_OLD_EXCEPTIONS)
|
#if (CPU_SIMPLE_VECTORED_INTERRUPTS == TRUE)
|
||||||
rtems_chain_append(
|
rtems_chain_append(
|
||||||
&ata_int_vec[IDE_Controller_Table[ctrl_minor].int_vec],
|
&ata_int_vec[IDE_Controller_Table[ctrl_minor].int_vec],
|
||||||
&int_st->link);
|
&int_st->link);
|
||||||
|
|||||||
Reference in New Issue
Block a user