1 | /* |
---|
2 | * RTEMS configuration/initialization |
---|
3 | */ |
---|
4 | |
---|
5 | #include <bsp.h> |
---|
6 | #include <rtems/error.h> |
---|
7 | #include <rtems/rtems_bsdnet.h> |
---|
8 | #include <stdio.h> |
---|
9 | |
---|
10 | #define CONFIGURE_RTEMS_INIT_TASKS_TABLE |
---|
11 | #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 20 |
---|
12 | #define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM |
---|
13 | |
---|
14 | #define STACK_CHECKER_ON 1 |
---|
15 | #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER |
---|
16 | #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER |
---|
17 | #define CONFIGURE_MAXIMUM_USER_EXTENSIONS 2 |
---|
18 | #define CONFIGURE_MAXIMUM_SEMAPHORES 20 |
---|
19 | #define CONFIGURE_MAXIMUM_TASKS 12 |
---|
20 | |
---|
21 | #define CONFIGURE_MICROSECONDS_PER_TICK 20000 |
---|
22 | |
---|
23 | #define CONFIGURE_INIT_TASK_PRIORITY 99 |
---|
24 | #define CONFIGURE_INIT_TASK_STACK_SIZE (16*1024) |
---|
25 | #define CONFIGURE_INIT |
---|
26 | |
---|
27 | rtems_task Init(rtems_task_argument argument); |
---|
28 | |
---|
29 | #include <rtems/confdefs.h> |
---|
30 | |
---|
31 | /* |
---|
32 | * Network configuration |
---|
33 | */ |
---|
34 | #define NETWORK_TASK_PRIORITY 50 |
---|
35 | static struct rtems_bsdnet_ifconfig netdriver_config = { |
---|
36 | RTEMS_BSP_NETWORK_DRIVER_NAME, |
---|
37 | RTEMS_BSP_NETWORK_DRIVER_ATTACH, |
---|
38 | }; |
---|
39 | |
---|
40 | struct rtems_bsdnet_config rtems_bsdnet_config = { |
---|
41 | &netdriver_config, /* Network interface */ |
---|
42 | rtems_bsdnet_do_bootp, /* Use BOOTP to get network configuration */ |
---|
43 | NETWORK_TASK_PRIORITY, /* Network task priority */ |
---|
44 | }; |
---|
45 | |
---|
46 | #ifdef SERVER |
---|
47 | #define T(x) __TXT(x) |
---|
48 | #define __TXT(s) #s |
---|
49 | static char *av[] = { |
---|
50 | "RPC client", |
---|
51 | T(SERVER), |
---|
52 | "Test Message", |
---|
53 | NULL |
---|
54 | }; |
---|
55 | #else |
---|
56 | static char *av[] = { |
---|
57 | "RPC server", |
---|
58 | NULL |
---|
59 | }; |
---|
60 | #endif |
---|
61 | static int ac = (sizeof av / sizeof av[0]) - 1; |
---|
62 | |
---|
63 | extern int rtems_main (int argc, char **argv); |
---|
64 | |
---|
65 | rtems_task |
---|
66 | Init (rtems_task_argument ignored) |
---|
67 | { |
---|
68 | rtems_bsdnet_initialize_network (); |
---|
69 | rtems_bsdnet_synchronize_ntp (0, 0); |
---|
70 | |
---|
71 | rtems_main (ac, av); |
---|
72 | printf ("*** RPC Test Finish ***\n"); |
---|
73 | exit (0); |
---|
74 | } |
---|
75 | |
---|
76 | /* |
---|
77 | * Dummy portmapper routines |
---|
78 | */ |
---|
79 | pmap_set () { ; } |
---|
80 | pmap_unset () { ; } |
---|