po_hi_common.h 2.74 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
   int POSIX_Init ();
39
   #define CONFIGURE_MAXIMUM_POSIX_THREADS              __PO_HI_NB_TASKS + 10
40
   #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
53
54
55
56
57
58
#endif  /* RTEMS_POSIX */


#if defined (X86_RTEMS)
#include <rtems/rtems_bsdnet.h>
#include <bsp.h>
int rtems_bsdnet_loopattach(struct rtems_bsdnet_ifconfig*, int);

julien.delange's avatar
julien.delange committed
59
60
61
62
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
63
64
65
#define RTEMS_BSP_NETWORK_DRIVER_NAME    "ne1"
#define RTEMS_BSP_NETWORK_DRIVER_ATTACH  rtems_ne_driver_attach

julien.delange's avatar
julien.delange committed
66
67
68
69
70
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};
71

julien.delange's avatar
julien.delange committed
72
73
struct rtems_bsdnet_config rtems_bsdnet_config = 
   {&netdriver_config,NULL,0,256 * 1024,256 * 1024,};
74

julien.delange's avatar
julien.delange committed
75
#endif /*(defined (X86_RTEMS) */
76
77

#endif /* __COMMON_H__ */