source: rtems/c/src/lib/libbsp/m68k/mcf52235/startup/init52235.c @ a840853

4.104.114.9
Last change on this file since a840853 was a840853, checked in by Ralf Corsepius <ralf.corsepius@…>, on Aug 19, 2008 at 11:25:05 AM

Add missing prototypes.

  • Property mode set to 100644
File size: 1.5 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 <stdint.h>
8
9extern void _wr_vbr(uint32_t);
10extern void init_main(void);
11extern int boot_card(int, char **, char **);
12
13/*
14 * From linkcmds
15 */
16
17extern uint8_t _VBR[];
18extern uint8_t _INTERRUPT_VECTOR[];
19
20extern uint8_t _clear_start[];
21extern uint8_t _clear_end[];
22
23extern uint8_t _data_src_start[];
24extern uint8_t _data_dest_start[];
25extern uint8_t _data_dest_end[];
26
27void Init52235(void)
28{
29  register uint32_t i;
30  register uint32_t *dp, *sp;
31  register uint8_t *dbp, *sbp;
32
33  /*
34   * Initialize the hardware
35   */
36  init_main();
37
38  /*
39   * Copy the vector table to RAM
40   */
41
42  if (_VBR != _INTERRUPT_VECTOR) {
43    sp = (uint32_t *) _INTERRUPT_VECTOR;
44    dp = (uint32_t *) _VBR;
45    for (i = 0; i < 256; i++) {
46      *dp++ = *sp++;
47    }
48  }
49
50  _wr_vbr((uint32_t) _VBR);
51
52  /*
53   * Move initialized data from ROM to RAM.
54   */
55  if (_data_src_start != _data_dest_start) {
56    dbp = (uint8_t *) _data_dest_start;
57    sbp = (uint8_t *) _data_src_start;
58    i = _data_dest_end - _data_dest_start;
59    while (i--)
60      *dbp++ = *sbp++;
61  }
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
75  /*
76   * We have to call some kind of RTEMS function here!
77   */
78
79  boot_card(0, 0, 0);
80  for (;;) ;
81}
Note: See TracBrowser for help on using the repository browser.