source: rtems/testsuites/ada/support/init.c @ c589775a

5
Last change on this file since c589775a was c589775a, checked in by Sebastian Huber <sebastian.huber@…>, on Dec 1, 2017 at 12:56:50 PM

ada: Use CONFIGURE_DISABLE_SMP_CONFIGURATION

Most Ada tests fail otherwise.

Update #3020.

  • Property mode set to 100644
File size: 1.9 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2015
3 *  On-Line Applications Research Corporation (OAR).
4 */
5
6#include <stdlib.h>
7
8#include <rtems/test.h>
9#include <rtems/score/threadimpl.h>
10
11/*
12 * This is the entry point automatically generated by GNAT.
13 */
14extern int gnat_main ( int argc, char **argv, char **envp );
15
16static 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 */
29void ada_test_begin(void);
30void ada_test_end(void);
31uint32_t milliseconds_per_tick(void);
32uint32_t ticks_per_second(void);
33uint32_t work_space_size(void);
34uint32_t is_configured_multiprocessing(void);
35uint32_t get_node(void);
36rtems_id tcb_to_id(Thread_Control *tcb);
37
38/*
39 *  By putting this in brackets rather than quotes, we get the search
40 *  path and can get this file from ".." in the mptests.
41 */
42#define CONFIGURE_INIT
43#define CONFIGURE_GNAT_RTEMS
44#define CONFIGURE_MEMORY_OVERHEAD  (256)
45
46#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
47
48#define CONFIGURE_DISABLE_SMP_CONFIGURATION
49
50#include <config.h>
51
52const char rtems_test_name[] = ADA_TEST_NAME;
53
54void ada_test_begin(void)
55{
56  rtems_test_begin(rtems_test_name, RTEMS_TEST_STATE_PASS);
57}
58
59void ada_test_end(void)
60{
61  rtems_test_end(rtems_test_name);
62}
63
64rtems_id tcb_to_id(
65  Thread_Control *tcb
66)
67{
68  return tcb->Object.id; /* Only for sp04 */
69}
70
71uint32_t milliseconds_per_tick(void)
72{
73  return CONFIGURE_MICROSECONDS_PER_TICK / 1000;
74}
75
76uint32_t ticks_per_second(void)
77{
78  return rtems_clock_get_ticks_per_second();
79}
80
81uint32_t work_space_size(void)
82{
83  return CONFIGURE_EXECUTIVE_RAM_SIZE;
84}
85
86uint32_t is_configured_multiprocessing(void)
87{
88#if defined(RTEMS_MULTIPROCESSING)
89  return 1;
90#else
91  return 0;
92#endif
93}
94
95uint32_t get_node(void)
96{
97  /* XXX HACK -- use public API */
98  return _Objects_Local_node;
99}
100
Note: See TracBrowser for help on using the repository browser.