OSDN Git Service

Talkthroughが動き出した。
[uzume/uzume_bfin.git] / uzume_prototype / kernel_cfg.c
1 /* Configured with [-s tmpfile1 -c -obj -cpu blackfin -system amakusa_bf592 ] */
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 "codec_ad1836a.h"
25 #include "uzume_prototype.h"
26 #include "hw_timer.h"
27 #include "timer.h"
28 #include "hw_serial.h"
29 #include "serial.h"
30 #include "logtask.h"
31 #include "i2c_subsystem.h"
32
33
34         /* Object initializer [task] */
35
36 #define TNUM_TSKID 3
37
38 const ID _kernel_tmax_tskid = (TMIN_TSKID + TNUM_TSKID - 1);
39
40 static __STK_UNIT __stack_CODEC_TASK[__TCOUNT_STK_UNIT(512)];
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         {0x00u | 0x02u, (VP_INT)(0), (FP)(task_ad1836a), INT_PRIORITY(3), __TROUND_STK_UNIT(512), __stack_CODEC_TASK, TA_NULL, (FP)(NULL)},
46         {0x00u | 0x02u, (VP_INT)(0), (FP)(main_task), INT_PRIORITY(5), __TROUND_STK_UNIT(1024), __stack_MAIN_TASK, TA_NULL, (FP)(NULL)},
47         {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)}
48 };
49
50 const ID _kernel_torder_table[TNUM_TSKID] = {1,2,3};
51
52 TCB _kernel_tcb_table[TNUM_TSKID];
53
54
55         /* Object initializer [semaphore] */
56
57 #define TNUM_SEMID 5
58
59 const ID _kernel_tmax_semid = (TMIN_SEMID + TNUM_SEMID - 1);
60
61 const SEMINIB _kernel_seminib_table[TNUM_SEMID] = {
62         {1, 0, 1},
63         {1, 0, 1},
64         {1, 1, 1},
65         {1, 1, 1},
66         {1, 0, 1}
67 };
68
69 SEMCB _kernel_semcb_table[TNUM_SEMID];
70
71
72         /* Object initializer [eventflag] */
73
74 #define TNUM_FLGID 0
75
76 const ID _kernel_tmax_flgid = (TMIN_FLGID + TNUM_FLGID - 1);
77
78 __EMPTY_LABEL(const FLGINIB, _kernel_flginib_table);
79 __EMPTY_LABEL(FLGCB, _kernel_flgcb_table);
80
81
82         /* Object initializer [dataqueue] */
83
84 #define TNUM_DTQID 0
85
86 const ID _kernel_tmax_dtqid = (TMIN_DTQID + TNUM_DTQID - 1);
87
88 __EMPTY_LABEL(const DTQINIB, _kernel_dtqinib_table);
89 __EMPTY_LABEL(DTQCB, _kernel_dtqcb_table);
90
91
92         /* Object initializer [mailbox] */
93
94 #define TNUM_MBXID 0
95
96 const ID _kernel_tmax_mbxid = (TMIN_MBXID + TNUM_MBXID - 1);
97
98 __EMPTY_LABEL(const MBXINIB, _kernel_mbxinib_table);
99 __EMPTY_LABEL(MBXCB, _kernel_mbxcb_table);
100
101
102         /* Object initializer [mempfix] */
103
104 #define TNUM_MPFID 0
105
106 const ID _kernel_tmax_mpfid = (TMIN_MPFID + TNUM_MPFID - 1);
107
108 __EMPTY_LABEL(const MPFINIB, _kernel_mpfinib_table);
109 __EMPTY_LABEL(MPFCB, _kernel_mpfcb_table);
110
111
112         /* Object initializer [cyclic] */
113
114 #define TNUM_CYCID 0
115
116 const ID _kernel_tmax_cycid = (TMIN_CYCID + TNUM_CYCID - 1);
117
118 __EMPTY_LABEL(const CYCINIB, _kernel_cycinib_table);
119 __EMPTY_LABEL(CYCCB, _kernel_cyccb_table);
120
121
122         /* Object initializer [interrupt] */
123
124 #define TNUM_INHNO 5
125
126 const UINT _kernel_tnum_inhno = TNUM_INHNO;
127
128 CFG_INTHDR_ENTRY(sio0_rx_handler);
129 CFG_INTHDR_ENTRY(sio0_tx_handler);
130 CFG_INTHDR_ENTRY(timer_handler);
131 CFG_INTHDR_ENTRY(i2c0_master_handler);
132 CFG_INTHDR_ENTRY(inh_codec_sport);
133
134 const INHINIB _kernel_inhinib_table[TNUM_INHNO] = {
135         {15,0,(FP)CFG_INT_ENTRY(sio0_rx_handler)},
136         {16,0,(FP)CFG_INT_ENTRY(sio0_tx_handler)},
137         {21,0,(FP)CFG_INT_ENTRY(timer_handler)},
138         {24,0,(FP)CFG_INT_ENTRY(i2c0_master_handler)},
139         {INHNO_SPORT0_RX,0,(FP)CFG_INT_ENTRY(inh_codec_sport)}
140 };
141
142
143         /* Object initializer [exception] */
144
145 #define TNUM_EXCNO 0
146
147 const UINT _kernel_tnum_excno = TNUM_EXCNO;
148
149 __EMPTY_LABEL(const EXCINIB, _kernel_excinib_table);
150         /* Initialization handler */
151
152 void
153 _kernel_call_inirtn(void)
154 {
155         timer_initialize( (VP_INT)(0) );
156         serial_initialize( (VP_INT)(0) );
157         i2c_master_initialize( (VP_INT)(0) );
158 }
159
160 void
161 _kernel_call_terrtn(void)
162 {
163         timer_terminate( (VP_INT)(0) );
164 }
165
166         /* Object initialization routine */
167
168 void
169 _kernel_object_initialize(void)
170 {
171         _kernel_task_initialize();
172         _kernel_semaphore_initialize();
173         _kernel_interrupt_initialize();
174 }
175
176 TMEVTN   _kernel_tmevt_heap[TNUM_TSKID + TNUM_CYCID];
177
178         /* Variables for kernel checker */
179 const UW _checker_magic_number = 0x01234567;
180