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/stackchk.h> |
---|
13 | #include <rtems/bsd/bsd.h> |
---|
14 | |
---|
15 | static void default_set_self_prio( rtems_task_priority prio ) |
---|
16 | { |
---|
17 | rtems_status_code sc; |
---|
18 | |
---|
19 | sc = rtems_task_set_priority(RTEMS_SELF, prio, &prio); |
---|
20 | assert(sc == RTEMS_SUCCESSFUL); |
---|
21 | } |
---|
22 | |
---|
23 | static void default_on_exit( int exit_code, void *arg ) |
---|
24 | { |
---|
25 | rtems_stack_checker_report_usage_with_plugin( |
---|
26 | NULL, |
---|
27 | rtems_printf_plugin |
---|
28 | ); |
---|
29 | |
---|
30 | if ( exit_code == 0 ) { |
---|
31 | puts( "*** END OF TEST " TEST_NAME " ***" ); |
---|
32 | } |
---|
33 | } |
---|
34 | |
---|
35 | rtems_task Init( |
---|
36 | rtems_task_argument ignored |
---|
37 | ) |
---|
38 | { |
---|
39 | rtems_status_code sc; |
---|
40 | |
---|
41 | puts( "*** " TEST_NAME " TEST ***" ); |
---|
42 | |
---|
43 | /* |
---|
44 | * BSD must support the new "shared IRQ PIC implementation" at this point. |
---|
45 | * BSPs must also provide rtems_interrupt_server_initialize() which |
---|
46 | * just requires including irq-server.[ch] in their build. |
---|
47 | */ |
---|
48 | |
---|
49 | on_exit( default_on_exit, NULL ); |
---|
50 | |
---|
51 | #ifdef DEFAULT_EARLY_INITIALIZATION |
---|
52 | early_initialization(); |
---|
53 | #endif |
---|
54 | |
---|
55 | /* Let other tasks run to complete background work */ |
---|
56 | default_set_self_prio( RTEMS_MAXIMUM_PRIORITY - 1 ); |
---|
57 | |
---|
58 | rtems_bsd_initialize(); |
---|
59 | |
---|
60 | /* Let the callout timer allocate its resources */ |
---|
61 | sc = rtems_task_wake_after( 2 ); |
---|
62 | assert(sc == RTEMS_SUCCESSFUL); |
---|
63 | |
---|
64 | test_main(); |
---|
65 | /* should not return */ |
---|
66 | |
---|
67 | assert( 0 ); |
---|
68 | } |
---|
69 | |
---|
70 | #include <machine/rtems-bsd-sysinit.h> |
---|
71 | |
---|
72 | SYSINIT_NEED_NET_PF_UNIX; |
---|
73 | SYSINIT_NEED_NET_IF_LAGG; |
---|
74 | SYSINIT_NEED_NET_IF_VLAN; |
---|
75 | |
---|
76 | #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER |
---|
77 | #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER |
---|
78 | #define CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER |
---|
79 | #define CONFIGURE_APPLICATION_NEEDS_ZERO_DRIVER |
---|
80 | #define CONFIGURE_APPLICATION_NEEDS_LIBBLOCK |
---|
81 | |
---|
82 | #define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM |
---|
83 | |
---|
84 | #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 32 |
---|
85 | |
---|
86 | #define CONFIGURE_MAXIMUM_USER_EXTENSIONS 1 |
---|
87 | |
---|
88 | #define CONFIGURE_UNLIMITED_ALLOCATION_SIZE 32 |
---|
89 | #define CONFIGURE_UNLIMITED_OBJECTS |
---|
90 | #define CONFIGURE_UNIFIED_WORK_AREAS |
---|
91 | |
---|
92 | #define CONFIGURE_STACK_CHECKER_ENABLED |
---|
93 | |
---|
94 | #define CONFIGURE_BDBUF_BUFFER_MAX_SIZE (64 * 1024) |
---|
95 | #define CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS 4 |
---|
96 | #define CONFIGURE_BDBUF_CACHE_MEMORY_SIZE (1 * 1024 * 1024) |
---|
97 | |
---|
98 | #define CONFIGURE_RTEMS_INIT_TASKS_TABLE |
---|
99 | |
---|
100 | #define CONFIGURE_INIT_TASK_STACK_SIZE (32 * 1024) |
---|
101 | #define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_DEFAULT_MODES |
---|
102 | #define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_FLOATING_POINT |
---|
103 | |
---|
104 | #define CONFIGURE_INIT |
---|
105 | |
---|
106 | #include <rtems/confdefs.h> |
---|
107 | |
---|
108 | #endif /* RTEMS_BSD_TEST_DEFAULT_INIT_H */ |
---|