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: ihndlr_gba.c,v $ 00036 * Revision 1.3 2005/10/24 17:59:19 haraldkipp 00037 * Use correct header file, arm, not gba. 00038 * 00039 * Revision 1.2 2005/08/02 17:46:45 haraldkipp 00040 * Major API documentation update. 00041 * 00042 * Revision 1.1 2005/07/26 18:02:26 haraldkipp 00043 * Moved from dev. 00044 * 00045 * Revision 1.1 2005/04/05 17:53:24 haraldkipp 00046 * Initial check in. 00047 * 00048 */ 00049 00050 #include <arch/arm.h> 00051 #include <dev/irqreg.h> 00052 #include <stdio.h> 00053 00058 00059 IRQ_HANDLER sig_VBLANK; 00060 IRQ_HANDLER sig_HBLANK; 00061 IRQ_HANDLER sig_VCOUNT; 00062 IRQ_HANDLER sig_TMR0; 00063 IRQ_HANDLER sig_TMR1; 00064 IRQ_HANDLER sig_TMR2; 00065 IRQ_HANDLER sig_TMR3; 00066 IRQ_HANDLER sig_SIO; 00067 IRQ_HANDLER sig_DMA0; 00068 IRQ_HANDLER sig_DMA1; 00069 IRQ_HANDLER sig_DMA2; 00070 IRQ_HANDLER sig_DMA3; 00071 IRQ_HANDLER sig_KEYPAD; 00072 IRQ_HANDLER sig_GAMEPAK; 00073 00074 void IrqHandler(void) 00075 { 00076 register u_short irqf = inw(REG_IF); 00077 00078 if(irqf & INT_SIO) { 00079 CallHandler(&sig_SIO); 00080 } 00081 #if 0 00082 if(irqf & INT_VBLANK) { 00083 CallHandler(&sig_VBLANK); 00084 } 00085 if(irqf & INT_HBLANK) { 00086 CallHandler(&sig_HBLANK); 00087 } 00088 if(irqf & INT_VCOUNT) { 00089 CallHandler(&sig_VCOUNT); 00090 } 00091 if(irqf & INT_TMR0) { 00092 CallHandler(&sig_TMR0); 00093 } 00094 if(irqf & INT_TMR1) { 00095 CallHandler(&sig_TMR1); 00096 } 00097 if(irqf & INT_TMR2) { 00098 CallHandler(&sig_TMR2); 00099 } 00100 #endif 00101 if(irqf & INT_TMR3) { 00102 CallHandler(&sig_TMR3); 00103 } 00104 #if 0 00105 if(irqf & INT_DMA0) { 00106 CallHandler(&sig_DMA0); 00107 } 00108 if(irqf & INT_DMA1) { 00109 CallHandler(&sig_DMA1); 00110 } 00111 if(irqf & INT_DMA2) { 00112 CallHandler(&sig_DMA2); 00113 } 00114 if(irqf & INT_DMA3) { 00115 CallHandler(&sig_DMA3); 00116 } 00117 if(irqf & INT_KEYPAD) { 00118 CallHandler(&sig_KEYPAD); 00119 } 00120 if(irqf & INT_GAMEPAK) { 00121 CallHandler(&sig_GAMEPAK); 00122 } 00123 #endif 00124 } 00125 00126 void InitIrqHandler(void) 00127 { 00128 outdw(INT_VECTOR, (u_long)IrqHandler); 00129 } 00130