source: UsbWattMeter/trunk/asp_dcre/kernel/interrupt.h@ 164

Last change on this file since 164 was 164, checked in by coas-nagasima, 6 years ago

TOPPERS/ECNLサンプルアプリ「USB充電器電力計」を追加

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/x-chdr
File size: 5.3 KB
Line 
1/*
2 * TOPPERS/ASP Kernel
3 * Toyohashi Open Platform for Embedded Real-Time Systems/
4 * Advanced Standard Profile Kernel
5 *
6 * Copyright (C) 2000 by Embedded and Real-Time Systems Laboratory
7 * Toyohashi Univ. of Technology, JAPAN
8 * Copyright (C) 2005-2010 by Embedded and Real-Time Systems Laboratory
9 * Graduate School of Information Science, Nagoya Univ., JAPAN
10 *
11 * ã‹L’˜ìŒ ŽÒ‚́CˆÈ‰º‚Ì(1)`(4)‚ÌðŒ‚ð–ž‚½‚·ê‡‚ÉŒÀ‚èC–{ƒ\ƒtƒgƒEƒF
12 * ƒAi–{ƒ\ƒtƒgƒEƒFƒA‚ð‰ü•Ï‚µ‚½‚à‚Ì‚ðŠÜ‚ށDˆÈ‰º“¯‚¶j‚ðŽg—pE•¡»E‰ü
13 * •ÏEÄ”z•ziˆÈ‰ºC—˜—p‚ƌĂԁj‚·‚邱‚Ƃ𖳏ž‚Å‹–‘ø‚·‚éD
14 * (1) –{ƒ\ƒtƒgƒEƒFƒA‚ðƒ\[ƒXƒR[ƒh‚ÌŒ`‚Å—˜—p‚·‚éê‡‚ɂ́Cã‹L‚Ì’˜ì
15 * Œ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•ÛØ‹K’肪C‚»‚Ì‚Ü‚Ü‚ÌŒ`‚Ń\[
16 * ƒXƒR[ƒh’†‚ÉŠÜ‚Ü‚ê‚Ä‚¢‚邱‚ƁD
17 * (2) –{ƒ\ƒtƒgƒEƒFƒA‚ðCƒ‰ƒCƒuƒ‰ƒŠŒ`Ž®‚ȂǁC‘¼‚̃\ƒtƒgƒEƒFƒAŠJ”­‚ÉŽg
18 * —p‚Å‚«‚éŒ`‚ōĔz•z‚·‚éê‡‚ɂ́CÄ”z•z‚É”º‚¤ƒhƒLƒ…
19ƒƒ“ƒgi—˜—p
20 * ŽÒƒ}ƒjƒ…
21ƒAƒ‹‚Ȃǁj‚ɁCã‹L‚Ì’˜ìŒ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L
22 * ‚Ì–³•ÛØ‹K’è‚ðŒfÚ‚·‚邱‚ƁD
23 * (3) –{ƒ\ƒtƒgƒEƒFƒA‚ðC‹@Ší‚É‘g‚ݍž‚ނȂǁC‘¼‚̃\ƒtƒgƒEƒFƒAŠJ”­‚ÉŽg
24 * —p‚Å‚«‚È‚¢Œ`‚ōĔz•z‚·‚éê‡‚ɂ́CŽŸ‚Ì‚¢‚¸‚ê‚©‚ÌðŒ‚ð–ž‚½‚·‚±
25 * ‚ƁD
26 * (a) Ä”z•z‚É”º‚¤ƒhƒLƒ…
27ƒƒ“ƒgi—˜—pŽÒƒ}ƒjƒ…
28ƒAƒ‹‚Ȃǁj‚ɁCã‹L‚Ì’˜
29 * ìŒ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•ÛØ‹K’è‚ðŒfÚ‚·‚邱‚ƁD
30 * (b) Ä”z•z‚ÌŒ`‘Ô‚ðC•Ê‚É’è‚ß‚é•û–@‚É‚æ‚Á‚āCTOPPERSƒvƒƒWƒFƒNƒg‚É
31 * •ñ‚·‚邱‚ƁD
32 * (4) –{ƒ\ƒtƒgƒEƒFƒA‚Ì—˜—p‚É‚æ‚è’¼Ú“I‚Ü‚½‚͊ԐړI‚ɐ¶‚¶‚é‚¢‚©‚Ȃ鑹
33 * ŠQ‚©‚ç‚àCã‹L’˜ìŒ ŽÒ‚¨‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚ð–Ɛӂ·‚邱‚ƁD
34 * ‚Ü‚½C–{ƒ\ƒtƒgƒEƒFƒA‚̃†[ƒU‚Ü‚½‚̓Gƒ“ƒhƒ†[ƒU‚©‚ç‚Ì‚¢‚©‚Ȃ闝
35 * —R‚ÉŠî‚­¿‹‚©‚ç‚àCã‹L’˜ìŒ ŽÒ‚¨‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚ð
36 * –Ɛӂ·‚邱‚Ɓ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
41 * ƒA‚Ì—˜—p‚É‚æ‚è’¼Ú“I‚Ü‚½‚͊ԐړI‚ɐ¶‚¶‚½‚¢‚©‚Ȃ鑹ŠQ‚ÉŠÖ‚µ‚Ä‚àC‚»
42 * ‚̐ӔC‚𕉂í‚È‚¢D
43 *
44 * @(#) $Id: interrupt.h 164 2016-03-07 11:33:50Z coas-nagasima $
45 */
46
47/*
48 * Š„ž‚ÝŠÇ—‹@”\
49 */
50
51#ifndef TOPPERS_INTERRUPT_H
52#define TOPPERS_INTERRUPT_H
53
54/*
55 * Š„ž‚݃T[ƒrƒXƒ‹[ƒ`ƒ“‰Šú‰»ƒuƒƒbƒN
56 */
57typedef struct isr_initialization_block {
58 ATR isratr; /* Š„ž‚݃T[ƒrƒXƒ‹[ƒ`ƒ“‘®« */
59 intptr_t exinf; /* Š„ž‚݃T[ƒrƒXƒ‹[ƒ`ƒ“‚ÌŠg’£î•ñ */
60 INTNO intno; /* Š„ž‚݃T[ƒrƒXƒ‹[ƒ`ƒ“‚ð“o˜^‚·‚銄ž‚ݔԍ† */
61 QUEUE *p_isr_queue; /* “o˜^æŠ„ž‚݃T[ƒrƒXƒ‹[ƒ`ƒ“ƒLƒ…
62[‚̔Ԓn */
63 ISR isr; /* Š„ž‚݃T[ƒrƒXƒ‹[ƒ`ƒ“‚̐擪”Ô’n */
64 PRI isrpri; /* Š„ž‚݃T[ƒrƒXƒ‹[ƒ`ƒ“—Dæ“x */
65} ISRINIB;
66
67/*
68 * Š„ž‚݃T[ƒrƒXƒ‹[ƒ`ƒ“ŠÇ—ƒuƒƒbƒN
69 */
70typedef struct isr_control_block {
71 QUEUE isr_queue; /* Š„ž‚݃T[ƒrƒXƒ‹[ƒ`ƒ“ŒÄo‚µƒLƒ…
72[ */
73 const ISRINIB *p_isrinib; /* ‰Šú‰»ƒuƒƒbƒN‚ւ̃|ƒCƒ“ƒ^ */
74} ISRCB;
75
76/*
77 * Š„ž‚݃T[ƒrƒXƒ‹[ƒ`ƒ“ŒÄo‚µƒLƒ…
78[‚ðŒŸõ‚·‚邽‚߂̃f[ƒ^\‘¢
79 */
80typedef struct {
81 INTNO intno; /* Š„ž‚ݔԍ† */
82 QUEUE *p_isr_queue; /* Š„ž‚݃T[ƒrƒXƒ‹[ƒ`ƒ“ŒÄo‚µƒLƒ…
83[ */
84} ISR_ENTRY;
85
86/*
87 * Š„ž‚݃T[ƒrƒXƒ‹[ƒ`ƒ“ƒLƒ…
88[‚̃Gƒ“ƒgƒŠ”ikernel_cfg.cj
89 */
90extern const uint_t tnum_isr_queue;
91
92/*
93 * Š„ž‚݃T[ƒrƒXƒ‹[ƒ`ƒ“ƒLƒ…
94[ƒŠƒXƒgikernel_cfg.cj
95 */
96extern const ISR_ENTRY isr_queue_list[];
97
98/*
99 * Š„ž‚݃T[ƒrƒXƒ‹[ƒ`ƒ“ƒLƒ…
100[‚̃GƒŠƒAikernel_cfg.cj
101 */
102extern QUEUE isr_queue_table[];
103
104/*
105 * Žg—p‚µ‚Ä‚¢‚È‚¢Š„ž‚݃T[ƒrƒXƒ‹[ƒ`ƒ“ŠÇ—ƒuƒƒbƒN‚̃ŠƒXƒg
106 */
107extern QUEUE free_isrcb;
108
109/*
110 * Š„ž‚݃T[ƒrƒXƒ‹[ƒ`ƒ“ID‚̍őå’likernel_cfg.cj
111 *
112 * Ã“I‚ɐ¶¬‚³‚ê‚銄ž‚݃T[ƒrƒXƒ‹[ƒ`ƒ“‚ÍID”ԍ†‚ðŽ‚½‚È‚¢‚½‚߁C
113 * tmax_isrid‚Í“®“I‚ɐ¶¬‚³‚ê‚銄ž‚݃T[ƒrƒXƒ‹[ƒ`ƒ“‚ÌID”ԍ†‚̍őå’l
114 * ‚Å‚ ‚éDÃ“I‚ɐ¶¬‚³‚ê‚銄ž‚݃T[ƒrƒXƒ‹[ƒ`ƒ“‚̐”‚́Ctnum_sisr‚É•Û
115 * Ž‚·‚éD
116 */
117extern const ID tmax_isrid;
118extern const uint_t tnum_sisr;
119
120/*
121 * Š„ž‚݃T[ƒrƒXƒ‹[ƒ`ƒ“‰Šú‰»ƒuƒƒbƒN‚̃GƒŠƒAikernel_cfg.cj
122 */
123extern const ISRINIB sisrinib_table[];
124extern ISRINIB aisrinib_table[];
125
126/*
127 * Š„ž‚݃T[ƒrƒXƒ‹[ƒ`ƒ“ŠÇ—ƒuƒƒbƒN‚̃GƒŠƒAikernel_cfg.cj
128 */
129extern ISRCB isrcb_table[];
130
131/*
132 * Š„ž‚݃T[ƒrƒXƒ‹[ƒ`ƒ“ŠÇ—ƒuƒƒbƒN‚©‚犄ž‚݃T[ƒrƒXƒ‹[ƒ`ƒ“ID‚ðŽæ
133 * ‚èo‚·‚½‚߂̃}ƒNƒ
134 */
135#define ISRID(p_isrcb) ((ID)(((p_isrcb) - isrcb_table) \
136 - tnum_sisr + TMIN_ISRID))
137
138/*
139 * Š„ž‚݃T[ƒrƒXƒ‹[ƒ`ƒ“‹@”\‚̏‰Šú‰»
140 */
141extern void initialize_isr(void);
142
143/*
144 * Š„ž‚݃T[ƒrƒXƒ‹[ƒ`ƒ“‚̌ďo‚µ
145 */
146extern void call_isr(QUEUE *p_isr_queue);
147
148#ifndef OMIT_INITIALIZE_INTERRUPT
149
150/*
151 * Š„ž‚݃nƒ“ƒhƒ‰‰Šú‰»ƒuƒƒbƒN
152 */
153typedef struct interrupt_handler_initialization_block {
154 INHNO inhno; /* Š„ž‚݃nƒ“ƒhƒ‰”ԍ† */
155 ATR inhatr; /* Š„ž‚݃nƒ“ƒhƒ‰‘®« */
156 FP int_entry; /* Š„ž‚݃nƒ“ƒhƒ‰‚̏o“üŒûˆ—‚̔Ԓn */
157} INHINIB;
158
159/*
160 * Š„ž‚Ý—v‹ƒ‰ƒCƒ“‰Šú‰»ƒuƒƒbƒN
161 */
162typedef struct interrupt_request_initialization_block {
163 INTNO intno; /* Š„ž‚ݔԍ† */
164 ATR intatr; /* Š„ž‚Ý‘®« */
165 PRI intpri; /* Š„ž‚Ý—Dæ“x */
166} INTINIB;
167
168/*
169 * Š„ž‚݃nƒ“ƒhƒ‰”ԍ†‚̐”ikernel_cfg.cj
170 */
171extern const uint_t tnum_inhno;
172
173/*
174 * Š„ž‚݃nƒ“ƒhƒ‰‰Šú‰»ƒuƒƒbƒN‚̃GƒŠƒAikernel_cfg.cj
175 */
176extern const INHINIB inhinib_table[];
177
178/*
179 * Š„ž‚Ý—v‹ƒ‰ƒCƒ“‚̐”ikernel_cfg.cj
180 */
181extern const uint_t tnum_intno;
182
183/*
184 * Š„ž‚Ý—v‹ƒ‰ƒCƒ“‰Šú‰»ƒuƒƒbƒN‚̃GƒŠƒAikernel_cfg.cj
185 */
186extern const INTINIB intinib_table[];
187
188#endif /* OMIT_INITIALIZE_INTERRUPT */
189
190/*
191 * Š„ž‚ÝŠÇ—‹@”\‚̏‰Šú‰»
192 */
193extern void initialize_interrupt(void);
194
195#endif /* TOPPERS_INTERRUPT_H */
Note: See TracBrowser for help on using the repository browser.