source: anotherchoice/tags/jsp-1.4.4-full-UTF8/tools/TLCS900-TOSHIBA/Zup-F16-ex/kernel_cfg.c@ 26

Last change on this file since 26 was 26, checked in by ykominami, 10 years ago

initial

File size: 4.5 KB
Line 
1/* Configured with [-cpu tlcs900-toshiba -system zup_f16_ex -s sample1.cfg.i ] */
2
3#include "kernel_cfg.h"
4#include "kernel_id.h"
5
6#if TKERNEL_PRVER >= 0x1040
7#define CFG_INTHDR_ENTRY(inthdr) INTHDR_ENTRY(inthdr)
8#define CFG_EXCHDR_ENTRY(exchdr) EXCHDR_ENTRY(exchdr)
9#define CFG_INT_ENTRY(inthdr) INT_ENTRY(inthdr)
10#define CFG_EXC_ENTRY(exchdr) EXC_ENTRY(exchdr)
11#else
12#error "This configuration file has no compatibility with TOPPERS/JSP rel 1.3 or earlier."
13#endif
14
15#ifndef __EMPTY_LABEL
16#define __EMPTY_LABEL(x,y) x y[0]
17#endif
18
19#if TKERNEL_PRID != 0x0001u /* TOPPERS/JSP */
20#error "You can not use this configuration file without TOPPERS/JSP"
21#endif
22
23 /* User specified include files*/
24#include "sample1.h"
25#include "hw_timer.h"
26#include "timer.h"
27#include <hw_serial.h>
28#include "serial.h"
29#include "logtask.h"
30
31
32 /* Object initializer [task] */
33
34#define TNUM_TSKID 5
35
36const ID _kernel_tmax_tskid = (TMIN_TSKID + TNUM_TSKID - 1);
37
38static __STK_UNIT __stack_TASK1[__TCOUNT_STK_UNIT(512)];
39static __STK_UNIT __stack_TASK2[__TCOUNT_STK_UNIT(512)];
40static __STK_UNIT __stack_TASK3[__TCOUNT_STK_UNIT(512)];
41static __STK_UNIT __stack_MAIN_TASK[__TCOUNT_STK_UNIT(512)];
42static __STK_UNIT __stack_LOGTASK[__TCOUNT_STK_UNIT(LOGTASK_STACK_SIZE)];
43
44const TINIB _kernel_tinib_table[TNUM_TSKID] = {
45 {0, (VP_INT)(( VP_INT ) 1), (FP)(task), INT_PRIORITY(10), __TROUND_STK_UNIT(512), __stack_TASK1, 0, (FP)(tex_routine)},
46 {0, (VP_INT)(( VP_INT ) 2), (FP)(task), INT_PRIORITY(10), __TROUND_STK_UNIT(512), __stack_TASK2, 0, (FP)(tex_routine)},
47 {0, (VP_INT)(( VP_INT ) 3), (FP)(task), INT_PRIORITY(10), __TROUND_STK_UNIT(512), __stack_TASK3, 0, (FP)(tex_routine)},
48 {0x00u | 0x02u, (VP_INT)(0), (FP)(main_task), INT_PRIORITY(5), __TROUND_STK_UNIT(512), __stack_MAIN_TASK, TA_NULL, (FP)(NULL)},
49 {0x00u | 0x02u, (VP_INT)(( VP_INT ) 1), (FP)(logtask), INT_PRIORITY(LOGTASK_PRIORITY), __TROUND_STK_UNIT(LOGTASK_STACK_SIZE), __stack_LOGTASK, TA_NULL, (FP)(NULL)}
50};
51
52const ID _kernel_torder_table[TNUM_TSKID] = {1,2,3,4,5};
53
54TCB _kernel_tcb_table[TNUM_TSKID];
55
56
57 /* Object initializer [semaphore] */
58
59#define TNUM_SEMID 2
60
61const ID _kernel_tmax_semid = (TMIN_SEMID + TNUM_SEMID - 1);
62
63const SEMINIB _kernel_seminib_table[TNUM_SEMID] = {
64 {1, 0, 1},
65 {1, 1, 1}
66};
67
68SEMCB _kernel_semcb_table[TNUM_SEMID];
69
70
71 /* Object initializer [eventflag] */
72
73#define TNUM_FLGID 0
74
75const ID _kernel_tmax_flgid = (TMIN_FLGID + TNUM_FLGID - 1);
76
77__EMPTY_LABEL(const FLGINIB, _kernel_flginib_table);
78__EMPTY_LABEL(FLGCB, _kernel_flgcb_table);
79
80
81 /* Object initializer [dataqueue] */
82
83#define TNUM_DTQID 0
84
85const ID _kernel_tmax_dtqid = (TMIN_DTQID + TNUM_DTQID - 1);
86
87__EMPTY_LABEL(const DTQINIB, _kernel_dtqinib_table);
88__EMPTY_LABEL(DTQCB, _kernel_dtqcb_table);
89
90
91 /* Object initializer [mailbox] */
92
93#define TNUM_MBXID 0
94
95const ID _kernel_tmax_mbxid = (TMIN_MBXID + TNUM_MBXID - 1);
96
97__EMPTY_LABEL(const MBXINIB, _kernel_mbxinib_table);
98__EMPTY_LABEL(MBXCB, _kernel_mbxcb_table);
99
100
101 /* Object initializer [mempfix] */
102
103#define TNUM_MPFID 0
104
105const ID _kernel_tmax_mpfid = (TMIN_MPFID + TNUM_MPFID - 1);
106
107__EMPTY_LABEL(const MPFINIB, _kernel_mpfinib_table);
108__EMPTY_LABEL(MPFCB, _kernel_mpfcb_table);
109
110
111 /* Object initializer [cyclic] */
112
113#define TNUM_CYCID 1
114
115const ID _kernel_tmax_cycid = (TMIN_CYCID + TNUM_CYCID - 1);
116
117const CYCINIB _kernel_cycinib_table[TNUM_CYCID] = {
118 {0,0,(FP)(cyclic_handler),2000,0}
119};
120
121CYCCB _kernel_cyccb_table[TNUM_CYCID];
122
123
124 /* Object initializer [interrupt] */
125
126#define TNUM_INHNO 3
127
128const UINT _kernel_tnum_inhno = TNUM_INHNO;
129
130CFG_INTHDR_ENTRY(timer_handler);
131CFG_INTHDR_ENTRY(serial_in_handler1);
132CFG_INTHDR_ENTRY(serial_out_handler1);
133
134const INHINIB _kernel_inhinib_table[TNUM_INHNO] = {
135 {20,0,(FP)CFG_INT_ENTRY(timer_handler)},
136 {36,0,(FP)CFG_INT_ENTRY(serial_in_handler1)},
137 {37,0,(FP)CFG_INT_ENTRY(serial_out_handler1)}
138};
139
140
141 /* Object initializer [exception] */
142
143#define TNUM_EXCNO 1
144
145const UINT _kernel_tnum_excno = TNUM_EXCNO;
146
147CFG_EXCHDR_ENTRY(cpuexc_handler);
148
149const EXCINIB _kernel_excinib_table[TNUM_EXCNO] = {
150 {3,0,(FP)CFG_EXC_ENTRY(cpuexc_handler)}
151};
152
153 /* Initialization handler */
154
155void
156_kernel_call_inirtn(void)
157{
158 timer_initialize( (VP_INT)(0) );
159 serial_initialize( (VP_INT)(0) );
160}
161
162void
163_kernel_call_terrtn(void)
164{
165 timer_terminate( (VP_INT)(0) );
166}
167
168 /* Object initialization routine */
169
170void
171_kernel_object_initialize(void)
172{
173 _kernel_task_initialize();
174 _kernel_semaphore_initialize();
175 _kernel_cyclic_initialize();
176 _kernel_interrupt_initialize();
177 _kernel_exception_initialize();
178}
179
180TMEVTN _kernel_tmevt_heap[TNUM_TSKID + TNUM_CYCID];
181
Note: See TracBrowser for help on using the repository browser.