po_hi_common.h 4.85 KB
Newer Older
1
2
3
4
5
/*
 * 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.
 *
jhugues's avatar
jhugues committed
6
 * For more informations, please visit http://assert-project.net/taste
7
 *
jhugues's avatar
jhugues committed
8
 * Copyright (C) 2007-2009 Telecom ParisTech, 2010-2012 ESA & ISAE.
9
10
11
12
13
14
15
 */

#ifndef __PO_HI_COMMON_H__
#define __PO_HI_COMMON_H__

#include <deployment.h>

jdelange's avatar
jdelange committed
16
17
18
19
20
21
22
23
24
#if (defined (RTEMS_POSIX) || defined (RTEMS_PURE))
   #if defined (__PO_HI_NEED_DRIVER_ETH_LEON) || \
       defined (__PO_HI_NEED_DRIVER_ETH_LEON_SENDER) || \
       defined (__PO_HI_NEED_DRIVER_ETH_LEON_RECEIVER)
   #define RTEMS_BSP_NETWORK_DRIVER_ATTACH RTEMS_BSP_NETWORK_DRIVER_ATTACH_SMC91111
   #endif
#endif


25
26
27
28
29
30
31
32
/*
 * 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>
jdelange's avatar
jdelange committed
33

34
   #define CONFIGURE_INIT
35
   #include <bsp.h>
36
37
   #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
   #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
38
   #define CONFIGURE_APPLICATION_NEEDS_NULL_DRIVER
39
   #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
jdelange's avatar
jdelange committed
40
   #define CONFIGURE_MAXIMUM_DRIVERS                     10
41
42
43
44
45
46
   #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
47

48
   int POSIX_Init ();
49
   #define CONFIGURE_MAXIMUM_POSIX_THREADS               __PO_HI_NB_TASKS + 10
jdelange's avatar
jdelange committed
50
51
/*   #define CONFIGURE_EXTRA_TASK_STACKS                   (20 * RTEMS_MINIMUM_STACK_SIZE)
 */
52
#ifdef __PO_HI_NB_PORTS
53
54
   #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
55
#else
56
57
   #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
58
#endif
59
   #define CONFIGURE_POSIX_INIT_THREAD_TABLE
60
   #define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
61
   #include <rtems/confdefs.h>
62
63
#endif  /* RTEMS_POSIX */

64
#if defined(RTEMS_PURE)
jdelange's avatar
jdelange committed
65
66
   #include <rtems.h>
   #include <inttypes.h>
jdelange's avatar
jdelange committed
67
   #define CONFIGURE_INIT
jdelange's avatar
jdelange committed
68
69
   #include <bsp.h>

70
71
72
73
   #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
   #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
   #define CONFIGURE_APPLICATION_NEEDS_NULL_DRIVER
   #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
jdelange's avatar
jdelange committed
74
   #define CONFIGURE_MAXIMUM_DRIVERS                     10
75
   #define CONFIGURE_MAXIMUM_TIMERS                   40
jdelange's avatar
jdelange committed
76

77
#ifndef XM3_RTEMS_MODE
78
   #define CONFIGURE_EXECUTIVE_RAM_SIZE               (512*1024)
79
#endif
jdelange's avatar
jdelange committed
80
   /*
81
   #define CONFIGURE_MAXIMUM_SEMAPHORES               __PO_HI_NB_TASKS + (__PO_HI_NB_PORTS + 1) * 2 + __PO_HI_NB_PROTECTED + 1
jdelange's avatar
jdelange committed
82
83
   */
   #define CONFIGURE_MAXIMUM_SEMAPHORES               20
jdelange's avatar
jdelange committed
84
   #define CONFIGURE_MAXIMUM_TASKS                    __PO_HI_NB_TASKS + 5
85
   #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS   20
jdelange's avatar
jdelange committed
86
87
88
89
90
91
92
93
   #define CONFIGURE_MAXIMUM_PERIODS                  __PO_HI_NB_TASKS + 5
   /*
    * We put __PO_HI_NB_TASKS + 5 because we may have additional tasks
    * from the driver. Originally, it was +2 fr th emain thread and a potential
    * network thread. Since, other drivers take additional tasks and so, we
    * increase it to 5. We would do a better integration by filtering
    * the use of each driver.
    */
94

jdelange's avatar
jdelange committed
95
#ifndef RTEMS411
jdelange's avatar
jdelange committed
96
97
98
   int Init ();
#endif

jdelange's avatar
jdelange committed
99
/*
100
   #define CONFIGURE_EXTRA_TASK_STACKS                (20 * RTEMS_MINIMUM_STACK_SIZE)
jdelange's avatar
jdelange committed
101
*/
102
103
   #define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
   #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
104
   #define CONFIGURE_MAXIMUM_BARRIERS                 1 + __PO_HI_NB_PORTS + 1
jdelange's avatar
jdelange committed
105
106

   #include <rtems/confdefs.h>
107
#endif  /* RTEMS_PURE */
108

109
#if defined (X86_RTEMS) && defined (__PO_HI_USE_TRANSPORT) && __PO_HI_NB_DEVICES > 1
110
111
112
113
#include <rtems/rtems_bsdnet.h>
#include <bsp.h>
int rtems_bsdnet_loopattach(struct rtems_bsdnet_ifconfig*, int);

julien.delange's avatar
julien.delange committed
114
115
116
117
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
118
119
120
#define RTEMS_BSP_NETWORK_DRIVER_NAME    "ne1"
#define RTEMS_BSP_NETWORK_DRIVER_ATTACH  rtems_ne_driver_attach

julien.delange's avatar
julien.delange committed
121
122
123
124
125
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};
126

julien.delange's avatar
julien.delange committed
127
128
struct rtems_bsdnet_config rtems_bsdnet_config = 
   {&netdriver_config,NULL,0,256 * 1024,256 * 1024,};
129

julien.delange's avatar
julien.delange committed
130
#endif /*(defined (X86_RTEMS) */
131
132

#endif /* __COMMON_H__ */