source: rtems/bsps/powerpc/qemuppc/start/cmain.c @ 8f8ccee

5
Last change on this file since 8f8ccee was 9964895, checked in by Sebastian Huber <sebastian.huber@…>, on 04/20/18 at 08:35:35

bsps: Move startup files to bsps

Adjust build support files to new directory layout.

This patch is a part of the BSP source reorganization.

Update #3285.

  • Property mode set to 100644
File size: 1.0 KB
Line 
1#include <bsp/bootcard.h>
2#include <bsp/linker-symbols.h>
3
4static void
5__outb(int port, unsigned char v)
6{
7  *((volatile unsigned char *)(0x80000000 + port)) = v;
8}
9
10#if 0
11/* currently unused but keep just in case */
12
13static unsigned char
14__inb(int port)
15{
16  return *((volatile unsigned char *)(0x80000000 + port));
17}
18#endif
19
20static void
21__memcpy (unsigned char *d, unsigned char *s, int len)
22{
23  while (len--)
24    *d++ = *s++;
25}
26
27static void
28__bzero (unsigned char *d, int len)
29{
30  while (len--)
31    *d++ = 0;
32}
33
34
35/*
36 * Prototype this here because it is just the entry symbol and
37 * not referenced from any compileable code.
38 */
39void cmain (void);
40
41void cmain (void)
42{
43  /*
44   * init variable sections
45   */
46  __memcpy (bsp_section_data_begin, bsp_section_data_load_begin, (int)bsp_section_data_size);
47  __bzero (bsp_section_bss_begin, (int)bsp_section_bss_size);
48  __bzero (bsp_section_sbss_begin, (int)bsp_section_sbss_size);
49  /* printk( "start of BSP\n"); */
50  boot_card(0);
51  /* printk( "end of BSP\n"); */
52  __outb (0x92, 0x01);
53  while (1)
54    ;
55}
Note: See TracBrowser for help on using the repository browser.