source: ssp_qb_r5f100le_cs/trunk/arch/arm_m_gcc/prc_timer.h@ 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.4 KB
RevLine 
[93]1/*
2 * TOPPERS/SSP Kernel
3 * Smallest Set Profile Kernel
4 *
5 * Copyright (C) 2008 by Embedded and Real-Time Systems Laboratory
6 * Graduate School of Information Science, Nagoya Univ., JAPAN
7 *
8 * ã‹L’˜ìŒ ŽÒ‚́CˆÈ‰º‚Ì(1)`(4)‚ÌðŒ‚ð–ž‚½‚·ê‡‚ÉŒÀ‚èC–{ƒ\ƒtƒgƒEƒF
9 * ƒAi–{ƒ\ƒtƒgƒEƒFƒA‚ð‰ü•Ï‚µ‚½‚à‚Ì‚ðŠÜ‚ށDˆÈ‰º“¯‚¶j‚ðŽg—pE•¡»E‰ü
10 * •ÏEÄ”z•ziˆÈ‰ºC—˜—p‚ƌĂԁj‚·‚邱‚Ƃ𖳏ž‚Å‹–‘ø‚·‚éD
11 * (1) –{ƒ\ƒtƒgƒEƒFƒA‚ðƒ\[ƒXƒR[ƒh‚ÌŒ`‚Å—˜—p‚·‚éê‡‚ɂ́Cã‹L‚Ì’˜ì
12 * Œ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•ÛØ‹K’肪C‚»‚Ì‚Ü‚Ü‚ÌŒ`‚Ń\[
13 * ƒXƒR[ƒh’†‚ÉŠÜ‚Ü‚ê‚Ä‚¢‚邱‚ƁD
14 * (2) –{ƒ\ƒtƒgƒEƒFƒA‚ðCƒ‰ƒCƒuƒ‰ƒŠŒ`Ž®‚ȂǁC‘¼‚̃\ƒtƒgƒEƒFƒAŠJ”­‚ÉŽg
15 * —p‚Å‚«‚éŒ`‚ōĔz•z‚·‚éê‡‚ɂ́CÄ”z•z‚É”º‚¤ƒhƒLƒ…
16ƒƒ“ƒgi—˜—p
17 * ŽÒƒ}ƒjƒ…
18ƒAƒ‹‚Ȃǁj‚ɁCã‹L‚Ì’˜ìŒ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L
19 * ‚Ì–³•ÛØ‹K’è‚ðŒfÚ‚·‚邱‚ƁD
20 * (3) –{ƒ\ƒtƒgƒEƒFƒA‚ðC‹@Ší‚É‘g‚ݍž‚ނȂǁC‘¼‚̃\ƒtƒgƒEƒFƒAŠJ”­‚ÉŽg
21 * —p‚Å‚«‚È‚¢Œ`‚ōĔz•z‚·‚éê‡‚ɂ́CŽŸ‚Ì‚¢‚¸‚ê‚©‚ÌðŒ‚ð–ž‚½‚·‚±
22 * ‚ƁD
23 * (a) Ä”z•z‚É”º‚¤ƒhƒLƒ…
24ƒƒ“ƒgi—˜—pŽÒƒ}ƒjƒ…
25ƒAƒ‹‚Ȃǁj‚ɁCã‹L‚Ì’˜
26 * ìŒ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•ÛØ‹K’è‚ðŒfÚ‚·‚邱‚ƁD
27 * (b) Ä”z•z‚ÌŒ`‘Ô‚ðC•Ê‚É’è‚ß‚é•û–@‚É‚æ‚Á‚āCTOPPERSƒvƒƒWƒFƒNƒg‚É
28 * •ñ‚·‚邱‚ƁD
29 * (4) –{ƒ\ƒtƒgƒEƒFƒA‚Ì—˜—p‚É‚æ‚è’¼Ú“I‚Ü‚½‚͊ԐړI‚ɐ¶‚¶‚é‚¢‚©‚Ȃ鑹
30 * ŠQ‚©‚ç‚àCã‹L’˜ìŒ ŽÒ‚¨‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚ð–Ɛӂ·‚邱‚ƁD
31 * ‚Ü‚½C–{ƒ\ƒtƒgƒEƒFƒA‚̃†[ƒU‚Ü‚½‚̓Gƒ“ƒhƒ†[ƒU‚©‚ç‚Ì‚¢‚©‚Ȃ闝
32 * —R‚ÉŠî‚­¿‹‚©‚ç‚àCã‹L’˜ìŒ ŽÒ‚¨‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚ð
33 * –Ɛӂ·‚邱‚ƁD
34 *
35 * –{ƒ\ƒtƒgƒEƒFƒA‚́C–³•ÛØ‚Å’ñ‹Ÿ‚³‚ê‚Ä‚¢‚é‚à‚Ì‚Å‚ ‚éDã‹L’˜ìŒ ŽÒ‚¨
36 * ‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚́C–{ƒ\ƒtƒgƒEƒFƒA‚ÉŠÖ‚µ‚āC“Á’è‚ÌŽg—p–Ú“I
37 * ‚ɑ΂·‚é“K‡«‚àŠÜ‚߂āC‚¢‚©‚È‚é•ÛØ‚às‚í‚È‚¢D‚Ü‚½C–{ƒ\ƒtƒgƒEƒF
38 * ƒA‚Ì—˜—p‚É‚æ‚è’¼Ú“I‚Ü‚½‚͊ԐړI‚ɐ¶‚¶‚½‚¢‚©‚Ȃ鑹ŠQ‚ÉŠÖ‚µ‚Ä‚àC‚»
39 * ‚̐ӔC‚𕉂í‚È‚¢D
40 *
41 * @(#) $Id: prc_timer.h 1304 2008-08-27 07:28:36Z ertl-honda $
42 */
43
44/*
45 * ƒ^ƒCƒ}ƒhƒ‰ƒCƒoiSYSTIC—pj
46 */
47
48#ifndef TOPPERS_PRC_TIMER_H
49#define TOPPERS_PRC_TIMER_H
50
51#include <sil.h>
52
53/*
54 * ƒ^ƒCƒ}Š„ž‚݃nƒ“ƒhƒ‰“o˜^‚Ì‚½‚߂̒萔
55 */
56#define INHNO_TIMER IRQNO_SYSTICK /* Š„ž‚݃nƒ“ƒhƒ‰”ԍ† */
57#define INTNO_TIMER IRQNO_SYSTICK /* Š„ž‚ݔԍ† */
58
59#ifndef TOPPERS_MACRO_ONLY
60
61/*
62 * ƒ^ƒCƒ}’l‚Ì“à•”•\Œ»‚ÌŒ^
63 */
64typedef uint32_t CLOCK;
65
66/*
67 * ƒ^ƒCƒ}’l‚Ì“à•”•\Œ»‚ƃ~ƒŠ•bEƒÊ•b’PˆÊ‚Æ‚Ì•ÏŠ·
68 *
69 */
70#define TO_CLOCK(nume, deno) ((CLOCK)(TIMER_CLOCK * (nume) / (deno)))
71#define TO_USEC(clock) (((SYSUTM) clock) * 1000U / TIMER_CLOCK)
72
73/*
74 * Ý’è‚Å‚«‚éÅ‘å‚̃^ƒCƒ}ŽüŠúi’PˆÊ‚Í“à•”•\Œ»j
75 */
76#define MAX_CLOCK ((CLOCK) 0x00ffffffU)
77
78/*
79 * ƒ^ƒCƒ}‚Ì‹N“®ˆ—
80 *
81 * ƒ^ƒCƒ}‚ð‰Šú‰»‚µCŽüŠú“I‚ȃ^ƒCƒ}Š„ž‚Ý—v‹‚𔭐¶‚³‚¹‚éD
82 */
83extern void target_timer_initialize(intptr_t exinf);
84
85/*
86 * ƒ^ƒCƒ}‚Ì’âŽ~ˆ—
87 *
88 * ƒ^ƒCƒ}‚Ì“®ì‚ð’âŽ~‚³‚¹‚éD
89 */
90extern void target_timer_terminate(intptr_t exinf);
91
92/*
93 * ƒ^ƒCƒ}‚ÌŒ»Ý’l‚̓Ǐo‚µ
94 */
95Inline CLOCK
96target_timer_get_current(void)
97{
98 return(TO_CLOCK(TIC_NUME, TIC_DENO) - sil_rew_mem((void*)SYSTIC_CURRENT_VALUE));
99}
100
101/*
102 * ƒ^ƒCƒ}Š„ž‚Ý—v‹‚̃`ƒFƒbƒN
103 */
104Inline bool_t
105target_timer_probe_int(void)
106{
107 return((sil_rew_mem((void*)SYSTIC_CONTROL_STATUS) & SYSTIC_COUNTFLAG) == SYSTIC_COUNTFLAG);
108}
109
110/*
111 * ƒ^ƒCƒ}Š„ž‚݃nƒ“ƒhƒ‰
112 */
113extern void target_timer_handler(void);
114
115#endif /* TOPPERS_MACRO_ONLY */
116#endif /* TOPPERS_PRC_TIMER_H */
Note: See TracBrowser for help on using the repository browser.