OSDN Git Service

Doxygenコメントを追加した。
[uzume/uzume_bfin.git] / uzumeapp / kernel / tools / blackfin-vdsp / sample1_ezkit_bf548 / kernel_cfg.c
1 /* Configured with [sample1_pp.cfg ] */
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
36 const ID _kernel_tmax_tskid = (TMIN_TSKID + TNUM_TSKID - 1);
37
38 static __STK_UNIT __stack_TASK1[__TCOUNT_STK_UNIT(1024)];
39 static __STK_UNIT __stack_TASK2[__TCOUNT_STK_UNIT(1024)];
40 static __STK_UNIT __stack_TASK3[__TCOUNT_STK_UNIT(1024)];
41 static __STK_UNIT __stack_MAIN_TASK[__TCOUNT_STK_UNIT(1024)];
42 static __STK_UNIT __stack_LOGTASK[__TCOUNT_STK_UNIT(LOGTASK_STACK_SIZE)];
43
44 const TINIB _kernel_tinib_table[TNUM_TSKID] = {
45     {0, (VP_INT)(( VP_INT ) 1), (FP)(task), INT_PRIORITY(10), __TROUND_STK_UNIT(1024), __stack_TASK1, 0, (FP)(tex_routine)},
46     {0, (VP_INT)(( VP_INT ) 2), (FP)(task), INT_PRIORITY(10), __TROUND_STK_UNIT(1024), __stack_TASK2, 0, (FP)(tex_routine)},
47     {0, (VP_INT)(( VP_INT ) 3), (FP)(task), INT_PRIORITY(10), __TROUND_STK_UNIT(1024), __stack_TASK3, 0, (FP)(tex_routine)},
48     {0x00u | 0x02u, (VP_INT)(0), (FP)(main_task), INT_PRIORITY(5), __TROUND_STK_UNIT(1024), __stack_MAIN_TASK, TA_NULL, (FP)(NULL)},
49     {0x00u | 0x02u, (VP_INT)(( VP_INT ) 2), (FP)(logtask), INT_PRIORITY(LOGTASK_PRIORITY), __TROUND_STK_UNIT(LOGTASK_STACK_SIZE), __stack_LOGTASK, TA_NULL, (FP)(NULL)}
50 };
51
52 const ID _kernel_torder_table[TNUM_TSKID] = {1,2,3,4,5};
53
54 TCB _kernel_tcb_table[TNUM_TSKID];
55
56
57     /* Object initializer [semaphore] */
58
59 #define TNUM_SEMID 4
60
61 const ID _kernel_tmax_semid = (TMIN_SEMID + TNUM_SEMID - 1);
62
63 const SEMINIB _kernel_seminib_table[TNUM_SEMID] = {
64     {1, 0, 1},
65     {1, 1, 1},
66     {1, 0, 1},
67     {1, 1, 1}
68 };
69
70 SEMCB _kernel_semcb_table[TNUM_SEMID];
71
72
73     /* Object initializer [eventflag] */
74
75 #define TNUM_FLGID 0
76
77 const ID _kernel_tmax_flgid = (TMIN_FLGID + TNUM_FLGID - 1);
78
79 __EMPTY_LABEL(const FLGINIB, _kernel_flginib_table);
80 __EMPTY_LABEL(FLGCB, _kernel_flgcb_table);
81
82
83     /* Object initializer [dataqueue] */
84
85 #define TNUM_DTQID 0
86
87 const ID _kernel_tmax_dtqid = (TMIN_DTQID + TNUM_DTQID - 1);
88
89 __EMPTY_LABEL(const DTQINIB, _kernel_dtqinib_table);
90 __EMPTY_LABEL(DTQCB, _kernel_dtqcb_table);
91
92
93     /* Object initializer [mailbox] */
94
95 #define TNUM_MBXID 0
96
97 const ID _kernel_tmax_mbxid = (TMIN_MBXID + TNUM_MBXID - 1);
98
99 __EMPTY_LABEL(const MBXINIB, _kernel_mbxinib_table);
100 __EMPTY_LABEL(MBXCB, _kernel_mbxcb_table);
101
102
103     /* Object initializer [mempfix] */
104
105 #define TNUM_MPFID 0
106
107 const ID _kernel_tmax_mpfid = (TMIN_MPFID + TNUM_MPFID - 1);
108
109 __EMPTY_LABEL(const MPFINIB, _kernel_mpfinib_table);
110 __EMPTY_LABEL(MPFCB, _kernel_mpfcb_table);
111
112
113     /* Object initializer [cyclic] */
114
115 #define TNUM_CYCID 1
116
117 const ID _kernel_tmax_cycid = (TMIN_CYCID + TNUM_CYCID - 1);
118
119 const CYCINIB _kernel_cycinib_table[TNUM_CYCID] = {
120     {0,0,(FP)(cyclic_handler),2000,0}
121 };
122
123 CYCCB _kernel_cyccb_table[TNUM_CYCID];
124
125
126     /* Object initializer [interrupt] */
127
128 #define TNUM_INHNO 3
129
130 const UINT _kernel_tnum_inhno = TNUM_INHNO;
131
132 CFG_INTHDR_ENTRY(sio1_rx_handler);
133 CFG_INTHDR_ENTRY(sio1_tx_handler);
134 CFG_INTHDR_ENTRY(timer_handler);
135
136 const INHINIB _kernel_inhinib_table[TNUM_INHNO] = {
137     {41,0,(FP)CFG_INT_ENTRY(sio1_rx_handler)},
138     {42,0,(FP)CFG_INT_ENTRY(sio1_tx_handler)},
139     {93,0,(FP)CFG_INT_ENTRY(timer_handler)}
140 };
141
142
143     /* Object initializer [exception] */
144
145 #define TNUM_EXCNO 1
146
147 const UINT _kernel_tnum_excno = TNUM_EXCNO;
148
149 CFG_EXCHDR_ENTRY(cpuexc_handler);
150
151 const EXCINIB _kernel_excinib_table[TNUM_EXCNO] = {
152     {0,0,(FP)CFG_EXC_ENTRY(cpuexc_handler)}
153 };
154
155     /* Initialization handler */
156
157 void
158 _kernel_call_inirtn(void)
159 {
160     timer_initialize( (VP_INT)(0) );
161     serial_initialize( (VP_INT)(0) );
162 }
163
164 void
165 _kernel_call_terrtn(void)
166 {
167     timer_terminate( (VP_INT)(0) );
168 }
169
170     /* Object initialization routine */
171
172 void
173 _kernel_object_initialize(void)
174 {
175     _kernel_task_initialize();
176     _kernel_semaphore_initialize();
177     _kernel_cyclic_initialize();
178     _kernel_interrupt_initialize();
179     _kernel_exception_initialize();
180 }
181
182 TMEVTN   _kernel_tmevt_heap[TNUM_TSKID + TNUM_CYCID];
183