source: ssp_qb_r5f100le_cs/trunk/kernel/interrupt.c@ 93

Last change on this file since 93 was 93, checked in by nmir-saito, 8 years ago

add Combined package of SSP kernel for QB-R5F100LE-TB(RL78 processor)

File size: 3.7 KB
RevLine 
[93]1/*
2 * TOPPERS/SSP Kernel
3 * Smallest Set Profile Kernel
4 *
5 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
6 * Toyohashi Univ. of Technology, JAPAN
7 * Copyright (C) 2005-2008 by Embedded and Real-Time Systems Laboratory
8 * Graduate School of Information Science, Nagoya Univ., JAPAN
9 * Copyright (C) 2010 by Naoki Saito
10 * Nagoya Municipal Industrial Research Institute, JAPAN
11 * Copyright (C) 2010-2011 by Meika Sugimoto
12 *
13 * ã‹L’˜ìŒ ŽÒ‚́CˆÈ‰º‚Ì (1)`(4) ‚ÌðŒ‚ð–ž‚½‚·ê‡‚ÉŒÀ‚èC–{ƒ\ƒtƒgƒEƒF
14 * ƒAi–{ƒ\ƒtƒgƒEƒFƒA‚ð‰ü•Ï‚µ‚½‚à‚Ì‚ðŠÜ‚ށDˆÈ‰º“¯‚¶j‚ðŽg—pE•¡»E‰ü•ÏE
15 * Ä”z•ziˆÈ‰ºC—˜—p‚ƌĂԁj‚·‚邱‚Ƃ𖳏ž‚Å‹–‘ø‚·‚éD
16 * (1) –{ƒ\ƒtƒgƒEƒFƒA‚ðƒ\[ƒXƒR[ƒh‚ÌŒ`‚Å—˜—p‚·‚éê‡‚ɂ́Cã‹L‚Ì’˜ìŒ 
17 * •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•ÛØ‹K’肪C‚»‚Ì‚Ü‚Ü‚ÌŒ`‚Ń\[ƒX
18 * ƒR[ƒh’†‚ÉŠÜ‚Ü‚ê‚Ä‚¢‚邱‚ƁD
19 * (2) –{ƒ\ƒtƒgƒEƒFƒA‚ðCƒ‰ƒCƒuƒ‰ƒŠŒ`Ž®‚ȂǁC‘¼‚̃\ƒtƒgƒEƒFƒAŠJ”­‚ÉŽg—p
20 * ‚Å‚«‚éŒ`‚ōĔz•z‚·‚éê‡‚ɂ́CÄ”z•z‚É”º‚¤ƒhƒLƒ…
21ƒƒ“ƒgi—˜—pŽÒƒ}
22 * ƒjƒ…
23ƒAƒ‹‚Ȃǁj‚ɁCã‹L‚Ì’˜ìŒ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•Û
24 * Ø‹K’è‚ðŒfÚ‚·‚邱‚ƁD
25 * (3) –{ƒ\ƒtƒgƒEƒFƒA‚ðC‹@Ší‚É‘g‚ݍž‚ނȂǁC‘¼‚̃\ƒtƒgƒEƒFƒAŠJ”­‚ÉŽg—p
26 * ‚Å‚«‚È‚¢Œ`‚ōĔz•z‚·‚éê‡‚ɂ́CŽŸ‚Ì‚¢‚¸‚ê‚©‚ÌðŒ‚ð–ž‚½‚·‚±‚ƁD
27 * (a) Ä”z•z‚É”º‚¤ƒhƒLƒ…
28ƒƒ“ƒgi—˜—pŽÒƒ}ƒjƒ…
29ƒAƒ‹‚Ȃǁj‚ɁCã‹L‚Ì’˜ì
30 * Œ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•ÛØ‹K’è‚ðŒfÚ‚·‚邱‚ƁD
31 * (b) Ä”z•z‚ÌŒ`‘Ô‚ðC•Ê‚É’è‚ß‚é•û–@‚É‚æ‚Á‚āCTOPPERSƒvƒƒWƒFƒNƒg‚É•ñ
32 * ‚·‚邱‚ƁD
33 * (4) –{ƒ\ƒtƒgƒEƒFƒA‚Ì—˜—p‚É‚æ‚è’¼Ú“I‚Ü‚½‚͊ԐړI‚ɐ¶‚¶‚é‚¢‚©‚Ȃ鑹ŠQ
34 * ‚©‚ç‚àCã‹L’˜ìŒ ŽÒ‚¨‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚ð–Ɛӂ·‚邱‚ƁD‚Ü‚½C
35 * –{ƒ\ƒtƒgƒEƒFƒA‚̃†[ƒU‚Ü‚½‚̓Gƒ“ƒhƒ†[ƒU‚©‚ç‚Ì‚¢‚©‚Ȃ闝—R‚ÉŠî‚Ã
36 * ‚­¿‹‚©‚ç‚àCã‹L’˜ìŒ ŽÒ‚¨‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚ð–Ɛӂ·‚邱‚ƁD
37 *
38 * –{ƒ\ƒtƒgƒEƒFƒA‚́C–³•ÛØ‚Å’ñ‹Ÿ‚³‚ê‚Ä‚¢‚é‚à‚Ì‚Å‚ ‚éDã‹L’˜ìŒ ŽÒ‚¨‚æ
39 * ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚́C–{ƒ\ƒtƒgƒEƒFƒA‚ÉŠÖ‚µ‚āC“Á’è‚ÌŽg—p–Ú“I‚ɑ΂·
40 * ‚é“K‡«‚àŠÜ‚߂āC‚¢‚©‚È‚é•ÛØ‚às‚í‚È‚¢D‚Ü‚½C–{ƒ\ƒtƒgƒEƒFƒA‚Ì—˜—p
41 * ‚É‚æ‚è’¼Ú“I‚Ü‚½‚͊ԐړI‚ɐ¶‚¶‚½‚¢‚©‚Ȃ鑹ŠQ‚ÉŠÖ‚µ‚Ä‚àC‚»‚̐ӔC‚ð•‰
42 * ‚í‚È‚¢D
43 *
44 */
45
46/*
47 * Š„ž‚ÝŠÇ—‹@”\
48 */
49
50#include "kernel_impl.h"
51#include "check.h"
52#include "task.h"
53#include "interrupt.h"
54
55
56/*
57 * Š„ž‚ÝŠÇ—‹@”\‚̏‰Šú‰»
58 */
59#ifdef TOPPERS_intini
60#ifndef OMIT_INITIALIZE_INTERRUPT
61
62void
63initialize_interrupt(void)
64{
65 uint_t i;
66
67 for (i = 0U; i < tnum_inhno; i++) {
68 x_define_inh(inhinib_inhno[i], (FP)(inhinib_entry[i]));
69 }
70 for (i = 0U; i < tnum_intno; i++) {
71 x_config_int(intinib_intno[i], intinib_intatr[i], intinib_intpri[i]);
72 }
73}
74
75#endif /* OMIT_INITIALIZE_INTERRUPT */
76#endif /* TOPPERS_intini */
77
78/*
79 * Š„ž‚Ý‚Ì‹ÖŽ~
80 */
81#ifdef TOPPERS_dis_int
82#ifdef TOPPERS_TARGET_SUPPORT_DIS_INT
83
84ER
85dis_int(INTNO intno)
86{
87 bool_t locked;
88 ER ercd;
89
90 CHECK_TSKCTX();
91 CHECK_INTNO_DISINT(intno);
92
93 locked = t_sense_lock();
94
95 if (!locked) {
96 t_lock_cpu();
97 }
98
99 if (t_disable_int(intno)) {
100 ercd = E_OK;
101 }
102 else {
103 ercd = E_OBJ;
104 }
105
106 if (!locked) {
107 t_unlock_cpu();
108 }
109
110 error_exit:
111 return(ercd);
112}
113
114#endif /* TOPPERS_SUPPORT_DIS_INT */
115#endif /* TOPPERS_dis_int */
116
117
118/*
119 * Š„ž‚Ý‚Ì‹–‰Â
120 */
121#ifdef TOPPERS_ena_int
122#ifdef TOPPERS_TARGET_SUPPORT_ENA_INT
123
124ER
125ena_int(INTNO intno)
126{
127 bool_t locked;
128 ER ercd;
129
130 CHECK_TSKCTX();
131 CHECK_INTNO_DISINT(intno);
132
133 locked = t_sense_lock();
134 if (!locked) {
135 t_lock_cpu();
136 }
137
138 if (t_enable_int(intno)) {
139 ercd = E_OK;
140 }
141 else {
142 ercd = E_OBJ;
143 }
144
145 if (!locked) {
146 t_unlock_cpu();
147 }
148
149 error_exit:
150 return(ercd);
151}
152
153#endif /* TOPPERS_SUPPORT_ENA_INT */
154#endif /* TOPPERS_ena_int */
Note: See TracBrowser for help on using the repository browser.