Initial Patch of Auction House bot rev. 135
[auctionmangos.git] / dep / ACE_wrappers / ace / Rtems_init.c
blob3aad4d5a0298df12e915bad78a8f5b45c44683e7
1 /*
2 * $Id: Rtems_init.c 80826 2008-03-04 14:51:23Z wotte $
3 */
5 #if defined (ACE_HAS_RTEMS)
7 #define RTEMS_BSP_NETWORK_DRIVER_NAME "ne1"
8 #define RTEMS_BSP_NETWORK_DRIVER_ATTACH rtems_ne_driver_attach
9 #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 256
11 #define CONFIGURE_MAXIMUM_POSIX_THREADS 100
12 #define CONFIGURE_MAXIMUM_POSIX_MUTEXES 300
13 #define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 300
14 #define CONFIGURE_MAXIMUM_POSIX_KEYS 100
15 #define CONFIGURE_MAXIMUM_POSIX_TIMERS 100
16 #define CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS 10
17 #define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES 300
18 #define CONFIGURE_POSIX_INIT_THREAD_TABLE
19 #define CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT Init
20 #define CONFIGURE_MEMORY_FOR_POSIX (10*1024)
21 #define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE (10*1024)
23 #define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
24 #define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
26 #define CONFIGURE_EXECUTIVE_RAM_SIZE (512*1024)
28 #define CONFIGURE_MICROSECONDS_PER_TICK 10000
30 #define CONFIGURE_MAXIMUM_SEMAPHORES 100
31 #define CONFIGURE_MAXIMUM_TASKS 100
32 #define CONFIGURE_INIT_TASK_PRIORITY 120
33 #define CONFIGURE_INIT_TASK_INITIAL_MODES (RTEMS_PREEMPT | \
34 RTEMS_NO_TIMESLICE | \
35 RTEMS_NO_ASR | \
36 RTEMS_INTERRUPT_LEVEL(0))
38 #include <bsp.h>
40 char *rtems_progname;
42 #define CONFIGURE_INIT
44 rtems_task Init (rtems_task_argument argument);
46 #include <confdefs.h>
48 #include <stdio.h>
50 #if !defined (ACE_LACKS_NETWORKING)
52 #include <rtems/rtems_bsdnet.h>
55 * Network configuration
57 ************************************************************
58 * EDIT THIS FILE TO REFLECT YOUR NETWORK CONFIGURATION *
59 * BEFORE RUNNING ANY RTEMS PROGRAMS WHICH USE THE NETWORK! *
60 ************************************************************
63 #ifndef _RTEMS_NETWORKCONFIG_H_
64 #define _RTEMS_NETWORKCONFIG_H_
66 #ifndef RTEMS_BSP_NETWORK_DRIVER_NAME
67 #warning "RTEMS_BSP_NETWORK_DRIVER_NAME is not defined"
68 #define RTEMS_BSP_NETWORK_DRIVER_NAME "no_network1"
69 #endif
71 #ifndef RTEMS_BSP_NETWORK_DRIVER_ATTACH
72 #warning "RTEMS_BSP_NETWORK_DRIVER_ATTACH is not defined"
73 #define RTEMS_BSP_NETWORK_DRIVER_ATTACH 0
74 #endif
76 /* #define RTEMS_USE_BOOTP */
78 #include <bsp.h>
81 * Define RTEMS_SET_ETHERNET_ADDRESS if you want to specify the
82 * Ethernet address here. If RTEMS_SET_ETHERNET_ADDRESS is not
83 * defined the driver will choose an address.
85 #define RTEMS_SET_ETHERNET_ADDRESS
86 #if (defined (RTEMS_SET_ETHERNET_ADDRESS))
87 static char ethernet_address[6] = { 0x00, 0x80, 0x7F, 0x22, 0x61, 0x77 };
89 #endif
91 #define RTEMS_USE_LOOPBACK
93 #ifdef RTEMS_USE_LOOPBACK
95 * Loopback interface
97 int rtems_bsdnet_loopattach(struct rtems_bsdnet_ifconfig *, int);
99 #ifdef RTEMS_USE_LOOPBACK_ONLY
100 static struct rtems_bsdnet_ifconfig netdriver_config = {
101 #else
102 static struct rtems_bsdnet_ifconfig loopback_config = {
103 #endif
104 "lo0", /* name */
105 rtems_bsdnet_loopattach, /* attach function */
106 0, /* link to next interface */
107 "127.0.0.1", /* IP address */
108 "255.0.0.0", /* IP net mask */
110 #endif
113 * Default network interface
115 #ifndef RTEMS_USE_LOOPBACK_ONLY
116 static struct rtems_bsdnet_ifconfig netdriver_config = {
117 RTEMS_BSP_NETWORK_DRIVER_NAME, /* name */
118 RTEMS_BSP_NETWORK_DRIVER_ATTACH, /* attach function */
120 #ifdef RTEMS_USE_LOOPBACK
121 &loopback_config, /* link to next interface */
122 #else
123 0, /* No more interfaces */
124 #endif
126 #if (defined (RTEMS_USE_BOOTP))
127 0, /* BOOTP supplies IP address */
128 0, /* BOOTP supplies IP net mask */
129 #else
130 "XXX.YYY.ZZZ.XYZ", /* IP address */
131 "255.255.255.0", /* IP net mask */
132 #endif /* !RTEMS_USE_BOOTP */
134 #if (defined (RTEMS_SET_ETHERNET_ADDRESS))
135 ethernet_address, /* Ethernet hardware address */
136 #else
137 0, /* Driver supplies hardware address */
138 #endif
139 0 /* Use default driver parameters */
141 #endif
144 * Network configuration
146 struct rtems_bsdnet_config rtems_bsdnet_config = {
147 &netdriver_config,
149 #if (defined (RTEMS_USE_BOOTP))
150 rtems_bsdnet_do_bootp,
151 #else
153 #endif
155 0, /* Default network task priority */
156 0, /* Default mbuf capacity */
157 0, /* Default mbuf cluster capacity */
159 #if (!defined (RTEMS_USE_BOOTP))
160 "rtems_host", /* Host name */
161 "nodomain.com", /* Domain name */
162 "XXX.YYY.ZZZ.1", /* Gateway */
163 "XXX.YYY.ZZZ.1", /* Log host */
164 {"XXX.YYY.ZZZ.1" }, /* Name server(s) */
165 {"XXX.YYY.ZZZ.1" }, /* NTP server(s) */
168 * A real example -- DO NOT USE THIS YOURSELF!!!
171 #if 0
172 "dy4", /* Host name */
173 "NOT_oarcorp.com", /* Domain name */
174 "192.168.1.2", /* Gateway */
175 "192.168.1.2", /* Log host */
176 {"192.168.1.2" }, /* Name server(s) */
177 {"192.168.1.2" }, /* NTP server(s) */
178 #endif
179 #endif /* !RTEMS_USE_BOOTP */
184 * For TFTP test application
186 #if (defined (RTEMS_USE_BOOTP))
187 #define RTEMS_TFTP_TEST_HOST_NAME "BOOTP_HOST"
188 #define RTEMS_TFTP_TEST_FILE_NAME "BOOTP_FILE"
189 #else
190 #define RTEMS_TFTP_TEST_HOST_NAME "XXX.YYY.ZZZ.XYZ"
191 #define RTEMS_TFTP_TEST_FILE_NAME "tftptest"
192 #endif
194 #endif /* _RTEMS_NETWORKCONFIG_H_ */
196 #endif /* ACE_LACKS_NETWORKING */
198 extern int main (int, char *[]);
201 * RTEMS Startup Task
203 rtems_task
204 Init (rtems_task_argument not_used)
206 int retval = 0;
207 #if !defined (ACE_LACKS_NETWORKING)
208 retval = rtems_bsdnet_initialize_network ();
209 #endif /* ACE_LACKS_NETWORKING */
210 if (retval == 0)
212 retval = main (0, 0);
216 #elif !defined (__GNUC__) && !defined (__INTEL_COMPILER)
217 /* Make compilers stop complaining about an empty translation unit */
218 static int shut_up_compiler = 0;
219 #endif /* ACE_HAS_RTEMS */