mtkernel_3/kernel/sysdepend/cpu/core/rxv2/interrupt.c | bare source | permlink (0.00 seconds) |
1: /* 2: *---------------------------------------------------------------------- 3: * micro T-Kernel 3.00.03 4: * 5: * Copyright (C) 2006-2021 by Ken Sakamura. 6: * This software is distributed under the T-License 2.2. 7: *---------------------------------------------------------------------- 8: * 9: * Released by TRON Forum(http://www.tron.org) at 2021/03/31. 10: * 11: *---------------------------------------------------------------------- 12: */ 13: 14: #include <sys/machine.h> 15: #ifdef CPU_CORE_RXV2 16: /* 17: * interrupt.c (RXv2) 18: * Interrupt control 19: */ 20: 21: #include "kernel.h" 22: #include "../../../sysdepend.h" 23: 24: /* ------------------------------------------------------------------------ */ 25: /* 26: * Interrupt nest counter 27: */ 28: EXPORT W knl_int_nest = 0; /* Interrupt nest counter */ 29: 30: 31: #if !USE_STATIC_IVT 32: /* ------------------------------------------------------------------------ */ 33: /* 34: * Interrupt Vector table (RAM) 35: */ 36: 37: EXPORT FP knl_int_vect_ram[N_INTVEC] __attribute__ ((section (".data_ivector"))); 38: 39: /* ------------------------------------------------------------------------ */ 40: /* 41: * HLL(High level programming language) Interrupt Handler Table (RAM) 42: */ 43: EXPORT FP knl_hll_inthdr_ram[N_INTVEC] __attribute__ ((section (".data_hvector"))); 44: 45: #endif /* !USE_STATIC_IVT */ 46: 47: /* ----------------------------------------------------------------------- */ 48: /* 49: * Set interrupt handler (Used in tk_def_int()) 50: */ 51: #if !USE_STATIC_IVT 52: EXPORT ER knl_define_inthdr( INT intno, ATR intatr, FP inthdr ) 53: { 54: /* check system interrupt number */ 55: if((intno < INTNO_USER_MIN) || (intno == INTNO_SYS_TICK)) { 56: return E_PAR; 57: } 58: 59: if(inthdr != NULL) { /* define intrrupt handler */ 60: if ( (intatr & TA_HLNG) != 0 ) { 61: knl_hll_inthdr_ram[intno] = inthdr; 62: inthdr = knl_int_vect_rom[intno]; /* set HLL-Int handler entry */ 63: } 64: } else { /* Clear interrupt handler */ 65: knl_hll_inthdr_ram[intno] = knl_hll_inthdr_rom[intno - INTNO_USER_MIN]; 66: inthdr = knl_int_vect_rom[intno]; /* set HLL-Int handler entry */ 67: } 68: 69: knl_int_vect_ram[intno] = inthdr; 70: 71: return E_OK; 72: } 73: #endif 74: 75: /* ------------------------------------------------------------------------ */ 76: /* 77: * Interrupt initialize 78: */ 79: EXPORT ER knl_init_interrupt( void ) 80: { 81: /* Register exception handler used on OS */ 82: /* There is no exception handler used in this implementation. */ 83: 84: return E_OK; 85: } 86: 87: 88: 89: #endif /* CPU_CORE_RXV2 */