source: rtems/c/src/lib/libbsp/i386/ts_386ex/tools/ts_1325_ada/init.c @ 3299388d

4.104.114.84.95
Last change on this file since 3299388d was e61df10, checked in by Joel Sherrill <joel.sherrill@…>, on 09/04/03 at 18:51:28

2003-09-04 Joel Sherrill <joel@…>

  • clock/ckinit.c, clock/rtc.c, console/console.c, include/bsp.h, include/coverhd.h, network/ne2000.c, start/80386ex.h, start/80386ex.inc, start/macros.inc, start/start.S, startup/bspstart.c, startup/linkcmds, startup/setvec.c, timer/timer.c, timer/timerisr.S, tools/debug_ada/init.c, tools/debug_c/init.c, tools/debug_c/serial_gdb.c, tools/debug_c/system.h, tools/network_ada/listener/init.c, tools/network_ada/tcprelay/init.c, tools/ts_1325_ada/init.c: URL for license changed.
  • Property mode set to 100644
File size: 1.8 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-1997.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be found in
6 *  the file LICENSE in this distribution or at
7 *  http://www.rtems.com/license/LICENSE.
8 *
9 *  $Id$
10 */
11
12#include <bsp.h>
13
14#include <assert.h>
15#include <pthread.h>
16
17#ifdef GNAT_PID
18#include <unistd.h>
19pid_t getpid()
20{
21  return GNAT_PID;
22}
23#endif
24
25/*
26 *  By having the POSIX_Init thread create a second thread just
27 *  to invoke gnat_main, we can override all default attributes
28 *  of the "Ada environment task".  Otherwise, we would be
29 *  stuck with the defaults set by RTEMS.
30 */
31 
32void *start_gnat_main( void * argument )
33{
34  extern int gnat_main ( int argc, char **argv, char **envp );
35
36  (void) gnat_main ( 0, 0, 0 );
37
38  exit( 0 );
39
40  return 0;
41}
42
43void *POSIX_Init( void *argument )
44{
45  pthread_t       thread_id;
46  pthread_attr_t  attr;
47  int             status;
48
49  status = pthread_attr_init( &attr );
50  assert( !status );
51
52#ifdef GNAT_MAIN_STACKSPACE
53  status = pthread_attr_setstacksize( &attr, GNAT_MAIN_STACKSPACE );
54  assert( !status );
55#endif
56
57  status = pthread_create( &thread_id, &attr, start_gnat_main, NULL );
58  assert( !status );
59
60  pthread_exit( 0 );
61
62  return 0;
63}
64
65/* configuration information */
66
67#define CONFIGURE_GNAT_RTEMS
68
69#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
70#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
71
72#define CONFIGURE_MICROSECONDS_PER_TICK RTEMS_MILLISECONDS_TO_MICROSECONDS(1)
73
74#define CONFIGURE_POSIX_INIT_THREAD_TABLE
75
76#define CONFIGURE_MAXIMUM_POSIX_THREADS              20
77#define CONFIGURE_MAXIMUM_POSIX_KEYS                 20
78#define CONFIGURE_MAXIMUM_POSIX_MUTEXES              30
79#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES  20
80
81#define CONFIGURE_INIT
82
83#include <confdefs.h>
84
Note: See TracBrowser for help on using the repository browser.