]> git.kernelconcepts.de Git - karo-tx-redboot.git/blob - packages/services/gfx/mw/v2_0/src/rtems/rtems_init.c
unified MX27, MX25, MX37 trees
[karo-tx-redboot.git] / packages / services / gfx / mw / v2_0 / src / rtems / rtems_init.c
1 /*
2 /////////////////////////////////////////////////////////////////////////////
3 // $Header$
4 //
5 // Copyright (c) 1999 ConnectTel, Inc. All Rights Reserved.
6 //  
7 // MODULE DESCRIPTION:
8 //
9 //  RTEMS Init Task for a MicroWindows application that 
10 //        may or may not use network functionality.
11 //
12 //  by: Rosimildo da Silva:
13 //      rdasilva@connecttel.com
14 //      http://www.connecttel.com
15 //
16 // MODIFICATION/HISTORY:
17 // $Log$
18 // Revision 1.1.9.1  2009-06-15 14:12:31  lothar
19 // unified MX27, MX25, MX37 trees
20 //
21 // Revision 1.1.1.1  2001/06/21 06:32:42  greg
22 // Microwindows pre8 with patches
23 //
24 // Revision 1.1.1.1  2001/06/05 03:44:03  root
25 // First import of 5/5/2001 Microwindows to CVS
26 //
27 //
28 /////////////////////////////////////////////////////////////////////////////
29 */
30
31 #define  CONFIGURE_INIT
32 #include <stdio.h>
33 #include "rtemscfg.h"
34
35 #ifndef  NONETWORK
36 #include "net_cfg.h"
37 #include <stdio.h>
38 #include <sys/socket.h>
39 #include <netinet/in.h>
40 #include <netdb.h>
41 #include <arpa/inet.h>
42 #endif
43 #include "device.h"  /* DPRINTF() macro */
44
45 /* Enable the following define if you want to debug this application */
46 /* #define USE_REMOTE_GDB__ */
47 #ifdef USE_REMOTE_GDB__
48 extern void init_remote_gdb( void );
49 #define BREAKPOINT() asm("   int $3");
50 #endif
51
52 /* this is the command line options to be passed to the main routine */
53 char *cc_argv[] = 
54 {
55         "cc_main",    /* arg[ 0 ] -- always the name of the program */
56 };
57 int cc_argc = sizeof( cc_argv ) / sizeof( cc_argv[ 0 ]  );
58
59
60 extern int rtems_main(int argc, char **argv);
61
62 /*
63  * DESCRIPTION: Init task for any MicroWindows/RTEMS application.
64  */
65 void *POSIX_Init( void *argument )
66 {
67   size_t st = 0;
68
69 #ifdef USE_REMOTE_GDB__
70   init_remote_gdb();
71 /*  BREAKPOINT(); */
72 #endif
73
74   DPRINTF( "\nStarting RTEMS init task...\n" );
75
76 #ifndef NONETWORK
77   /* Make all network initialization */
78   rtems_bsdnet_initialize_network();
79   DPRINTF( "Netowrk Initialization is complete.\n\n" );
80 #endif
81
82   st = _Thread_Executing->Start.Initial_stack.size;
83   DPRINTF( "Init Task Stack Size is: %d\n", st );
84
85   rtems_main( cc_argc, cc_argv );
86   DPRINTF( "*** Done ***\n\n\n" );
87   pthread_exit( NULL );
88   return NULL; /* just so the compiler thinks we returned something */
89 }