po_hi_common.h 4.03 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
32
33
34
35
36
   #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
37

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

53
54
55
56
57
#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
58
59
60
61
62
63
64
   #define CONFIGURE_MAXIMUM_TIMERS                   40
   #define CONFIGURE_EXECUTIVE_RAM_SIZE               (512*1024)
   #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
   #define CONFIGURE_TICKS_PER_TIMESLICE              0
65

66
67

   int Init ();
68
   #define CONFIGURE_EXTRA_TASK_STACKS                (20 * RTEMS_MINIMUM_STACK_SIZE)
69
70
   #define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
   #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
71
   #define CONFIGURE_MAXIMUM_BARRIERS                 1 + __PO_HI_NB_PORTS + 1
72
73
74
75
   #define CONFIGURE_INIT
   #include <rtems.h>
   #include <inttypes.h>
   #include <bsp.h>
76
77
78
79
   #include <rtems/confdefs.h>
#endif  /* RTEMS_POSIX */


80

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

julien.delange's avatar
julien.delange committed
86
87
88
89
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
90
91
92
#define RTEMS_BSP_NETWORK_DRIVER_NAME    "ne1"
#define RTEMS_BSP_NETWORK_DRIVER_ATTACH  rtems_ne_driver_attach

julien.delange's avatar
julien.delange committed
93
94
95
96
97
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};
98

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

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

#endif /* __COMMON_H__ */