source: UsbWattMeter/trunk/asp_dcre/kernel/mailbox.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: 4.2 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-2012 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: mailbox.h 164 2016-03-07 11:33:50Z coas-nagasima $
45 */
46
47/*
48 * ƒ[ƒ‹ƒ{ƒbƒNƒX‹@”\
49 */
50
51#ifndef TOPPERS_MAILBOX_H
52#define TOPPERS_MAILBOX_H
53
54#include "wait.h"
55
56/*
57 * ƒ[ƒ‹ƒ{ƒbƒNƒX‰Šú‰»ƒuƒƒbƒN
58 *
59 * ‚±‚̍\‘¢‘̂́C“¯ŠúE’ʐMƒIƒuƒWƒFƒNƒg‚̏‰Šú‰»ƒuƒƒbƒN‚Ì‹¤’Ê•”•ª
60 * iWOBJINIBj‚ðŠg’£iƒIƒuƒWƒFƒNƒgŽwŒüŒ¾Œê‚ÌŒp³‚É‘Š“–j‚µ‚½‚à‚̂ŁC
61 * Å‰‚̃tƒB[ƒ‹ƒh‚ª‹¤’Ê‚É‚È‚Á‚Ä‚¢‚éD
62 */
63typedef struct mailbox_initialization_block {
64 ATR mbxatr; /* ƒ[ƒ‹ƒ{ƒbƒNƒX‘®« */
65 PRI maxmpri; /* ƒƒbƒZ[ƒW—Dæ“x‚̍őå’l */
66} MBXINIB;
67
68/*
69 * ƒ[ƒ‹ƒ{ƒbƒNƒXŠÇ—ƒuƒƒbƒN
70 *
71 * ‚±‚̍\‘¢‘̂́C“¯ŠúE’ʐMƒIƒuƒWƒFƒNƒg‚ÌŠÇ—ƒuƒƒbƒN‚Ì‹¤’Ê•”•ªiWOBJCBj
72 * ‚ðŠg’£iƒIƒuƒWƒFƒNƒgŽwŒüŒ¾Œê‚ÌŒp³‚É‘Š“–j‚µ‚½‚à‚̂ŁCÅ‰‚Ì2‚‚Ì
73 * ƒtƒB[ƒ‹ƒh‚ª‹¤’Ê‚É‚È‚Á‚Ä‚¢‚éD
74 *
75 * ƒƒbƒZ[ƒWƒLƒ…
76[‚ªƒƒbƒZ[ƒW‚Ì—Dæ“x‡‚̏ꍇ‚ɂ́Cpk_last‚ÍŽg‚í‚È
77 * ‚¢D‚Ü‚½CƒƒbƒZ[ƒWƒLƒ…
78[‚ª‹ó‚̏ꍇipk_head‚ªNULL‚̏ꍇj‚É‚àC
79 * pk_last‚Í–³Œø‚Å‚ ‚éD
80 */
81typedef struct mailbox_control_block {
82 QUEUE wait_queue; /* ƒ[ƒ‹ƒ{ƒbƒNƒX‘Ò‚¿ƒLƒ…
83[ */
84 const MBXINIB *p_mbxinib; /* ‰Šú‰»ƒuƒƒbƒN‚ւ̃|ƒCƒ“ƒ^ */
85 T_MSG *pk_head; /* æ“ª‚̃ƒbƒZ[ƒW */
86 T_MSG *pk_last; /* ––”ö‚̃ƒbƒZ[ƒW */
87} MBXCB;
88
89/*
90 * ƒ[ƒ‹ƒ{ƒbƒNƒX‘Ò‚¿î•ñƒuƒƒbƒN‚Ì’è‹`
91 *
92 * ‚±‚̍\‘¢‘̂́C“¯ŠúE’ʐMƒIƒuƒWƒFƒNƒg‚Ì‘Ò‚¿î•ñƒuƒƒbƒN‚Ì‹¤’Ê•”•ª
93 * iWINFO_WOBJj‚ðŠg’£iƒIƒuƒWƒFƒNƒgŽwŒüŒ¾Œê‚ÌŒp³‚É‘Š“–j‚µ‚½‚à‚̂ŁC
94 * Å‰‚Ì2‚‚̃tƒB[ƒ‹ƒh‚ª‹¤’Ê‚É‚È‚Á‚Ä‚¢‚éD
95 */
96typedef struct mailbox_waiting_information {
97 WINFO winfo; /* •W€‚Ì‘Ò‚¿î•ñƒuƒƒbƒN */
98 MBXCB *p_mbxcb; /* ‘Ò‚Á‚Ä‚¢‚郁[ƒ‹ƒ{ƒbƒNƒX‚ÌŠÇ—ƒuƒƒbƒN */
99 T_MSG *pk_msg; /* ŽóM‚µ‚½ƒƒbƒZ[ƒW */
100} WINFO_MBX;
101
102/*
103 * Žg—p‚µ‚Ä‚¢‚È‚¢ƒ[ƒ‹ƒ{ƒbƒNƒXŠÇ—ƒuƒƒbƒN‚̃ŠƒXƒg
104 */
105extern QUEUE free_mbxcb;
106
107/*
108 * ƒ[ƒ‹ƒ{ƒbƒNƒXID‚̍őå’likernel_cfg.cj
109 */
110extern const ID tmax_mbxid;
111extern const ID tmax_smbxid;
112
113/*
114 * ƒ[ƒ‹ƒ{ƒbƒNƒX‰Šú‰»ƒuƒƒbƒN‚̃GƒŠƒAikernel_cfg.cj
115 */
116extern const MBXINIB mbxinib_table[];
117extern MBXINIB ambxinib_table[];
118
119/*
120 * ƒ[ƒ‹ƒ{ƒbƒNƒXŠÇ—ƒuƒƒbƒN‚̃GƒŠƒAikernel_cfg.cj
121 */
122extern MBXCB mbxcb_table[];
123
124/*
125 * ƒ[ƒ‹ƒ{ƒbƒNƒXŠÇ—ƒuƒƒbƒN‚©‚烁[ƒ‹ƒ{ƒbƒNƒXID‚ðŽæ‚èo‚·‚½‚߂̃}ƒNƒ
126 */
127#define MBXID(p_mbxcb) ((ID)(((p_mbxcb) - mbxcb_table) + TMIN_MBXID))
128
129/*
130 * ƒ[ƒ‹ƒ{ƒbƒNƒX‹@”\‚̏‰Šú‰»
131 */
132extern void initialize_mailbox(void);
133
134#endif /* TOPPERS_MAILBOX_H */
Note: See TracBrowser for help on using the repository browser.