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

5
Last change on this file since c4b8b147 was ee537ea, checked in by Sebastian Huber <sebastian.huber@…>, on 10/12/17 at 08:00:10

ada-tests: Move to testsuites/ada

This solves a build dependency issue, e.g. building tests before
librtemsbsp.a exists.

Close #3079.

  • Property mode set to 100644
File size: 1.5 KB
Line 
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 */
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 */
29uint32_t milliseconds_per_tick(void);
30uint32_t ticks_per_second(void);
31uint32_t work_space_size(void);
32uint32_t is_configured_multiprocessing(void);
33uint32_t get_node(void);
34rtems_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
46rtems_id tcb_to_id(
47  Thread_Control *tcb
48)
49{
50  return tcb->Object.id; /* Only for sp04 */
51}
52
53uint32_t milliseconds_per_tick(void)
54{
55  return CONFIGURE_MICROSECONDS_PER_TICK / 1000;
56}
57
58uint32_t ticks_per_second(void)
59{
60  return rtems_clock_get_ticks_per_second();
61}
62
63uint32_t work_space_size(void)
64{
65  return CONFIGURE_EXECUTIVE_RAM_SIZE;
66}
67
68uint32_t is_configured_multiprocessing(void)
69{
70#if defined(RTEMS_MULTIPROCESSING)
71  return 1;
72#else
73  return 0;
74#endif
75}
76
77uint32_t get_node(void)
78{
79  /* XXX HACK -- use public API */
80  return _Objects_Local_node;
81}
82
Note: See TracBrowser for help on using the repository browser.