1 Index: rtems/c/src/lib/libbsp/arm/csb336/times
2 ===================================================================
3 --- rtems/c/src/lib/libbsp/arm/csb336/times (revision 42)
4 +++ rtems/c/src/lib/libbsp/arm/csb336/times (working copy)
8 == ==================================================================== ===
9 - 1 rtems_semaphore_create 16
10 - 1 rtems_semaphore_delete 17
11 - 1 rtems_semaphore_obtain: available 2
12 - 1 rtems_semaphore_obtain: not available -- NO_WAIT 2
13 - 1 rtems_semaphore_release: no waiting tasks 5
14 + 1 rtems_semaphore_create 15
15 + 1 rtems_semaphore_delete 15
16 + 1 rtems_semaphore_obtain: available 0
17 + 1 rtems_semaphore_obtain: not available -- NO_WAIT 0
18 + 1 rtems_semaphore_release: no waiting tasks 0
20 - 2 rtems_semaphore_obtain: not available -- caller blocks 20
21 + 2 rtems_semaphore_obtain: not available -- caller blocks 12
23 - 3 rtems_semaphore_release: task readied -- preempts caller 16
24 + 3 rtems_semaphore_release: task readied -- preempts caller 11
26 - 4 rtems_task_restart: blocked task -- preempts caller 48
27 - 4 rtems_task_restart: ready task -- preempts caller 36
28 - 4 rtems_semaphore_release: task readied -- returns to caller 9
29 - 4 rtems_task_create 33
30 - 4 rtems_task_start 12
31 - 4 rtems_task_restart: suspended task -- returns to caller 14
32 - 4 rtems_task_delete: suspended task 31
33 - 4 rtems_task_restart: ready task -- returns to caller 14
34 - 4 rtems_task_restart: blocked task -- returns to caller 19
35 - 4 rtems_task_delete: blocked task 32
36 + 4 rtems_task_restart: blocked task -- preempts caller 38
37 + 4 rtems_task_restart: ready task -- preempts caller 29
38 + 4 rtems_semaphore_release: task readied -- returns to caller 5
39 + 4 rtems_task_create 24
40 + 4 rtems_task_start 8
41 + 4 rtems_task_restart: suspended task -- returns to caller 9
42 + 4 rtems_task_delete: suspended task 20
43 + 4 rtems_task_restart: ready task -- returns to caller 10
44 + 4 rtems_task_restart: blocked task -- returns to caller 11
45 + 4 rtems_task_delete: blocked task 21
47 - 5 rtems_task_suspend: calling task 14
48 - 5 rtems_task_resume: task readied -- preempts caller 12
49 + 5 rtems_task_suspend: calling task 9
50 + 5 rtems_task_resume: task readied -- preempts caller 8
52 - 6 rtems_task_restart: calling task 14
53 - 6 rtems_task_suspend: returns to caller 6
54 - 6 rtems_task_resume: task readied -- returns to caller 6
55 - 6 rtems_task_delete: ready task 32
56 + 6 rtems_task_restart: calling task 8
57 + 6 rtems_task_suspend: returns to caller 3
58 + 6 rtems_task_resume: task readied -- returns to caller 3
59 + 6 rtems_task_delete: ready task 22
61 - 7 rtems_task_restart: suspended task -- preempts caller 24
62 + 7 rtems_task_restart: suspended task -- preempts caller 14
64 - 8 rtems_task_set_priority: obtain current priority 4
65 - 8 rtems_task_set_priority: returns to caller 8
66 - 8 rtems_task_mode: obtain current mode 2
67 - 8 rtems_task_mode: no reschedule 2
68 - 8 rtems_task_mode: reschedule -- returns to caller 4
69 - 8 rtems_task_mode: reschedule -- preempts caller 19
70 - 8 rtems_task_set_note 4
71 - 8 rtems_task_get_note 4
73 + 8 rtems_task_set_priority: obtain current priority 1
74 + 8 rtems_task_set_priority: returns to caller 3
75 + 8 rtems_task_mode: obtain current mode 0
76 + 8 rtems_task_mode: no reschedule 0
77 + 8 rtems_task_mode: reschedule -- returns to caller 3
78 + 8 rtems_task_mode: reschedule -- preempts caller 13
79 + 8 rtems_task_set_note 1
80 + 8 rtems_task_get_note 1
84 - 9 rtems_message_queue_create 54
85 - 9 rtems_message_queue_send: no waiting tasks 8
86 - 9 rtems_message_queue_urgent: no waiting tasks 8
87 - 9 rtems_message_queue_receive: available 7
88 - 9 rtems_message_queue_flush: no messages flushed 4
89 - 9 rtems_message_queue_flush: messages flushed 5
90 - 9 rtems_message_queue_delete 21
91 + 9 rtems_message_queue_create 38
92 + 9 rtems_message_queue_send: no waiting tasks 4
93 + 9 rtems_message_queue_urgent: no waiting tasks 4
94 + 9 rtems_message_queue_receive: available 4
95 + 9 rtems_message_queue_flush: no messages flushed 2
96 + 9 rtems_message_queue_flush: messages flushed 3
97 + 9 rtems_message_queue_delete 19
99 -10 rtems_message_queue_receive: not available -- NO_WAIT 4
100 -10 rtems_message_queue_receive: not available -- caller blocks 20
101 +10 rtems_message_queue_receive: not available -- NO_WAIT 2
102 +10 rtems_message_queue_receive: not available -- caller blocks 12
104 -11 rtems_message_queue_send: task readied -- preempts caller 18
105 +11 rtems_message_queue_send: task readied -- preempts caller 13
107 -12 rtems_message_queue_send: task readied -- returns to caller 11
108 +12 rtems_message_queue_send: task readied -- returns to caller 7
110 -13 rtems_message_queue_urgent: task readied -- preempts caller 19
111 +13 rtems_message_queue_urgent: task readied -- preempts caller 13
113 -14 rtems_message_queue_urgent: task readied -- returns to caller 11
114 +14 rtems_message_queue_urgent: task readied -- returns to caller 7
116 15 rtems_event_receive: obtain current events 0
117 -15 rtems_event_receive: not available -- NO_WAIT 3
118 -15 rtems_event_receive: not available -- caller blocks 17
119 -15 rtems_event_send: no task readied 3
120 -15 rtems_event_receive: available 5
121 -15 rtems_event_send: task readied -- returns to caller 10
122 +15 rtems_event_receive: not available -- NO_WAIT 1
123 +15 rtems_event_receive: not available -- caller blocks 11
124 +15 rtems_event_send: no task readied 1
125 +15 rtems_event_receive: available 3
126 +15 rtems_event_send: task readied -- returns to caller 7
128 -16 rtems_event_send: task readied -- preempts caller 16
129 +16 rtems_event_send: task readied -- preempts caller 12
131 -17 rtems_task_set_priority: preempts caller 19
132 +17 rtems_task_set_priority: preempts caller 13
134 -18 rtems_task_delete: calling task 41
135 +18 rtems_task_delete: calling task 26
137 -19 rtems_signal_catch 6
138 -19 rtems_signal_send: returns to caller 15
139 -19 rtems_signal_send: signal to self 25
140 -19 exit ASR overhead: returns to calling task 11
141 -19 exit ASR overhead: returns to preempting task 12
142 +19 rtems_signal_catch 5
143 +19 rtems_signal_send: returns to caller 12
144 +19 rtems_signal_send: signal to self 19
145 +19 exit ASR overhead: returns to calling task 7
146 +19 exit ASR overhead: returns to preempting task 10
148 -20 rtems_partition_create 22
149 -20 rtems_region_create 30
150 -20 rtems_partition_get_buffer: available 10
151 -20 rtems_partition_get_buffer: not available 4
152 -20 rtems_partition_return_buffer 9
153 -20 rtems_partition_delete 10
154 -20 rtems_region_get_segment: available 15
155 -20 rtems_region_get_segment: not available -- NO_WAIT 16
156 -20 rtems_region_return_segment: no waiting tasks 13
157 -20 rtems_region_get_segment: not available -- caller blocks 47
158 -20 rtems_region_return_segment: task readied -- preempts caller 45
159 -20 rtems_region_return_segment: task readied -- returns to caller 25
160 -20 rtems_region_delete 23
161 -20 rtems_io_initialize 1
162 +20 rtems_partition_create 21
163 +20 rtems_region_create 33
164 +20 rtems_partition_get_buffer: available 9
165 +20 rtems_partition_get_buffer: not available 3
166 +20 rtems_partition_return_buffer 8
167 +20 rtems_partition_delete 8
168 +20 rtems_region_get_segment: available 7
169 +20 rtems_region_get_segment: not available -- NO_WAIT 7
170 +20 rtems_region_return_segment: no waiting tasks 6
171 +20 rtems_region_get_segment: not available -- caller blocks 36
172 +20 rtems_region_return_segment: task readied -- preempts caller 33
173 +20 rtems_region_return_segment: task readied -- returns to caller 13
174 +20 rtems_region_delete 18
175 +20 rtems_io_initialize 0
180 20 rtems_io_control 0
182 -21 rtems_task_ident 39
183 -21 rtems_message_queue_ident 38
184 -21 rtems_semaphore_ident 43
185 -21 rtems_partition_ident 38
186 -21 rtems_region_ident 38
187 -21 rtems_port_ident 37
188 -21 rtems_timer_ident 38
189 -21 rtems_rate_monotonic_ident 38
190 +21 rtems_task_ident 8
191 +21 rtems_message_queue_ident 8
192 +21 rtems_semaphore_ident 9
193 +21 rtems_partition_ident 8
194 +21 rtems_region_ident 8
195 +21 rtems_port_ident 8
196 +21 rtems_timer_ident 8
197 +21 rtems_rate_monotonic_ident 8
199 22 rtems_message_queue_broadcast: task readied -- returns to caller 27
200 -22 rtems_message_queue_broadcast: no waiting tasks 6
201 -22 rtems_message_queue_broadcast: task readied -- preempts caller 22
202 +22 rtems_message_queue_broadcast: no waiting tasks 2
203 +22 rtems_message_queue_broadcast: task readied -- preempts caller 16
205 -23 rtems_timer_create 4
206 -23 rtems_timer_fire_after: inactive 7
207 -23 rtems_timer_fire_after: active 7
208 -23 rtems_timer_cancel: active 4
209 -23 rtems_timer_cancel: inactive 3
210 -23 rtems_timer_reset: inactive 6
211 -23 rtems_timer_reset: active 7
212 -23 rtems_timer_fire_when: inactive 9
213 -23 rtems_timer_fire_when: active 9
214 -23 rtems_timer_delete: active 5
215 -23 rtems_timer_delete: inactive 4
216 -23 rtems_task_wake_when 21
217 +23 rtems_timer_create 3
218 +23 rtems_timer_fire_after: inactive 4
219 +23 rtems_timer_fire_after: active 4
220 +23 rtems_timer_cancel: active 2
221 +23 rtems_timer_cancel: inactive 1
222 +23 rtems_timer_reset: inactive 3
223 +23 rtems_timer_reset: active 3
224 +23 rtems_timer_fire_when: inactive 4
225 +23 rtems_timer_fire_when: active 4
226 +23 rtems_timer_delete: active 3
227 +23 rtems_timer_delete: inactive 3
228 +23 rtems_task_wake_when 12
230 -24 rtems_task_wake_after: yield -- returns to caller 2
231 -24 rtems_task_wake_after: yields -- preempts caller 12
232 +24 rtems_task_wake_after: yield -- returns to caller 1
233 +24 rtems_task_wake_after: yields -- preempts caller 9
235 -25 rtems_clock_tick 13
236 +25 rtems_clock_tick 10
242 26 _Thread_Disable_dispatch 1
243 26 _Thread_Enable_dispatch 3
244 26 _Thread_Set_state 6
245 -26 _Thread_Disptach (NO FP) 13
246 -26 context switch: no floating point contexts 10
247 +26 _Thread_Disptach (NO FP) 9
248 +26 context switch: no floating point contexts 7
249 26 context switch: self 1
250 26 context switch: to another task 2
251 26 fp context switch: restore 1st FP task - NA
252 26 fp context switch: save idle, restore initialized - NA
253 26 fp context switch: save idle, restore idle - NA
254 26 fp context switch: save initialized, restore initialized - NA
256 -26 _Thread_Unblock 8
260 +26 _Thread_Unblock 7
264 26 _Thread_Get: invalid id 0
266 @@ -175,15 +175,15 @@
267 27 interrupt entry overhead: returns to nested interrupt 0
268 27 interrupt exit overhead: returns to nested interrupt 0
270 -28 rtems_port_create 13
271 -28 rtems_port_external_to_internal 3
272 -28 rtems_port_internal_to_external 3
273 -28 rtems_port_delete 11
274 +28 rtems_port_create 10
275 +28 rtems_port_external_to_internal 1
276 +28 rtems_port_internal_to_external 1
277 +28 rtems_port_delete 8
279 -29 rtems_rate_monotonic_create 13
280 -29 rtems_rate_monotonic_period: initiate period -- returns to caller 24
281 -29 rtems_rate_monotonic_period: obtain status 5
282 -29 rtems_rate_monotonic_cancel 15
283 +29 rtems_rate_monotonic_create 12
284 +29 rtems_rate_monotonic_period: initiate period -- returns to caller 17
285 +29 rtems_rate_monotonic_period: obtain status 3
286 +29 rtems_rate_monotonic_cancel 12
287 29 rtems_rate_monotonic_delete: inactive 12
288 -29 rtems_rate_monotonic_delete: active 7
289 -29 rtems_rate_monotonic_period: conclude periods -- caller blocks 13
290 +29 rtems_rate_monotonic_delete: active 4
291 +29 rtems_rate_monotonic_period: conclude periods -- caller blocks 9
292 Index: rtems/c/src/lib/libbsp/arm/csb336/startup/bspstart.c
293 ===================================================================
294 --- rtems/c/src/lib/libbsp/arm/csb336/startup/bspstart.c (revision 42)
295 +++ rtems/c/src/lib/libbsp/arm/csb336/startup/bspstart.c (working copy)
296 @@ -153,12 +169,12 @@
297 /* Calcuate the frequency for perclk1 */
298 int get_perclk1_freq(void)
315 @@ -187,13 +203,14 @@
316 printk("mfd = %d\n", mfd);
317 printk("mfi = %d\n", mfi);
318 printk("mfn = %d\n", mfn);
319 - printk("(fin * mfi) / (pd + 1) = %d\n", (fin * mfi) / (pd + 1));
320 - printk("(fin * mfn) / ((pd + 1) * (mfd + 1)) = %d\n",
321 - (fin * mfn) / ((pd + 1) * (mfd + 1)));
322 + printk("rounded (fin * mfi) / (pd + 1) = %d\n", (fin * mfi) / (pd + 1));
323 + printk("rounded (fin * mfn) / ((pd + 1) * (mfd + 1)) = %d\n",
324 + ((long long)fin * mfn) / ((pd + 1) * (mfd + 1)));
327 - fpll = 2 * ( ((fin * mfi) / (pd + 1)) +
328 - ((fin * mfn) / ((pd + 1) * (mfd + 1))) );
329 + fpll = 2 * ( ((fin * mfi + (pd + 1) / 2) / (pd + 1)) +
330 + (((long long)fin * mfn + ((pd + 1) * (mfd + 1)) / 2) /
331 + ((pd + 1) * (mfd + 1))) );
333 /* calculate the output of the PERCLK1 divider */
334 reg = MC9328MXL_PLL_PCDR;
335 Index: rtems/c/src/lib/libbsp/arm/csb336/startup/linkcmds
336 ===================================================================
337 --- rtems/c/src/lib/libbsp/arm/csb336/startup/linkcmds (revision 42)
338 +++ rtems/c/src/lib/libbsp/arm/csb336/startup/linkcmds (working copy)
340 rtems_vector_table = .;
341 . += (8 * 4); /* 8 ARM interrupts */
343 - bsp_vector_table = .;
344 - . += (64 * 4); /* 64 MC9328MXL interrupts */
349 Index: rtems/c/src/lib/libbsp/arm/csb336/startup/exit.c
350 ===================================================================
351 --- rtems/c/src/lib/libbsp/arm/csb336/startup/exit.c (revision 42)
352 +++ rtems/c/src/lib/libbsp/arm/csb336/startup/exit.c (working copy)
357 - while (uart_poll_read(0) < 0) continue;
358 + while (BSP_poll_char() < 0) continue;
362 Index: rtems/c/src/lib/libbsp/arm/csb336/network/network.c
363 ===================================================================
364 --- rtems/c/src/lib/libbsp/arm/csb336/network/network.c (revision 42)
365 +++ rtems/c/src/lib/libbsp/arm/csb336/network/network.c (working copy)
367 /* RTEMS event used to start transmit daemon. */
368 #define START_TRANSMIT_EVENT RTEMS_EVENT_2
370 -static rtems_isr enet_isr(rtems_vector_number vector);
371 +static void enet_isr(rtems_irq_hdl_param);
372 static void enet_isr_on(const rtems_irq_connect_data *unused);
373 static void enet_isr_off(const rtems_irq_connect_data *unused);
374 static int enet_isr_is_on(const rtems_irq_connect_data *irq);
376 /* Replace the first value with the clock's interrupt name. */
377 -rtems_irq_connect_data mc9328mxl_enet_isr_data = {BSP_INT_GPIO_PORTA,
378 - (rtems_irq_hdl)enet_isr,
382 - 3, /* unused for ARM */
383 - 0 }; /* unused for ARM */
385 +rtems_irq_connect_data mc9328mxl_enet_isr_data = {
386 + .name = BSP_INT_GPIO_PORTA,
387 + .hdl = (rtems_irq_hdl)enet_isr,
388 + .handle = (void *)BSP_INT_GPIO_PORTA,
390 + .off = enet_isr_off,
391 + .isOn = enet_isr_is_on,
394 unsigned long rx_packets; /* total packets received */
395 unsigned long tx_packets; /* total packets transmitted */
397 void mc9328mxl_enet_sendpacket (struct ifnet *ifp, struct mbuf *m);
398 void mc9328mxl_enet_rx_task(void *arg);
399 void mc9328mxl_enet_stats(mc9328mxl_enet_softc_t *sc);
400 -static int mc9328mxl_enet_ioctl(struct ifnet *ifp, int command, caddr_t data);
401 +static int mc9328mxl_enet_ioctl(struct ifnet *ifp,
402 + unsigned long command, caddr_t data);
405 int rtems_mc9328mxl_enet_attach (
408 /* Driver ioctl handler */
410 -mc9328mxl_enet_ioctl (struct ifnet *ifp, int command, caddr_t data)
411 +mc9328mxl_enet_ioctl (struct ifnet *ifp, unsigned long command, caddr_t data)
413 mc9328mxl_enet_softc_t *sc = ifp->if_softc;
418 /* interrupt handler */
419 -rtems_isr enet_isr (rtems_vector_number v)
420 +static void enet_isr(rtems_irq_hdl_param unused)
424 Index: rtems/c/src/lib/libbsp/arm/shared/irq/irq_init.c
425 ===================================================================
426 --- rtems/c/src/lib/libbsp/arm/shared/irq/irq_init.c (revision 42)
427 +++ rtems/c/src/lib/libbsp/arm/shared/irq/irq_init.c (working copy)
429 void rtems_irq_mngt_init()
433 rtems_interrupt_level level;
435 - vectorTable = (long *) VECTOR_TABLE;
437 _CPU_ISR_Disable(level);
439 /* First, connect the ISR_Handler for IRQ and FIQ interrupts */
440 _CPU_ISR_install_vector(ARM_EXCEPTION_IRQ, _ISR_Handler, NULL);
441 _CPU_ISR_install_vector(ARM_EXCEPTION_FIQ, _ISR_Handler, NULL);
443 - /* Initialize the vector table contents with default handler */
444 - for (i=0; i<BSP_MAX_INT; i++)
445 - *(vectorTable + i) = (long)(default_int_handler);
447 /* Initialize the INT at the BSP level */
448 BSP_rtems_irq_mngt_init();
450 Index: rtems/c/src/lib/libbsp/arm/edb7312/irq/bsp_irq_init.c
451 ===================================================================
452 --- rtems/c/src/lib/libbsp/arm/edb7312/irq/bsp_irq_init.c (revision 42)
453 +++ rtems/c/src/lib/libbsp/arm/edb7312/irq/bsp_irq_init.c (working copy)
455 void BSP_rtems_irq_mngt_init()
461 + vectorTable = (long *) VECTOR_TABLE;
463 + /* Initialize the vector table contents with default handler */
464 + for (i=0; i<BSP_MAX_INT; i++) {
465 + *(vectorTable + i) = (long)(default_int_handler);
468 /* mask all interrupts */
469 *EP7312_INTMR1 = 0x0;
470 *EP7312_INTMR2 = 0x0;
471 Index: rtems/c/src/lib/libbsp/arm/gba/irq/bsp_irq_init.c
472 ===================================================================
473 --- rtems/c/src/lib/libbsp/arm/gba/irq/bsp_irq_init.c (revision 42)
474 +++ rtems/c/src/lib/libbsp/arm/gba/irq/bsp_irq_init.c (working copy)
477 void BSP_rtems_irq_mngt_init(void)
482 + vectorTable = (long *) VECTOR_TABLE;
484 + /* Initialize the vector table contents with default handler */
485 + for (i=0; i<BSP_MAX_INT; i++) {
486 + *(vectorTable + i) = (long)(default_int_handler);
489 /* clear all interrupt status flags */
491 /* disable all interrupts */
492 Index: rtems/c/src/lib/libcpu/arm/mc9328mxl/include/mc9328mxl.h
493 ===================================================================
494 --- rtems/c/src/lib/libcpu/arm/mc9328mxl/include/mc9328mxl.h (revision 42)
495 +++ rtems/c/src/lib/libcpu/arm/mc9328mxl/include/mc9328mxl.h (working copy)
497 #define MC9328MXL_UART2_MPR4 (*((volatile uint32_t *)((MC9328MXL_UART2_BASE) + 0xcc)))
498 #define MC9328MXL_UART2_TS (*((volatile uint32_t *)((MC9328MXL_UART2_BASE) + 0xd0)))
501 + volatile uint32_t rxd;
502 + volatile uint32_t _res0[15];
503 + volatile uint32_t txd;
504 + volatile uint32_t _res1[15];
505 + volatile uint32_t cr1;
506 + volatile uint32_t cr2;
507 + volatile uint32_t cr3;
508 + volatile uint32_t cr4;
509 + volatile uint32_t fcr;
510 + volatile uint32_t sr1;
511 + volatile uint32_t sr2;
512 + volatile uint32_t esc;
513 + volatile uint32_t tim;
514 + volatile uint32_t bir;
515 + volatile uint32_t bmr;
516 + volatile uint32_t brc;
517 + volatile uint32_t ipr1;
518 + volatile uint32_t ipr2;
519 + volatile uint32_t ipr3;
520 + volatile uint32_t ipr4;
521 + volatile uint32_t mpr1;
522 + volatile uint32_t mpr2;
523 + volatile uint32_t mpr3;
524 + volatile uint32_t mpr4;
525 + volatile uint32_t ts;
526 +} mc9328mxl_uart_regs_t;
528 #define MC9328MXL_UART_RXD_CHARRDY (bit(15))
529 #define MC9328MXL_UART_RXD_ERR (bit(14))
531 #define MC9328MXL_UART_CR4_OREN (bit(1))
532 #define MC9328MXL_UART_CR4_DREN (bit(0))
534 +#define MC9328MXL_UART_FCR_TXTL(x) (((x) & 0x3f) << 10)
535 +#define MC9328MXL_UART_FCR_RFDIV_1 (5 << 7)
536 +#define MC9328MXL_UART_FCR_RFDIV_2 (4 << 7)
537 +#define MC9328MXL_UART_FCR_RFDIV_3 (3 << 7)
538 +#define MC9328MXL_UART_FCR_RFDIV_4 (2 << 7)
539 +#define MC9328MXL_UART_FCR_RFDIV_5 (1 << 7)
540 +#define MC9328MXL_UART_FCR_RFDIV_6 (0 << 7)
541 +#define MC9328MXL_UART_FCR_RFDIV_7 (6 << 7)
542 +#define MC9328MXL_UART_FCR_RFDIV_MASK (7 << 7)
543 +#define MC9328MXL_UART_FCR_RXTL(x) (((x) & 0x3f) << 0)
545 #define MC9328MXL_UART_SR1_PARERR (bit(15))
546 #define MC9328MXL_UART_SR1_RTSS (bit(14))
547 #define MC9328MXL_UART_SR1_TRDY (bit(13))
548 Index: rtems/c/src/lib/libcpu/arm/mc9328mxl/clock/clockdrv.c
549 ===================================================================
550 --- rtems/c/src/lib/libcpu/arm/mc9328mxl/clock/clockdrv.c (revision 42)
551 +++ rtems/c/src/lib/libcpu/arm/mc9328mxl/clock/clockdrv.c (working copy)
553 static int clock_isr_is_on(const rtems_irq_connect_data *irq);
555 /* Replace the first value with the clock's interrupt name. */
556 -rtems_irq_connect_data clock_isr_data = {BSP_INT_TIMER1,
557 - (rtems_irq_hdl)Clock_isr,
561 - 3, /* unused for ARM cpus */
562 - 0 }; /* unused for ARM cpus */
563 +rtems_irq_connect_data clock_isr_data = {
564 + .name = BSP_INT_TIMER1,
565 + .hdl = (rtems_irq_hdl)Clock_isr,
566 + .handle = (void *)BSP_INT_TIMER1,
567 + .on = clock_isr_on,
568 + .off = clock_isr_off,
569 + .isOn = clock_isr_is_on,
572 /* If you follow the code, this is never used, so any value
576 freq = get_perclk1_freq(); \
577 printk("perclk1 freq is %d\n", freq); \
578 - cnt = ((freq / 1000) * BSP_Configuration.microseconds_per_tick) / 1000;\
579 + cnt = ((long long)freq * BSP_Configuration.microseconds_per_tick + 500000) / 1000000;\
580 printk("cnt freq is %d\n", cnt); \
581 MC9328MXL_TMR1_TCMP = cnt; \
582 /* use PERCLK1 as input, enable timer */ \
583 Index: rtems/c/src/lib/libcpu/arm/mc9328mxl/irq/bsp_irq_asm.S
584 ===================================================================
585 --- rtems/c/src/lib/libcpu/arm/mc9328mxl/irq/bsp_irq_asm.S (revision 42)
586 +++ rtems/c/src/lib/libcpu/arm/mc9328mxl/irq/bsp_irq_asm.S (working copy)
589 /* find the ISR's address based on the vector */
590 ldr r0, =bsp_vector_table
591 - ldr r0, [r0, r1, LSL #2] /* Read the address */
592 + mov r1, r1, LSL #3 /* Shift vector to get offset into table */
593 + add r1, r0, r1 /* r1 has address of vector entry */
594 + ldr r0, [r1, #4] /* Get the data pointer */
595 + ldr r1, [r1] /* Get the vector */
599 ldr lr, =IRQ_return /* prepare the return from handler */
601 - mov pc, r0 /* EXECUTE INT HANDLER */
602 + mov pc, r1 /* EXECUTE INT HANDLER */
606 Index: rtems/c/src/lib/libcpu/arm/mc9328mxl/irq/irq.h
607 ===================================================================
608 --- rtems/c/src/lib/libcpu/arm/mc9328mxl/irq/irq.h (revision 42)
609 +++ rtems/c/src/lib/libcpu/arm/mc9328mxl/irq/irq.h (working copy)
614 +#include <rtems/irq.h>
621 **********************************************************************/
623 -/* possible interrupt sources on the AT91RM9200 */
624 +/* possible interrupt sources on the MC9328MXL */
625 #define BSP_INT_UART3_PFERR 0
626 #define BSP_INT_UART3_RTS 1
627 #define BSP_INT_UART3_DTR 2
628 @@ -101,64 +103,21 @@
629 #define BSP_INT_WDT 63
630 #define BSP_MAX_INT 64
632 -typedef unsigned char rtems_irq_level;
633 -typedef unsigned char rtems_irq_trigger;
635 + rtems_irq_hdl vector;
636 + rtems_irq_hdl_param data;
637 +} mc9328mxl_irq_info_t;
639 -typedef unsigned int rtems_irq_number;
640 -struct __rtems_irq_connect_data__; /* forward declaratiuon */
642 -typedef void (*rtems_irq_hdl) (void);
643 -typedef void (*rtems_irq_enable) (const struct __rtems_irq_connect_data__*);
644 -typedef void (*rtems_irq_disable) (const struct __rtems_irq_connect_data__*);
645 -typedef int (*rtems_irq_is_enabled)(const struct __rtems_irq_connect_data__*);
647 -extern rtems_irq_hdl bsp_vector_table[BSP_MAX_INT];
648 -#define VECTOR_TABLE bsp_vector_table
650 -typedef struct __rtems_irq_connect_data__ {
652 - rtems_irq_number name;
653 +extern mc9328mxl_irq_info_t bsp_vector_table[BSP_MAX_INT];
658 - /* function for enabling interrupts at device level. */
659 - rtems_irq_enable on;
661 - /* function for disabling interrupts at device level. */
662 - rtems_irq_disable off;
664 - /* Function to test if interrupt is enabled */
665 - rtems_irq_is_enabled isOn;
667 - /* priority level of interrupt */
668 - rtems_irq_level irqLevel;
670 - /* Trigger method (rising/falling edge or high/low level) */
671 - rtems_irq_trigger irqTrigger;
672 -} rtems_irq_connect_data;
675 * function to initialize the interrupt for a specific BSP
677 void BSP_rtems_irq_mngt_init();
681 - * function to connect a particular irq handler.
683 -int BSP_install_rtems_irq_handler (const rtems_irq_connect_data*);
686 - * function to get the current RTEMS irq handler for ptr->name.
688 -int BSP_get_current_rtems_irq_handler (rtems_irq_connect_data* ptr);
691 - * function to disconnect the RTEMS irq handler for ptr->name.
693 -int BSP_remove_rtems_irq_handler (const rtems_irq_connect_data*);
698 Index: rtems/c/src/lib/libcpu/arm/mc9328mxl/irq/bsp_irq_init.c
699 ===================================================================
700 --- rtems/c/src/lib/libcpu/arm/mc9328mxl/irq/bsp_irq_init.c (revision 42)
701 +++ rtems/c/src/lib/libcpu/arm/mc9328mxl/irq/bsp_irq_init.c (working copy)
704 void BSP_rtems_irq_mngt_init()
707 - /* disable all interrupts */
708 - AIC_CTL_REG(AIC_IDCR) = 0xffffffff;
712 + for (i = 0; i < BSP_MAX_INT; i++) {
713 + bsp_vector_table[i].vector = default_int_handler;
714 + bsp_vector_table[i].data = NULL;
718 Index: rtems/c/src/lib/libcpu/arm/mc9328mxl/irq/irq.c
719 ===================================================================
720 --- rtems/c/src/lib/libcpu/arm/mc9328mxl/irq/irq.c (revision 42)
721 +++ rtems/c/src/lib/libcpu/arm/mc9328mxl/irq/irq.c (working copy)
723 #include <rtems/score/apiext.h>
724 #include <mc9328mxl.h>
726 +mc9328mxl_irq_info_t bsp_vector_table[BSP_MAX_INT];
729 * This function check that the value given for the irq line
732 int BSP_install_rtems_irq_handler (const rtems_irq_connect_data* irq)
734 rtems_interrupt_level level;
735 - rtems_irq_hdl *bsp_tbl;
737 - bsp_tbl = (rtems_irq_hdl *)&bsp_vector_table;
739 if (!isValidInterrupt(irq->name)) {
743 * Check if default handler is actually connected. If not issue an error.
745 - if (bsp_tbl[irq->name] != default_int_handler) {
747 + if (bsp_vector_table[irq->name].vector != default_int_handler) {
751 _CPU_ISR_Disable(level);
754 * store the new handler
756 - bsp_tbl[irq->name] = irq->hdl;
757 + bsp_vector_table[irq->name].vector = irq->hdl;
758 + bsp_vector_table[irq->name].data = irq->handle;
761 * Enable interrupt on device
763 int BSP_remove_rtems_irq_handler (const rtems_irq_connect_data* irq)
765 rtems_interrupt_level level;
766 - rtems_irq_hdl *bsp_tbl;
768 - bsp_tbl = (rtems_irq_hdl *)&bsp_vector_table;
770 if (!isValidInterrupt(irq->name)) {
774 * Check if the handler is actually connected. If not issue an error.
776 - if (bsp_tbl[irq->name] != irq->hdl) {
778 + if (bsp_vector_table[irq->name].vector != irq->hdl) {
782 _CPU_ISR_Disable(level);
785 * restore the default irq value
787 - bsp_tbl[irq->name] = default_int_handler;
789 + bsp_vector_table[irq->name].vector = default_int_handler;
790 + bsp_vector_table[irq->name].data = NULL;
792 _CPU_ISR_Enable(level);
794 Index: rtems/c/src/lib/libcpu/arm/shared/arm920/mmu.c
795 ===================================================================
796 --- rtems/c/src/lib/libcpu/arm/shared/arm920/mmu.c (revision 42)
797 +++ rtems/c/src/lib/libcpu/arm/shared/arm920/mmu.c (working copy)
799 static inline uint32_t mmu_get_ctrl(void)
802 - asm volatile ("msr 15, 0, %0, cr1, cr0\n" : "=r" (val));
803 + asm volatile ("mrc 15, 0, %0, cr1, cr0\n" : "=r" (val));
808 base[i] = MMU_SET_LVL1_INVAL;
813 +void mmu_set_cpu_async_mode(void)
816 + reg = mmu_get_ctrl();
821 Index: rtems/c/src/lib/libcpu/arm/at91rm9200/irq/bsp_irq_init.c
822 ===================================================================
823 --- rtems/c/src/lib/libcpu/arm/at91rm9200/irq/bsp_irq_init.c (revision 42)
824 +++ rtems/c/src/lib/libcpu/arm/at91rm9200/irq/bsp_irq_init.c (working copy)
827 void BSP_rtems_irq_mngt_init()
832 + vectorTable = (long *) VECTOR_TABLE;
834 + /* Initialize the vector table contents with default handler */
835 + for (i=0; i<BSP_MAX_INT; i++) {
836 + *(vectorTable + i) = (long)(default_int_handler);
839 /* disable all interrupts */
840 AIC_CTL_REG(AIC_IDCR) = 0xffffffff;
842 Index: rtems/c/src/lib/libcpu/arm/s3c2400/irq/bsp_irq_init.c
843 ===================================================================
844 --- rtems/c/src/lib/libcpu/arm/s3c2400/irq/bsp_irq_init.c (revision 42)
845 +++ rtems/c/src/lib/libcpu/arm/s3c2400/irq/bsp_irq_init.c (working copy)
848 void BSP_rtems_irq_mngt_init()
853 + vectorTable = (long *) VECTOR_TABLE;
855 + /* Initialize the vector table contents with default handler */
856 + for (i=0; i<BSP_MAX_INT; i++) {
857 + *(vectorTable + i) = (long)(default_int_handler);
861 * Here is the code to initialize the INT for
863 Index: rtems/make/custom/csb336.cfg
864 ===================================================================
865 --- rtems/make/custom/csb336.cfg (revision 42)
866 +++ rtems/make/custom/csb336.cfg (working copy)
868 # -O4 is ok for RTEMS
869 # NOTE2: some level of -O may be actually required by inline assembler (at least
871 -CFLAGS_OPTIMIZE_V=-O3
872 +CFLAGS_OPTIMIZE_V=-O3 -g
873 #CFLAGS_OPTIMIZE_V=-O4 -mmultiple -mstring -mstrict-align
875 # debug flags: typically none, but at least -O1 is required due to this
876 # BSP using inlined code
877 -CFLAGS_DEBUG_V = -O1
878 +CFLAGS_DEBUG_V = -O1 -g
879 #CFLAGS_DEBUG_V = -O1 -mmultiple -mstring -mstrict-align