source: rtems/c/src/lib/libbsp/powerpc/qemuppc/startup/cmain.c @ 133bffb

4.104.11
Last change on this file since 133bffb was 133bffb, checked in by Thomas Doerfler <Thomas.Doerfler@…>, on Oct 6, 2009 at 7:56:07 PM

various changes

  • Property mode set to 100644
File size: 1.3 KB
Line 
1
2static void
3__outb(int port, unsigned char v)
4{
5  *((volatile unsigned char *)(0x80000000 + port)) = v;
6}
7
8static unsigned char
9__inb(int port)
10{
11  return *((volatile unsigned char *)(0x80000000 + port));
12}
13
14static void
15__memcpy (unsigned char *d, unsigned char *s, int len)
16{
17  while (len--)
18    *d++ = *s++;
19}
20
21static void
22__bzero (unsigned char *d, int len)
23{
24  while (len--)
25    *d++ = 0;
26}
27
28extern unsigned char __sdata2_load[], __sdata2_start[], __sdata2_end[];
29extern unsigned char __data_load[], __data_start[], __data_end[];
30extern unsigned char __sdata_load[], __sdata_start[], __sdata_end[];
31extern unsigned char __sbss2_start[], __sbss2_end[];
32extern unsigned char __sbss_start[], __sbss_end[];
33extern unsigned char __bss_start[], __bss_end[];
34
35extern void boot_card(void *);
36
37
38void cmain (void)
39{
40  /*
41   * init variable sections
42   */
43  __memcpy (__sdata2_start, __sdata2_load, __sdata2_end - __sdata2_start);
44  __memcpy (__sdata_start , __sdata_load , __sdata_end  - __sdata_start);
45  __memcpy (__data_start  , __data_load  , __data_end   - __data_start);
46  __bzero (__sbss2_start  , __sbss2_end - __sbss2_start);
47  __bzero (__sbss_start   , __sbss_end  - __sbss_start);
48  __bzero (__bss_start    , __bss_end   - __bss_start);
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.