1 | /* |
---|
2 | * COPYRIGHT (c) 1989-2015 |
---|
3 | * On-Line Applications Research Corporation (OAR). |
---|
4 | */ |
---|
5 | |
---|
6 | #include <bsp.h> |
---|
7 | #include <stdlib.h> |
---|
8 | |
---|
9 | #include <rtems/score/threadimpl.h> |
---|
10 | |
---|
11 | /* |
---|
12 | * This is the entry point automatically generated by GNAT. |
---|
13 | */ |
---|
14 | extern int gnat_main ( int argc, char **argv, char **envp ); |
---|
15 | |
---|
16 | static void *POSIX_Init( |
---|
17 | void *argument |
---|
18 | ) |
---|
19 | { |
---|
20 | (void) gnat_main ( 0, 0, 0 ); |
---|
21 | |
---|
22 | exit( 0 ); |
---|
23 | } |
---|
24 | |
---|
25 | /* |
---|
26 | * Prototypes for various test support routines. Since these are bound to |
---|
27 | * from Ada, there are no external .h files even though they must be public. |
---|
28 | */ |
---|
29 | uint32_t milliseconds_per_tick(void); |
---|
30 | uint32_t ticks_per_second(void); |
---|
31 | uint32_t work_space_size(void); |
---|
32 | uint32_t is_configured_multiprocessing(void); |
---|
33 | uint32_t get_node(void); |
---|
34 | rtems_id tcb_to_id(Thread_Control *tcb); |
---|
35 | |
---|
36 | /* |
---|
37 | * By putting this in brackets rather than quotes, we get the search |
---|
38 | * path and can get this file from ".." in the mptests. |
---|
39 | */ |
---|
40 | #define CONFIGURE_INIT |
---|
41 | #define CONFIGURE_GNAT_RTEMS |
---|
42 | #define CONFIGURE_MEMORY_OVERHEAD (256) |
---|
43 | |
---|
44 | #include <config.h> |
---|
45 | |
---|
46 | rtems_id tcb_to_id( |
---|
47 | Thread_Control *tcb |
---|
48 | ) |
---|
49 | { |
---|
50 | return tcb->Object.id; /* Only for sp04 */ |
---|
51 | } |
---|
52 | |
---|
53 | uint32_t milliseconds_per_tick(void) |
---|
54 | { |
---|
55 | return CONFIGURE_MICROSECONDS_PER_TICK / 1000; |
---|
56 | } |
---|
57 | |
---|
58 | uint32_t ticks_per_second(void) |
---|
59 | { |
---|
60 | return rtems_clock_get_ticks_per_second(); |
---|
61 | } |
---|
62 | |
---|
63 | uint32_t work_space_size(void) |
---|
64 | { |
---|
65 | return CONFIGURE_EXECUTIVE_RAM_SIZE; |
---|
66 | } |
---|
67 | |
---|
68 | uint32_t is_configured_multiprocessing(void) |
---|
69 | { |
---|
70 | #if defined(RTEMS_MULTIPROCESSING) |
---|
71 | return 1; |
---|
72 | #else |
---|
73 | return 0; |
---|
74 | #endif |
---|
75 | } |
---|
76 | |
---|
77 | uint32_t get_node(void) |
---|
78 | { |
---|
79 | /* XXX HACK -- use public API */ |
---|
80 | return _Objects_Local_node; |
---|
81 | } |
---|
82 | |
---|