1 | /* |
---|
2 | * Shared Network Test Initialization File |
---|
3 | */ |
---|
4 | |
---|
5 | #ifndef RTEMS_BSD_TEST_DEFAULT_INIT_H |
---|
6 | #define RTEMS_BSD_TEST_DEFAULT_INIT_H |
---|
7 | |
---|
8 | #include <bsp.h> |
---|
9 | #include <assert.h> |
---|
10 | #include <stdlib.h> |
---|
11 | #include <stdio.h> |
---|
12 | #include <rtems/printer.h> |
---|
13 | #include <rtems/stackchk.h> |
---|
14 | #include <rtems/bsd/bsd.h> |
---|
15 | |
---|
16 | static void default_set_self_prio( rtems_task_priority prio ) |
---|
17 | { |
---|
18 | rtems_status_code sc; |
---|
19 | |
---|
20 | sc = rtems_task_set_priority(RTEMS_SELF, prio, &prio); |
---|
21 | assert(sc == RTEMS_SUCCESSFUL); |
---|
22 | } |
---|
23 | |
---|
24 | static void default_on_exit( int exit_code, void *arg ) |
---|
25 | { |
---|
26 | rtems_printer printer; |
---|
27 | |
---|
28 | rtems_print_printer_printf(&printer); |
---|
29 | rtems_stack_checker_report_usage_with_plugin(&printer); |
---|
30 | |
---|
31 | if ( exit_code == 0 ) { |
---|
32 | puts( "*** END OF TEST " TEST_NAME " ***" ); |
---|
33 | } |
---|
34 | } |
---|
35 | |
---|
36 | rtems_task Init( |
---|
37 | rtems_task_argument ignored |
---|
38 | ) |
---|
39 | { |
---|
40 | rtems_status_code sc; |
---|
41 | |
---|
42 | /* |
---|
43 | * Default the syslog priority to 'debug' to aid developers. |
---|
44 | */ |
---|
45 | rtems_bsd_setlogpriority("debug"); |
---|
46 | |
---|
47 | puts( "*** " TEST_NAME " TEST ***" ); |
---|
48 | |
---|
49 | /* |
---|
50 | * BSD must support the new "shared IRQ PIC implementation" at this point. |
---|
51 | * BSPs must also provide rtems_interrupt_server_initialize() which |
---|
52 | * just requires including irq-server.[ch] in their build. |
---|
53 | */ |
---|
54 | |
---|
55 | on_exit( default_on_exit, NULL ); |
---|
56 | |
---|
57 | #ifdef DEFAULT_EARLY_INITIALIZATION |
---|
58 | early_initialization(); |
---|
59 | #endif |
---|
60 | |
---|
61 | /* Let other tasks run to complete background work */ |
---|
62 | default_set_self_prio( RTEMS_MAXIMUM_PRIORITY - 2 ); |
---|
63 | |
---|
64 | rtems_bsd_initialize(); |
---|
65 | |
---|
66 | /* Let the callout timer allocate its resources */ |
---|
67 | sc = rtems_task_wake_after( 2 ); |
---|
68 | assert(sc == RTEMS_SUCCESSFUL); |
---|
69 | |
---|
70 | test_main(); |
---|
71 | /* should not return */ |
---|
72 | |
---|
73 | assert( 0 ); |
---|
74 | } |
---|
75 | |
---|
76 | /* |
---|
77 | * Configure RTEMS. |
---|
78 | */ |
---|
79 | #define CONFIGURE_MICROSECONDS_PER_TICK 1000 |
---|
80 | |
---|
81 | #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER |
---|
82 | #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER |
---|
83 | #define CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER |
---|
84 | #define CONFIGURE_APPLICATION_NEEDS_ZERO_DRIVER |
---|
85 | #define CONFIGURE_APPLICATION_NEEDS_LIBBLOCK |
---|
86 | |
---|
87 | #define CONFIGURE_MAXIMUM_DRIVERS 32 |
---|
88 | |
---|
89 | #define CONFIGURE_FILESYSTEM_DOSFS |
---|
90 | |
---|
91 | #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 32 |
---|
92 | |
---|
93 | #define CONFIGURE_MAXIMUM_USER_EXTENSIONS 1 |
---|
94 | |
---|
95 | #define CONFIGURE_UNLIMITED_OBJECTS |
---|
96 | #define CONFIGURE_UNIFIED_WORK_AREAS |
---|
97 | |
---|
98 | #define CONFIGURE_STACK_CHECKER_ENABLED |
---|
99 | |
---|
100 | #define CONFIGURE_BDBUF_BUFFER_MAX_SIZE (64 * 1024) |
---|
101 | #define CONFIGURE_BDBUF_CACHE_MEMORY_SIZE (256 * 1024) |
---|
102 | |
---|
103 | #define CONFIGURE_RTEMS_INIT_TASKS_TABLE |
---|
104 | |
---|
105 | #define CONFIGURE_INIT_TASK_STACK_SIZE (32 * 1024) |
---|
106 | #define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_DEFAULT_MODES |
---|
107 | #define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_FLOATING_POINT |
---|
108 | |
---|
109 | #define CONFIGURE_INIT |
---|
110 | |
---|
111 | #include <rtems/confdefs.h> |
---|
112 | |
---|
113 | /* |
---|
114 | * Configure LIBBSD device. |
---|
115 | */ |
---|
116 | #include <bsp/nexus-devices.h> |
---|
117 | |
---|
118 | /* |
---|
119 | * Configure RTEMS Shell. |
---|
120 | */ |
---|
121 | #define CONFIGURE_SHELL_COMMANDS_INIT |
---|
122 | |
---|
123 | #include <bsp/irq-info.h> |
---|
124 | |
---|
125 | #include <rtems/netcmds-config.h> |
---|
126 | |
---|
127 | #define CONFIGURE_SHELL_USER_COMMANDS \ |
---|
128 | &bsp_interrupt_shell_command, \ |
---|
129 | &rtems_shell_STTY_Command, \ |
---|
130 | &rtems_shell_SYSCTL_Command |
---|
131 | |
---|
132 | #define CONFIGURE_SHELL_COMMAND_CPUUSE |
---|
133 | #define CONFIGURE_SHELL_COMMAND_PERIODUSE |
---|
134 | #define CONFIGURE_SHELL_COMMAND_STACKUSE |
---|
135 | #define CONFIGURE_SHELL_COMMAND_PROFREPORT |
---|
136 | |
---|
137 | #define CONFIGURE_SHELL_COMMAND_CP |
---|
138 | #define CONFIGURE_SHELL_COMMAND_PWD |
---|
139 | #define CONFIGURE_SHELL_COMMAND_LS |
---|
140 | #define CONFIGURE_SHELL_COMMAND_LN |
---|
141 | #define CONFIGURE_SHELL_COMMAND_LSOF |
---|
142 | #define CONFIGURE_SHELL_COMMAND_CHDIR |
---|
143 | #define CONFIGURE_SHELL_COMMAND_CD |
---|
144 | #define CONFIGURE_SHELL_COMMAND_MKDIR |
---|
145 | #define CONFIGURE_SHELL_COMMAND_RMDIR |
---|
146 | #define CONFIGURE_SHELL_COMMAND_CAT |
---|
147 | #define CONFIGURE_SHELL_COMMAND_MV |
---|
148 | #define CONFIGURE_SHELL_COMMAND_RM |
---|
149 | #define CONFIGURE_SHELL_COMMAND_MALLOC_INFO |
---|
150 | |
---|
151 | #define CONFIGURE_SHELL_COMMAND_BLKSTATS |
---|
152 | #define CONFIGURE_SHELL_COMMAND_BLKSYNC |
---|
153 | #define CONFIGURE_SHELL_COMMAND_MOUNT |
---|
154 | #define CONFIGURE_SHELL_COMMAND_UNMOUNT |
---|
155 | |
---|
156 | #include <rtems/shellconfig.h> |
---|
157 | |
---|
158 | #endif /* RTEMS_BSD_TEST_DEFAULT_INIT_H */ |
---|