/*
 * amiints.c -- Amiga Linux interrupt handling code
 *
 * This file is subject to the terms and conditions of the GNU General Public
 * License.  See the file COPYING in the main directory of this archive
 * for more details.
 *
 */

#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/sched.h>

#include <asm/system.h>
#include <asm/irq.h>
#include <asm/traps.h>
#include <asm/amigahw.h>
#include <asm/amigaints.h>

/* isr node variables for amiga interrupt sources */
static isr_node_t *ami_lists[NUM_AMIGA_SOURCES];

static const ushort ami_intena_vals[NUM_AMIGA_SOURCES] = {
    IF_VERTB, IF_COPER, IF_AUD0, IF_AUD1, IF_AUD2, IF_AUD3, IF_BLIT,
    IF_DSKSYN, IF_DSKBLK, IF_RBF, IF_TBE, IF_PORTS, IF_PORTS, IF_PORTS,
    IF_PORTS, IF_PORTS, IF_EXTER, IF_EXTER, IF_EXTER, IF_EXTER, IF_EXTER,
    IF_SOFT, IF_PORTS, IF_EXTER
    };

struct ciadata
{
    volatile struct CIA *ciaptr;
    unsigned long	baseirq;
} ciadata[2];

/*
 * index into ami_lists for IRQs.  CIA IRQs are special, because
 * the same cia interrupt handler is used for both CIAs.
 */
#define IRQ_IDX(source) (source & ~IRQ_MACHSPEC)
#define CIA_IRQ_IDX(source) (IRQ_IDX(datap->baseirq) \
			     +(source-IRQ_AMIGA_CIAA_TA))

/*
 * void amiga_init_INTS (void)
 *
 * Parameters:	None
 *
 * Returns:	Nothing
 *
 * This function should be called during kernel startup to initialize
 * the amiga IRQ handling routines.
 */

static void
    ami_int1(int irq, struct pt_regs *fp, void *data),
    ami_int2(int irq, struct pt_regs *fp, void *data),
    ami_int3(int irq, struct pt_regs *fp, void *data),
    ami_int4(int irq, struct pt_regs *fp, void *data),
    ami_int5(int irq, struct pt_regs *fp, void *data),
    ami_int6(int irq, struct pt_regs *fp, void *data),
    ami_int7(int irq, struct pt_regs *fp, void *data),
    ami_intcia(int irq, struct pt_regs *fp, void *data);

void amiga_init_INTS (void)
{
}


/*
 * The builtin Amiga hardware interrupt handlers.
 */

static void ami_int1 (int irq, struct pt_regs *fp, void *data)
{
}

static void ami_int2 (int irq, struct pt_regs *fp, void *data)
{
}

static void ami_int3 (int irq, struct pt_regs *fp, void *data)
{
}

static void ami_int4 (int irq, struct pt_regs *fp, void *data)
{
}

static void ami_int5 (int irq, struct pt_regs *fp, void *data)
{
}

static void ami_int6 (int irq, struct pt_regs *fp, void *data)
{
}

static void ami_int7 (int irq, struct pt_regs *fp, void *data)
{
}

static void ami_intcia (int irq, struct pt_regs *fp, void *data)
{
}

/*
 * amiga_add_isr : add an interrupt service routine for a particular
 *		   machine specific interrupt source.
 *		   If the addition was successful, it returns 1, otherwise
 *		   it returns 0.  It will fail if another routine is already
 *		   bound into the specified source.
 *   Note that the "pri" argument is currently unused.
 */

int amiga_add_isr (unsigned long source, isrfunc isr, int pri, void
		   *data, char *name)
{
  return 0;
}

int amiga_remove_isr (unsigned long source, isrfunc isr, void *data)
{
  return 0;
}


/*
 * Enable/disable a particular machine specific interrupt source.
 * Note that this may affect other interrupts in case of a shared interrupt.
 */

void amiga_enable_irq(unsigned int source)
{
}

void amiga_disable_irq(unsigned int source)
{
}


int amiga_get_irq_list( char *buf, int len )
{
  return 0;
}
