OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [lib/] [libbsp/] [i386/] [ts_386ex/] [tools/] [ts_1325_ada/] [init.c] - Blame information for rev 609

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*
2
 *  COPYRIGHT (c) 1989-1997.
3
 *  On-Line Applications Research Corporation (OAR).
4
 *  Copyright assigned to U.S. Government, 1994.
5
 *
6
 *  The license and distribution terms for this file may be found in
7
 *  the file LICENSE in this distribution or at
8
 *  http://www.OARcorp.com/rtems/license.html.
9
 *
10
 *  $Id: init.c,v 1.2 2001-09-27 11:59:51 chris Exp $
11
 */
12
 
13
#include <bsp.h>
14
 
15
#include <assert.h>
16
#include <pthread.h>
17
 
18
#ifdef GNAT_PID
19
#include <unistd.h>
20
pid_t getpid()
21
{
22
  return GNAT_PID;
23
}
24
#endif
25
 
26
/*
27
 *  By having the POSIX_Init thread create a second thread just
28
 *  to invoke gnat_main, we can override all default attributes
29
 *  of the "Ada environment task".  Otherwise, we would be
30
 *  stuck with the defaults set by RTEMS.
31
 */
32
 
33
void *start_gnat_main( void * argument )
34
{
35
  extern int gnat_main ( int argc, char **argv, char **envp );
36
 
37
  (void) gnat_main ( 0, 0, 0 );
38
 
39
  exit( 0 );
40
 
41
  return 0;
42
}
43
 
44
void *POSIX_Init( void *argument )
45
{
46
  pthread_t       thread_id;
47
  pthread_attr_t  attr;
48
  int             status;
49
 
50
  status = pthread_attr_init( &attr );
51
  assert( !status );
52
 
53
#ifdef GNAT_MAIN_STACKSPACE
54
  status = pthread_attr_setstacksize( &attr, GNAT_MAIN_STACKSPACE );
55
  assert( !status );
56
#endif
57
 
58
  status = pthread_create( &thread_id, &attr, start_gnat_main, NULL );
59
  assert( !status );
60
 
61
  pthread_exit( 0 );
62
 
63
  return 0;
64
}
65
 
66
/* configuration information */
67
 
68
#define CONFIGURE_GNAT_RTEMS
69
 
70
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
71
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
72
 
73
#define CONFIGURE_MICROSECONDS_PER_TICK RTEMS_MILLISECONDS_TO_MICROSECONDS(1)
74
 
75
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
76
 
77
#define CONFIGURE_MAXIMUM_POSIX_THREADS              20
78
#define CONFIGURE_MAXIMUM_POSIX_KEYS                 20
79
#define CONFIGURE_MAXIMUM_POSIX_MUTEXES              30
80
#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES  20
81
 
82
#define CONFIGURE_INIT
83
 
84
#include <confdefs.h>
85
 

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.