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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [lib/] [libbsp/] [i386/] [ts_386ex/] [tools/] [debug_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
#include <stdio.h>
19
 
20
#ifdef GNAT_PID
21
#include <unistd.h>
22
pid_t getpid()
23
{
24
  return GNAT_PID;
25
}
26
#endif
27
 
28
/*
29
 *  By having the POSIX_Init thread create a second thread just
30
 *  to invoke gnat_main, we can override all default attributes
31
 *  of the "Ada environment task".  Otherwise, we would be
32
 *  stuck with the defaults set by RTEMS.
33
 */
34
 
35
void *start_gnat_main( void * argument )
36
{
37
  extern int gnat_main ( int argc, char **argv, char **envp );
38
 
39
  (void) gnat_main ( 0, 0, 0 );
40
 
41
  exit( 0 );
42
 
43
  return 0;
44
}
45
 
46
void *POSIX_Init( void *argument )
47
{
48
  pthread_t       thread_id;
49
  pthread_attr_t  attr;
50
  int             status;
51
 
52
  status = pthread_attr_init( &attr );
53
  assert( !status );
54
 
55
#ifdef GNAT_MAIN_STACKSPACE
56
  status = pthread_attr_setstacksize( &attr, GNAT_MAIN_STACKSPACE );
57
  assert( !status );
58
#endif
59
 
60
  status = pthread_create( &thread_id, &attr, start_gnat_main, NULL );
61
  assert( !status );
62
 
63
  pthread_exit( 0 );
64
 
65
  return 0;
66
}
67
 
68
/* configuration information */
69
 
70
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
71
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
72
 
73
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
74
 
75
#define CONFIGURE_MICROSECONDS_PER_TICK RTEMS_MILLISECONDS_TO_MICROSECONDS(1)
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.