source: rtems/c/src/lib/libbsp/m68k/mcf5329/startup/init5329.c @ fd0dfd47

4.11
Last change on this file since fd0dfd47 was fd0dfd47, checked in by Joel Sherrill <joel.sherrill@…>, on Oct 17, 2014 at 1:50:11 PM

m68k/mcf5329/startup/init5329.c: Fix warning

  • Property mode set to 100644
File size: 1.4 KB
Line 
1/*
2 *  This is where the real hardware setup is done. A minimal stack
3 *  has been provided by the start.S code. No normal C or RTEMS
4 *  functions can be called from here.
5 */
6
7#include <bsp/bootcard.h>
8
9extern void _wr_vbr(uint32_t);
10extern void init_main(void);
11
12/*
13 * From linkcmds
14 */
15
16extern uint8_t _INTERRUPT_VECTOR[];
17
18extern uint8_t _clear_start[];
19extern uint8_t _clear_end[];
20
21extern uint8_t _data_src_start[];
22extern uint8_t _data_dest_start[];
23extern uint8_t _data_dest_end[];
24
25void Init5329(void)
26{
27  register uint32_t i;
28  register uint8_t *dbp, *sbp;
29  register uint32_t *dp, *sp;
30
31  /*
32   * Initialize the hardware
33   */
34  init_main();
35
36  /*
37   * Copy the vector table to RAM
38   */
39  if (&_VBR != (void *) _INTERRUPT_VECTOR) {
40    sp = (uint32_t *) _INTERRUPT_VECTOR;
41    dp = (uint32_t *) &_VBR;
42    for (i = 0; i < 256; i++) {
43      *dp++ = *sp++;
44    }
45  }
46
47  _wr_vbr((uint32_t) &_VBR);
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  /*
61   * Zero uninitialized data
62   */
63
64  if (_clear_start != _clear_end) {
65    sbp = _clear_start;
66    dbp = _clear_end;
67    i = dbp - sbp;
68    while (i--)
69      *sbp++ = 0;
70  }
71
72  /*
73   * We have to call some kind of RTEMS function here!
74   */
75
76  boot_card(0);
77  for (;;) ;
78}
Note: See TracBrowser for help on using the repository browser.