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

5-freebsd-12freebsd-9.3
Last change on this file since 32fd702 was 32fd702, checked in by Sebastian Huber <sebastian.huber@…>, on Jun 23, 2016 at 12:06:21 PM

Update due to RTEMS printer API changes

  • Property mode set to 100644
File size: 2.6 KB
RevLine 
[2e2d441]1/*
[7d69fb3]2 *  Shared Network Test Initialization File
[2e2d441]3 */
4
[e599318]5#ifndef RTEMS_BSD_TEST_DEFAULT_INIT_H
6#define RTEMS_BSD_TEST_DEFAULT_INIT_H
7
[2e2d441]8#include <bsp.h>
[fafa9e2]9#include <assert.h>
[2e2d441]10#include <stdlib.h>
11#include <stdio.h>
[32fd702]12#include <rtems/printer.h>
[fafa9e2]13#include <rtems/stackchk.h>
[e599318]14#include <rtems/bsd/bsd.h>
[71703fe]15
[fafa9e2]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{
[92e9493]26  rtems_printer printer;
27
28  rtems_print_printer_printf(&printer);
29  rtems_stack_checker_report_usage_with_plugin(&printer);
[fafa9e2]30
31  if ( exit_code == 0 ) {
32    puts( "*** END OF TEST " TEST_NAME " ***" );
33  }
34}
35
[2e2d441]36rtems_task Init(
37  rtems_task_argument ignored
38)
39{
[fafa9e2]40  rtems_status_code sc;
41
[e599318]42  puts( "*** " TEST_NAME " TEST ***" );
[71703fe]43
[336762e]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
[fafa9e2]50  on_exit( default_on_exit, NULL );
51
[d0ecc91]52#ifdef DEFAULT_EARLY_INITIALIZATION
53  early_initialization();
54#endif
55
[fafa9e2]56  /* Let other tasks run to complete background work */
57  default_set_self_prio( RTEMS_MAXIMUM_PRIORITY - 1 );
58
[e51bc97]59  rtems_bsd_initialize();
[3be460f]60
[fafa9e2]61  /* Let the callout timer allocate its resources */
62  sc = rtems_task_wake_after( 2 );
63  assert(sc == RTEMS_SUCCESSFUL);
64
[71703fe]65  test_main();
66  /* should not return */
67
[fafa9e2]68  assert( 0 );
[2e2d441]69}
70
[263c947]71#include <machine/rtems-bsd-sysinit.h>
72
73SYSINIT_NEED_NET_PF_UNIX;
[49b9c5e]74SYSINIT_NEED_NET_IF_LAGG;
[012c263]75SYSINIT_NEED_NET_IF_VLAN;
[f3f816c]76
77#include <bsp/nexus-devices.h>
[2e2d441]78
[3cde755]79#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
[2e2d441]80#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
[263c947]81#define CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER
82#define CONFIGURE_APPLICATION_NEEDS_ZERO_DRIVER
[3cde755]83#define CONFIGURE_APPLICATION_NEEDS_LIBBLOCK
[263c947]84
[3cde755]85#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
86
87#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 32
88
[ab415f9]89#define CONFIGURE_MAXIMUM_USER_EXTENSIONS 1
90
[795c5e6]91#define CONFIGURE_UNLIMITED_ALLOCATION_SIZE 32
[3cde755]92#define CONFIGURE_UNLIMITED_OBJECTS
93#define CONFIGURE_UNIFIED_WORK_AREAS
94
[025d8f2]95#define CONFIGURE_STACK_CHECKER_ENABLED
96
[293fefa]97#define CONFIGURE_BDBUF_BUFFER_MAX_SIZE (64 * 1024)
98#define CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS 4
99#define CONFIGURE_BDBUF_CACHE_MEMORY_SIZE (1 * 1024 * 1024)
100
[2e2d441]101#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
102
[263c947]103#define CONFIGURE_INIT_TASK_STACK_SIZE (32 * 1024)
[a1e0a41]104#define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_DEFAULT_MODES
[4b8bc5c]105#define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_FLOATING_POINT
[a1e0a41]106
[2e2d441]107#define CONFIGURE_INIT
[9c99de7]108
[263c947]109#include <rtems/confdefs.h>
[4f6cf1e]110
[e599318]111#endif /* RTEMS_BSD_TEST_DEFAULT_INIT_H */
Note: See TracBrowser for help on using the repository browser.