OSDN Git Service

2e89dabd5c1df88ec6e09d995d6d4e0f42a49103
[trx-305dsp/dsp.git] / trx305 / kernel / tools / blackfin-vdsp / sample1_ezkit_bf518 / 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 ) 1), (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 2
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 };
67
68 SEMCB _kernel_semcb_table[TNUM_SEMID];
69
70
71     /* Object initializer [eventflag] */
72
73 #define TNUM_FLGID 0
74
75 const 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
85 const 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
95 const 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
105 const 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
115 const ID _kernel_tmax_cycid = (TMIN_CYCID + TNUM_CYCID - 1);
116
117 const CYCINIB _kernel_cycinib_table[TNUM_CYCID] = {
118     {0,0,(FP)(cyclic_handler),2000,0}
119 };
120
121 CYCCB _kernel_cyccb_table[TNUM_CYCID];
122
123
124     /* Object initializer [interrupt] */
125
126 #define TNUM_INHNO 3
127
128 const UINT _kernel_tnum_inhno = TNUM_INHNO;
129
130 CFG_INTHDR_ENTRY(sio0_rx_handler);
131 CFG_INTHDR_ENTRY(sio0_tx_handler);
132 CFG_INTHDR_ENTRY(timer_handler);
133
134 const INHINIB _kernel_inhinib_table[TNUM_INHNO] = {
135     {22,0,(FP)CFG_INT_ENTRY(sio0_rx_handler)},
136     {23,0,(FP)CFG_INT_ENTRY(sio0_tx_handler)},
137     {39,0,(FP)CFG_INT_ENTRY(timer_handler)}
138 };
139
140
141     /* Object initializer [exception] */
142
143 #define TNUM_EXCNO 1
144
145 const UINT _kernel_tnum_excno = TNUM_EXCNO;
146
147 CFG_EXCHDR_ENTRY(cpuexc_handler);
148
149 const EXCINIB _kernel_excinib_table[TNUM_EXCNO] = {
150     {0,0,(FP)CFG_EXC_ENTRY(cpuexc_handler)}
151 };
152
153     /* Initialization handler */
154
155 void
156 _kernel_call_inirtn(void)
157 {
158     timer_initialize( (VP_INT)(0) );
159     serial_initialize( (VP_INT)(0) );
160 }
161
162 void
163 _kernel_call_terrtn(void)
164 {
165     timer_terminate( (VP_INT)(0) );
166 }
167
168     /* Object initialization routine */
169
170 void
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
180 TMEVTN   _kernel_tmevt_heap[TNUM_TSKID + TNUM_CYCID];
181