source: UsbWattMeter/trunk/asp_dcre/arch/rx630_ccrx/prc_insn.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: 3.7 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-2003 by Embedded and Real-Time Systems Laboratory
7 * Toyohashi Univ. of Technology, JAPAN
8 * Copyright (C) 2005,2006 by Embedded and Real-Time Systems Laboratory
9 * Graduate School of Information Science, Nagoya Univ., JAPAN
10 * Copyright (C) 2008-2010 by Witz Corporation, JAPAN
11 *
12 * ã‹L’˜ìŒ ŽÒ‚́CˆÈ‰º‚Ì(1)`(4)‚ÌðŒ‚ð–ž‚½‚·ê‡‚ÉŒÀ‚èC–{ƒ\ƒtƒgƒEƒF
13 * ƒAi–{ƒ\ƒtƒgƒEƒFƒA‚ð‰ü•Ï‚µ‚½‚à‚Ì‚ðŠÜ‚ށDˆÈ‰º“¯‚¶j‚ðŽg—pE•¡»E‰ü
14 * •ÏEÄ”z•ziˆÈ‰ºC—˜—p‚ƌĂԁj‚·‚邱‚Ƃ𖳏ž‚Å‹–‘ø‚·‚éD
15 * (1) –{ƒ\ƒtƒgƒEƒFƒA‚ðƒ\[ƒXƒR[ƒh‚ÌŒ`‚Å—˜—p‚·‚éê‡‚ɂ́Cã‹L‚Ì’˜ì
16 * Œ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•ÛØ‹K’肪C‚»‚Ì‚Ü‚Ü‚ÌŒ`‚Ń\[
17 * ƒXƒR[ƒh’†‚ÉŠÜ‚Ü‚ê‚Ä‚¢‚邱‚ƁD
18 * (2) –{ƒ\ƒtƒgƒEƒFƒA‚ðCƒ‰ƒCƒuƒ‰ƒŠŒ`Ž®‚ȂǁC‘¼‚̃\ƒtƒgƒEƒFƒAŠJ”­‚ÉŽg
19 * —p‚Å‚«‚éŒ`‚ōĔz•z‚·‚éê‡‚ɂ́CÄ”z•z‚É”º‚¤ƒhƒLƒ…
20ƒƒ“ƒgi—˜—p
21 * ŽÒƒ}ƒjƒ…
22ƒAƒ‹‚Ȃǁj‚ɁCã‹L‚Ì’˜ìŒ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L
23 * ‚Ì–³•ÛØ‹K’è‚ðŒfÚ‚·‚邱‚ƁD
24 * (3) –{ƒ\ƒtƒgƒEƒFƒA‚ðC‹@Ší‚É‘g‚ݍž‚ނȂǁC‘¼‚̃\ƒtƒgƒEƒFƒAŠJ”­‚ÉŽg
25 * —p‚Å‚«‚È‚¢Œ`‚ōĔz•z‚·‚éê‡‚ɂ́CŽŸ‚Ì‚¢‚¸‚ê‚©‚ÌðŒ‚ð–ž‚½‚·‚±
26 * ‚Ɓ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‚ɐ¶‚¶‚é‚¢‚©‚Ȃ鑹
34 * ŠQ‚©‚ç‚àCã‹L’˜ìŒ ŽÒ‚¨‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚ð–Ɛӂ·‚邱‚ƁD
35 * ‚Ü‚½C–{ƒ\ƒtƒgƒEƒFƒA‚̃†[ƒU‚Ü‚½‚̓Gƒ“ƒhƒ†[ƒU‚©‚ç‚Ì‚¢‚©‚Ȃ闝
36 * —R‚ÉŠî‚­¿‹‚©‚ç‚àCã‹L’˜ìŒ ŽÒ‚¨‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚ð
37 * –Ɛӂ·‚邱‚ƁD
38 *
39 * –{ƒ\ƒtƒgƒEƒFƒA‚́C–³•ÛØ‚Å’ñ‹Ÿ‚³‚ê‚Ä‚¢‚é‚à‚Ì‚Å‚ ‚éDã‹L’˜ìŒ ŽÒ‚¨
40 * ‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚́C–{ƒ\ƒtƒgƒEƒFƒA‚ÉŠÖ‚µ‚āC“Á’è‚ÌŽg—p–Ú“I
41 * ‚ɑ΂·‚é“K‡«‚àŠÜ‚߂āC‚¢‚©‚È‚é•ÛØ‚às‚í‚È‚¢D‚Ü‚½C–{ƒ\ƒtƒgƒEƒF
42 * ƒA‚Ì—˜—p‚É‚æ‚è’¼Ú“I‚Ü‚½‚͊ԐړI‚ɐ¶‚¶‚½‚¢‚©‚Ȃ鑹ŠQ‚ÉŠÖ‚µ‚Ä‚àC‚»
43 * ‚̐ӔC‚𕉂í‚È‚¢D
44 *
45 * @(#) $Id: prc_insn.h 164 2016-03-07 11:33:50Z coas-nagasima $
46 */
47
48/*
49 * ƒvƒƒZƒbƒT‚Ì“ÁŽê–½—߂̃Cƒ“ƒ‰ƒCƒ“ŠÖ”’è‹`iRX630—pj
50 */
51
52#ifndef TOPPERS_PRC_INSN_H
53#define TOPPERS_PRC_INSN_H
54
55
56static uint32_t current_psw( void );
57static void set_psw( uint32_t psw );
58Inline uint32_t current_ipl( void );
59Inline void set_ipl( uint32_t ipl );
60static void disint( void );
61static void enaint( void );
62static uint16_t rev_endian_uint16( uint16_t data );
63static uint32_t rev_endian_uint32( uint32_t data );
64
65
66/*
67 * Iƒtƒ‰ƒO, IPL‚ðŽæ“¾‚·‚邽‚߂̃}ƒNƒ’è‹`
68 */
69#define PSW_I_MASK ( 0x00010000UL )
70#define PSW_IPL_MASK ( 0x0F000000UL )
71
72
73/*
74 * ƒvƒƒZƒbƒTƒXƒe[ƒ^ƒXƒŒƒWƒXƒ^(PSW)‚ÌŒ»Ý’l‚̓Ǐo‚µ
75 */
76#pragma inline_asm current_psw
77static uint32_t
78current_psw( void )
79{
80 mvfc psw, r1
81}
82
83
84/*
85 * ƒvƒƒZƒbƒTƒXƒe[ƒ^ƒXƒŒƒWƒXƒ^(PSW)‚֐ݒè
86 */
87#pragma inline_asm set_psw
88static void
89set_psw( uint32_t psw )
90{
91 mvtc r1, psw
92}
93
94
95/*
96 * IPL‚ÌŒ»Ý’l‚̓Ǐo‚µ
97 */
98Inline uint32_t
99current_ipl( void )
100{
101 return ( uint32_t )( current_psw() & PSW_IPL_MASK );
102}
103
104
105/*
106 * IPL‚֐ݒè
107 */
108Inline void
109set_ipl( uint32_t ipl )
110{
111 set_psw( ( current_psw() & ( ~PSW_IPL_MASK ) ) | ipl );
112}
113
114
115/*
116 * NMI‚ðœ‚­‚·‚ׂĂ̊„ž‚Ý‚Ì‹ÖŽ~
117 */
118#pragma inline_asm disint
119static void
120disint( void )
121{
122 clrpsw i
123}
124
125
126/*
127 * NMI‚ðœ‚­‚·‚ׂĂ̊„ž‚Ý‚Ì‹–‰Â
128 */
129#pragma inline_asm enaint
130static void
131enaint( void )
132{
133 setpsw i
134}
135
136
137/*
138 * ƒGƒ“ƒfƒBƒAƒ“•ÏŠ· 16bit
139 */
140#pragma inline_asm rev_endian_uint16
141static uint16_t
142rev_endian_uint16( uint16_t data )
143{
144 revw r1, r1
145}
146
147/*
148 * ƒGƒ“ƒfƒBƒAƒ“•ÏŠ· 32bit
149 */
150#pragma inline_asm rev_endian_uint32
151static uint32_t
152rev_endian_uint32( uint32_t data )
153{
154 revl r1, r1
155}
156
157
158#endif /* TOPPERS_PRC_INSN_H */
Note: See TracBrowser for help on using the repository browser.