source: UsbWattMeter/trunk/asp_dcre/arch/rx630_msvc/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.5 KB
RevLine 
[164]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
56extern uint32_t current_psw( void );
57extern void set_psw( uint32_t psw );
58Inline uint32_t current_ipl( void );
59Inline void set_ipl( uint32_t ipl );
60extern void disint( void );
61extern 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 */
76extern uint32_t current_psw( void );
77
78
79/*
80 * ƒvƒƒZƒbƒTƒXƒe[ƒ^ƒXƒŒƒWƒXƒ^(PSW)‚֐ݒè
81 */
82extern void set_psw( uint32_t psw );
83
84
85/*
86 * IPL‚ÌŒ»Ý’l‚̓Ǐo‚µ
87 */
88Inline uint32_t
89current_ipl( void )
90{
91 return ( uint32_t )( current_psw() & PSW_IPL_MASK );
92}
93
94
95/*
96 * IPL‚֐ݒè
97 */
98Inline void
99set_ipl( uint32_t ipl )
100{
101 set_psw( ( current_psw() & ( ~PSW_IPL_MASK ) ) | ipl );
102}
103
104
105/*
106 * NMI‚ðœ‚­‚·‚ׂĂ̊„ž‚Ý‚Ì‹ÖŽ~
107 */
108extern void disint( void );
109
110/*
111 * NMI‚ðœ‚­‚·‚ׂĂ̊„ž‚Ý‚Ì‹–‰Â
112 */
113extern void enaint( void );
114
115/*
116 * ƒGƒ“ƒfƒBƒAƒ“•ÏŠ· 16bit
117 */
118Inline uint16_t
119rev_endian_uint16( uint16_t data )
120{
121 return (data >> 8) | (data << 8);
122}
123
124/*
125 * ƒGƒ“ƒfƒBƒAƒ“•ÏŠ· 32bit
126 */
127Inline uint32_t
128rev_endian_uint32( uint32_t data )
129{
130 return (data >> 24) | ((data >> 8) & 0xFF) | ((data << 8) & 0xFF) | (data << 24);
131}
132
133
134#endif /* TOPPERS_PRC_INSN_H */
Note: See TracBrowser for help on using the repository browser.