00001 /* 00002 * Copyright (C) 2001-2005 by egnite Software GmbH. All rights reserved. 00003 * 00004 * Redistribution and use in source and binary forms, with or without 00005 * modification, are permitted provided that the following conditions 00006 * are met: 00007 * 00008 * 1. Redistributions of source code must retain the above copyright 00009 * notice, this list of conditions and the following disclaimer. 00010 * 2. Redistributions in binary form must reproduce the above copyright 00011 * notice, this list of conditions and the following disclaimer in the 00012 * documentation and/or other materials provided with the distribution. 00013 * 3. Neither the name of the copyright holders nor the names of 00014 * contributors may be used to endorse or promote products derived 00015 * from this software without specific prior written permission. 00016 * 00017 * THIS SOFTWARE IS PROVIDED BY EGNITE SOFTWARE GMBH AND CONTRIBUTORS 00018 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00019 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 00020 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL EGNITE 00021 * SOFTWARE GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 00022 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 00023 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 00024 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 00025 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00026 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 00027 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00028 * SUCH DAMAGE. 00029 * 00030 * For additional information see http://www.ethernut.de/ 00031 * 00032 */ 00033 00034 /* 00035 * $Log$ 00036 * Revision 1.4 2008/08/11 06:59:12 haraldkipp 00037 * BSD types replaced by stdint types (feature request #1282721). 00038 * 00039 * Revision 1.3 2005/10/24 17:59:19 haraldkipp 00040 * Use correct header file, arm, not gba. 00041 * 00042 * Revision 1.2 2005/08/02 17:46:45 haraldkipp 00043 * Major API documentation update. 00044 * 00045 * Revision 1.1 2005/07/26 18:02:26 haraldkipp 00046 * Moved from dev. 00047 * 00048 * Revision 1.1 2005/04/05 17:53:24 haraldkipp 00049 * Initial check in. 00050 * 00051 */ 00052 00053 #include <arch/arm.h> 00054 #include <dev/irqreg.h> 00055 #include <stdio.h> 00056 00061 00062 IRQ_HANDLER sig_VBLANK; 00063 IRQ_HANDLER sig_HBLANK; 00064 IRQ_HANDLER sig_VCOUNT; 00065 IRQ_HANDLER sig_TMR0; 00066 IRQ_HANDLER sig_TMR1; 00067 IRQ_HANDLER sig_TMR2; 00068 IRQ_HANDLER sig_TMR3; 00069 IRQ_HANDLER sig_SIO; 00070 IRQ_HANDLER sig_DMA0; 00071 IRQ_HANDLER sig_DMA1; 00072 IRQ_HANDLER sig_DMA2; 00073 IRQ_HANDLER sig_DMA3; 00074 IRQ_HANDLER sig_KEYPAD; 00075 IRQ_HANDLER sig_GAMEPAK; 00076 00077 void IrqHandler(void) 00078 { 00079 register uint16_t irqf = inw(REG_IF); 00080 00081 if(irqf & INT_SIO) { 00082 CallHandler(&sig_SIO); 00083 } 00084 #if 0 00085 if(irqf & INT_VBLANK) { 00086 CallHandler(&sig_VBLANK); 00087 } 00088 if(irqf & INT_HBLANK) { 00089 CallHandler(&sig_HBLANK); 00090 } 00091 if(irqf & INT_VCOUNT) { 00092 CallHandler(&sig_VCOUNT); 00093 } 00094 if(irqf & INT_TMR0) { 00095 CallHandler(&sig_TMR0); 00096 } 00097 if(irqf & INT_TMR1) { 00098 CallHandler(&sig_TMR1); 00099 } 00100 if(irqf & INT_TMR2) { 00101 CallHandler(&sig_TMR2); 00102 } 00103 #endif 00104 if(irqf & INT_TMR3) { 00105 CallHandler(&sig_TMR3); 00106 } 00107 #if 0 00108 if(irqf & INT_DMA0) { 00109 CallHandler(&sig_DMA0); 00110 } 00111 if(irqf & INT_DMA1) { 00112 CallHandler(&sig_DMA1); 00113 } 00114 if(irqf & INT_DMA2) { 00115 CallHandler(&sig_DMA2); 00116 } 00117 if(irqf & INT_DMA3) { 00118 CallHandler(&sig_DMA3); 00119 } 00120 if(irqf & INT_KEYPAD) { 00121 CallHandler(&sig_KEYPAD); 00122 } 00123 if(irqf & INT_GAMEPAK) { 00124 CallHandler(&sig_GAMEPAK); 00125 } 00126 #endif 00127 } 00128 00129 void InitIrqHandler(void) 00130 { 00131 outdw(INT_VECTOR, (uint32_t)IrqHandler); 00132 } 00133