po_hi_common.h 4.08 KB
Newer Older
1
2
3
4
5
6
7
8
/*
 * This is a part of PolyORB-HI-C distribution, a minimal
 * middleware written for generated code from AADL models.
 * You should use it with the Ocarina toolsuite.
 *
 * For more informations, please visit http://ocarina.enst.fr
 *
 * Copyright (C) 2007-2008, GET-Telecom Paris.
9
 * Copyright (C) 2010, European Space Agency.
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 */

#ifndef __PO_HI_COMMON_H__
#define __PO_HI_COMMON_H__

#include <deployment.h>

/*
 * Configure RTEMS executive.
 * We have to define the number of tasks inside the executive,
 * we deduce it from generated statements.
 */
#if defined(RTEMS_POSIX)
   #include <rtems.h>
   #include <inttypes.h>
   #define CONFIGURE_INIT
26
   #include <bsp.h>
27
28
   #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
   #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
29
   #define CONFIGURE_APPLICATION_NEEDS_NULL_DRIVER
30
   #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
31
   #define CONFIGURE_MAXIMUM_DRIVERS                 10
32
33
34
35
36
37
   #define CONFIGURE_MAXIMUM_POSIX_TIMERS                40
   #define CONFIGURE_MAXIMUM_TIMERS                      40
   #define CONFIGURE_EXECUTIVE_RAM_SIZE                  (512*1024)
   #define CONFIGURE_MAXIMUM_SEMAPHORES                  20
   #define CONFIGURE_MAXIMUM_TASKS                       __PO_HI_NB_TASKS + 2
   #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS      20
38

39
   int POSIX_Init ();
40
41
   #define CONFIGURE_MAXIMUM_POSIX_THREADS               __PO_HI_NB_TASKS + 10
   #define CONFIGURE_EXTRA_TASK_STACKS                   (20 * RTEMS_MINIMUM_STACK_SIZE)
42
#ifdef __PO_HI_NB_PORTS
43
44
   #define CONFIGURE_MAXIMUM_POSIX_MUTEXES              __PO_HI_NB_TASKS + 10 + __PO_HI_NB_PORTS
   #define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES  __PO_HI_NB_TASKS + 10 + __PO_HI_NB_PORTS
45
#else
46
47
   #define CONFIGURE_MAXIMUM_POSIX_MUTEXES              __PO_HI_NB_TASKS + 10 + __PO_HI_NB_PORTS
   #define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES  __PO_HI_NB_TASKS + 10 + __PO_HI_NB_PORTS
48
#endif
49
   #define CONFIGURE_POSIX_INIT_THREAD_TABLE
50
   #define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
51
   #include <rtems/confdefs.h>
52
53
#endif  /* RTEMS_POSIX */

54
55
56
57
58
#if defined(RTEMS_PURE)
   #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
   #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
   #define CONFIGURE_APPLICATION_NEEDS_NULL_DRIVER
   #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
59
   #define CONFIGURE_MAXIMUM_TIMERS                   40
60
#ifndef XM3_RTEMS_MODE
61
   #define CONFIGURE_EXECUTIVE_RAM_SIZE               (512*1024)
62
#endif
63
64
65
66
   #define CONFIGURE_MAXIMUM_SEMAPHORES               __PO_HI_NB_TASKS + (__PO_HI_NB_PORTS + 1) * 2 + __PO_HI_NB_PROTECTED + 1
   #define CONFIGURE_MAXIMUM_TASKS                    __PO_HI_NB_TASKS + 2
   #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS   20
   #define CONFIGURE_MAXIMUM_PERIODS                  __PO_HI_NB_TASKS + 2
67

jdelange's avatar
jdelange committed
68
#ifndef NDS_RTEMS
69
   int Init ();
jdelange's avatar
jdelange committed
70
#endif
71

72
   #define CONFIGURE_EXTRA_TASK_STACKS                (20 * RTEMS_MINIMUM_STACK_SIZE)
73
74
   #define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
   #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
75
   #define CONFIGURE_MAXIMUM_BARRIERS                 1 + __PO_HI_NB_PORTS + 1
76
77
78
79
   #define CONFIGURE_INIT
   #include <rtems.h>
   #include <inttypes.h>
   #include <bsp.h>
80
   #include <rtems/confdefs.h>
81
#endif  /* RTEMS_PURE */
82

83
#if defined (X86_RTEMS) && defined (__PO_HI_USE_TRANSPORT) && __PO_HI_NB_DEVICES > 1
84
85
86
87
#include <rtems/rtems_bsdnet.h>
#include <bsp.h>
int rtems_bsdnet_loopattach(struct rtems_bsdnet_ifconfig*, int);

julien.delange's avatar
julien.delange committed
88
89
90
91
static struct rtems_bsdnet_ifconfig loopback_config =
   {"lo0", rtems_bsdnet_loopattach,	NULL, "127.0.0.1", "255.0.0.0", };
#undef RTEMS_BSP_NETWORK_DRIVER_NAME 
#undef RTEMS_BSP_NETWORK_DRIVER_ATTACH
92
93
94
#define RTEMS_BSP_NETWORK_DRIVER_NAME    "ne1"
#define RTEMS_BSP_NETWORK_DRIVER_ATTACH  rtems_ne_driver_attach

julien.delange's avatar
julien.delange committed
95
96
97
98
99
struct rtems_bsdnet_ifconfig netdriver_config = 
   {RTEMS_BSP_NETWORK_DRIVER_NAME,RTEMS_BSP_NETWORK_DRIVER_ATTACH,
	&loopback_config,"192.168.0.1","255.255.255.0",
   (char[]){ 0x00, 0x1F, 0xC6, 0xBF, 0x74, 0x06},
	0,0,0,0,0,9};
100

julien.delange's avatar
julien.delange committed
101
102
struct rtems_bsdnet_config rtems_bsdnet_config = 
   {&netdriver_config,NULL,0,256 * 1024,256 * 1024,};
103

julien.delange's avatar
julien.delange committed
104
#endif /*(defined (X86_RTEMS) */
105
106

#endif /* __COMMON_H__ */