source: rtems-libbsd/testsuite/include/rtems/bsd/test/default-init.h @ f01b1f72

5-freebsd-12freebsd-9.3
Last change on this file since f01b1f72 was f01b1f72, checked in by Chris Johns <chrisj@…>, on Jun 30, 2016 at 1:42:49 AM

Add RTEMS_BSD_CONFIG_DOMAIN_PAGE_MBUFS_SIZE.

The domain allocator page abd mbuf size can be configured by the
user using RTEMS_BSD_CONFIG_DOMAIN_PAGE_MBUFS_SIZE.

  • Property mode set to 100644
File size: 2.7 KB
Line 
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
16static 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
24static 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
36rtems_task Init(
37  rtems_task_argument ignored
38)
39{
40  rtems_status_code sc;
41
42  puts( "*** " TEST_NAME " TEST ***" );
43
44  /*
45   *  BSD must support the new "shared IRQ PIC implementation" at this point.
46   *  BSPs must also provide rtems_interrupt_server_initialize() which
47   *  just requires including irq-server.[ch] in their build.
48   */
49
50  on_exit( default_on_exit, NULL );
51
52#ifdef DEFAULT_EARLY_INITIALIZATION
53  early_initialization();
54#endif
55
56  /* Let other tasks run to complete background work */
57  default_set_self_prio( RTEMS_MAXIMUM_PRIORITY - 1 );
58
59  rtems_bsd_initialize();
60
61  /* Let the callout timer allocate its resources */
62  sc = rtems_task_wake_after( 2 );
63  assert(sc == RTEMS_SUCCESSFUL);
64
65  test_main();
66  /* should not return */
67
68  assert( 0 );
69}
70
71/*
72 * Configure LibBSD.
73 */
74#define RTEMS_BSD_CONFIG_NET_PF_UNIX
75#define RTEMS_BSD_CONFIG_NET_IF_LAGG
76#define RTEMS_BSD_CONFIG_NET_IF_VLAN
77#define RTEMS_BSD_CONFIG_INIT
78
79#include <machine/rtems-bsd-config.h>
80
81/*
82 * Configure RTEMS.
83 */
84#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
85#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
86#define CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER
87#define CONFIGURE_APPLICATION_NEEDS_ZERO_DRIVER
88#define CONFIGURE_APPLICATION_NEEDS_LIBBLOCK
89
90#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
91
92#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 32
93
94#define CONFIGURE_MAXIMUM_USER_EXTENSIONS 1
95
96#define CONFIGURE_UNLIMITED_ALLOCATION_SIZE 32
97#define CONFIGURE_UNLIMITED_OBJECTS
98#define CONFIGURE_UNIFIED_WORK_AREAS
99
100#define CONFIGURE_STACK_CHECKER_ENABLED
101
102#define CONFIGURE_BDBUF_BUFFER_MAX_SIZE (64 * 1024)
103#define CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS 4
104#define CONFIGURE_BDBUF_CACHE_MEMORY_SIZE (1 * 1024 * 1024)
105
106#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
107
108#define CONFIGURE_INIT_TASK_STACK_SIZE (32 * 1024)
109#define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_DEFAULT_MODES
110#define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_FLOATING_POINT
111
112#define CONFIGURE_INIT
113
114#include <rtems/confdefs.h>
115
116#endif /* RTEMS_BSD_TEST_DEFAULT_INIT_H */
Note: See TracBrowser for help on using the repository browser.