trap.c 975 字节
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
/*
 * File      : trap.c
 * This file is part of RT-Thread RTOS
 * COPYRIGHT (C) 2006, RT-Thread Development Team
 *
 * The license and distribution terms for this file may be
 * found in the file LICENSE in this distribution or at
 * http://openlab.rt-thread.com/license/LICENSE
 *
 * Change Logs:
 * Date           Author       Notes
 * 2006-08-25     Bernard      first version
 */

#include <rtthread.h>
#include <rthw.h>

18
#include "AT91SAM7X256.h"
19 20 21 22 23 24 25 26

/**
 * @addtogroup AT91SAM7
 */
/*@{*/

void rt_hw_trap_irq()
{
27
	rt_isr_handler_t hander = (rt_isr_handler_t)AT91C_BASE_AIC->AIC_IVR;
28

29
	hander(AT91C_BASE_AIC->AIC_ISR);
30 31

	/* end of interrupt */
32
	AT91C_BASE_AIC->AIC_EOICR = 0;
33 34 35 36 37 38
}

void rt_hw_trap_fiq()
{
    rt_kprintf("fast interrupt request\n");
}
39 40

extern struct rt_thread* rt_current_thread;
41
void rt_hw_trap_abort()
42 43 44 45 46
{
	rt_kprintf("Abort occured!!! Thread [%s] suspended.\n",rt_current_thread->name);
	rt_thread_suspend(rt_current_thread);
	rt_schedule();

47
}
48
/*@}*/