source: rtems/c/src/lib/libbsp/m68k/mcf5225x/startup/init5225x.c @ 13827524

4.11
Last change on this file since 13827524 was 13827524, checked in by Joel Sherrill <joel.sherrill@…>, on Oct 20, 2014 at 3:58:21 PM

m68k/mcf5225x: Fix warnings

  • Property mode set to 100644
File size: 1.8 KB
RevLine 
[fe32208]1/*
2 *  The license and distribution terms for this file may be
3 *  found in the file LICENSE in this distribution or at
[c499856]4 *  http://www.rtems.org/license/LICENSE.
[fe32208]5 *
6 *  This is where the real hardware setup is done. A minimal stack
7 *  has been provided by the start.S code. No normal C or RTEMS
8 *  functions can be called from here.
9 */
10
[13827524]11#include <bsp.h>
[40fe4b86]12#include <bsp/bootcard.h>
[fe32208]13
14extern void _wr_vbr(uint32_t);
15
16extern long _d0_reset,_d1_reset,_M68kSpuriousInterruptCount;
17
18/*
19 * From linkcmds
20 */
21
22extern uint8_t _INTERRUPT_VECTOR[];
23
24extern uint8_t _clear_start[];
25extern uint8_t _clear_end[];
26
27extern uint8_t _data_src_start[];
28extern uint8_t _data_dest_start[];
29extern uint8_t _data_dest_end[];
30
31void Init5225x(void)
32{
33  register uint32_t i;
34  register uint32_t *dp, *sp;
35  register uint8_t *dbp, *sbp;
36
37  /*
38   * Copy the vector table to RAM
39   */
40
[d9c12bb]41  if (&_VBR != (void *)_INTERRUPT_VECTOR) {
[fe32208]42    sp = (uint32_t *) _INTERRUPT_VECTOR;
[40fe4b86]43    dp = (uint32_t *) &_VBR;
[fe32208]44    for (i = 0; i < 256; i++) {
45      *dp++ = *sp++;
46    }
47  }
48
49  /*
50   * Move initialized data from ROM to RAM.
51   */
52  if (_data_src_start != _data_dest_start) {
53    dbp = (uint8_t *) _data_dest_start;
54    sbp = (uint8_t *) _data_src_start;
55    i = _data_dest_end - _data_dest_start;
56    while (i--)
57      *dbp++ = *sbp++;
58  }
59
60        asm __volatile__ ("move.l %%d5,%0\n\t":"=r" (_d0_reset));
61        asm __volatile__ ("move.l %%d6,%0\n\t":"=r" (_d1_reset));
62 
63  /*
64   * Zero uninitialized data
65   */
66
67  if (_clear_start != _clear_end) {
68    sbp = _clear_start;
69    dbp = _clear_end;
70    i = dbp - sbp;
71    while (i--)
72      *sbp++ = 0;
73  }
74
[40fe4b86]75//_wr_vbr((uint32_t) &_VBR);
76        asm volatile("move.l %0,%%d7;movec %%d7,%%vbr\n\t"::"i"(&_VBR): "cc");
[fe32208]77
78  /*
79   * We have to call some kind of RTEMS function here!
80   */
81
[40fe4b86]82  boot_card(0);
[fe32208]83  for (;;) ;
84}
Note: See TracBrowser for help on using the repository browser.