po_hi_common.h 3.28 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
   #define CONFIGURE_MAXIMUM_POSIX_TIMERS          40
   #define CONFIGURE_MAXIMUM_TIMERS                40
33
34
35
36
   #define CONFIGURE_EXECUTIVE_RAM_SIZE    (512*1024)
   #define CONFIGURE_MAXIMUM_SEMAPHORES    20
   #define CONFIGURE_MAXIMUM_TASKS         20
   #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 20
37

38
39

   int POSIX_Init ();
40
   #define CONFIGURE_MAXIMUM_POSIX_THREADS              __PO_HI_NB_TASKS + 10
41
   #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
51
   #define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
//   #include <po_hi_rtemsconfig.h>
52
   #include <rtems/confdefs.h>
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#endif  /* RTEMS_POSIX */


#if defined (X86_RTEMS)
#include <rtems/rtems_bsdnet.h>

#include <bsp.h>
/*
 * Loopback interface
 */
int rtems_bsdnet_loopattach(struct rtems_bsdnet_ifconfig*, int);

static struct rtems_bsdnet_ifconfig loopback_config = {
	"lo0",				/* name */
	rtems_bsdnet_loopattach,	/* attach function */

	NULL,				/* link to next interface */

	"127.0.0.1",			/* IP address */
	"255.0.0.0",			/* IP net mask */
};

/*
 * Default network interface
 */
#define RTEMS_BSP_NETWORK_DRIVER_NAME    "ne1"
#define RTEMS_BSP_NETWORK_DRIVER_ATTACH  rtems_ne_driver_attach


struct rtems_bsdnet_ifconfig netdriver_config = {
	RTEMS_BSP_NETWORK_DRIVER_NAME,		/* name */
	RTEMS_BSP_NETWORK_DRIVER_ATTACH,	/* attach function */

	&loopback_config,		/* link to next interface */

	"10.0.2.5",			/* IP address */
	"255.255.255.0",		/* IP net mask */

	NULL,                           /* Driver supplies hardware address */
	0,				/* Use default driver parameters */
	0, /* mtu */
	0, /* rbuf_count */
	0, /* xbuf_count */
	0, /* port */
	9 /* irq */
};

/*
 * Network configuration
 */
struct rtems_bsdnet_config rtems_bsdnet_config = {
	&netdriver_config,

	NULL,

	0,			/* Default network task priority */
	256 * 1024,			/* Default mbuf capacity */
	256 * 1024,			/* Default mbuf cluster capacity */
};

#endif /*(defined (X86_RTEMS) &&  defined (NEED_TRANSPORT)) */


116
117

#endif /* __COMMON_H__ */