source: rtems/testsuites/samples/fileio/system.h @ 771803b

4.10
Last change on this file since 771803b was 771803b, checked in by Chris Johns <chrisj@…>, on 05/26/11 at 23:37:16

2011-05-27 Chris Johns <chrisj@…>

  • samples/fileio/init.c, samples/fileio/system.h: Add support for create a RAM disk from the shell to aid bug testing on the 4.10 branch.
  • Property mode set to 100644
File size: 3.3 KB
Line 
1/*  system.h
2 *
3 *  This include file contains information that is included in every
4 *  function in the test set.
5 *
6 *  COPYRIGHT (c) 1989-2009.
7 *  On-Line Applications Research Corporation (OAR).
8 *
9 *  The license and distribution terms for this file may be
10 *  found in the file LICENSE in this distribution or at
11 *  http://www.rtems.com/license/LICENSE.
12 *
13 *  system.h,v 1.13 2000/06/12 15:00:12 joel Exp
14 */
15
16#include <rtems.h>
17
18/* functions */
19
20rtems_task Init(
21  rtems_task_argument argument
22);
23
24/* global variables */
25
26
27/* configuration information */
28
29#include <bsp.h> /* for device driver prototypes */
30
31#define FILEIO_BUILD 1
32#if BSP_SMALL_MEMORY
33#undef FILEIO_BUILD
34#endif
35
36#if defined(RTEMS_BSP_HAS_IDE_DRIVER) && !BSP_SMALL_MEMORY
37#include <libchip/ata.h> /* for ata driver prototype */
38#include <libchip/ide_ctrl.h> /* for general ide driver prototype */
39#endif
40
41#define CONFIGURE_MAXIMUM_DRIVERS           4
42#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
43#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
44#ifdef RTEMS_BSP_HAS_IDE_DRIVER
45#define CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER
46#define CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
47#define CONFIGURE_ATA_DRIVER_TASK_PRIORITY  14
48#endif
49#define CONFIGURE_APPLICATION_NEEDS_LIBBLOCK
50#define CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS  2
51#define CONFIGURE_BDBUF_MAX_WRITE_BLOCKS       8
52#define CONFIGURE_SWAPOUT_TASK_PRIORITY        15
53#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
54#define CONFIGURE_FILESYSTEM_RFS
55#define CONFIGURE_FILESYSTEM_DOSFS
56
57/*
58 * XXX: these values are higher than needed...
59 */
60#define CONFIGURE_MAXIMUM_TASKS             20
61#define CONFIGURE_MAXIMUM_SEMAPHORES        20
62#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES    20
63#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 20
64#define CONFIGURE_STACK_CHECKER_ENABLED
65#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
66
67#define CONFIGURE_EXTRA_TASK_STACKS         (6 * RTEMS_MINIMUM_STACK_SIZE)
68
69#define CONFIGURE_MALLOC_STATISTICS
70
71#define CONFIGURE_UNIFIED_WORK_AREAS
72#include <rtems/confdefs.h>
73
74/*
75 *  Handy macros and static inline functions
76 */
77
78/*
79 *  Macro to hide the ugliness of printing the time.
80 */
81
82#define print_time(_s1, _tb, _s2) \
83  do { \
84    printf( "%s%02d:%02d:%02d   %02d/%02d/%04d%s", \
85       _s1, (_tb)->hour, (_tb)->minute, (_tb)->second, \
86       (_tb)->month, (_tb)->day, (_tb)->year, _s2 ); \
87    fflush(stdout); \
88  } while ( 0 )
89
90/*
91 *  Macro to print an task name that is composed of ASCII characters.
92 *
93 */
94
95#define put_name( _name, _crlf ) \
96  do { \
97    uint32_t   c0, c1, c2, c3; \
98    \
99    c0 = ((_name) >> 24) & 0xff; \
100    c1 = ((_name) >> 16) & 0xff; \
101    c2 = ((_name) >> 8) & 0xff; \
102    c3 = (_name) & 0xff; \
103    putchar( (char)c0 ); \
104    if ( c1 ) putchar( (char)c1 ); \
105    if ( c2 ) putchar( (char)c2 ); \
106    if ( c3 ) putchar( (char)c3 ); \
107    if ( (_crlf) ) \
108      putchar( '\n' ); \
109  } while (0)
110
111/*
112 *  This allows us to view the "Test_task" instantiations as a set
113 *  of numbered tasks by eliminating the number of application
114 *  tasks created.
115 *
116 *  In reality, this is too complex for the purposes of this
117 *  example.  It would have been easier to pass a task argument. :)
118 *  But it shows how rtems_id's can sometimes be used.
119 */
120
121#define task_number( tid ) \
122  ( rtems_object_id_get_index( tid ) - \
123      rtems_configuration_get_rtems_api_configuration()-> \
124        number_of_initialization_tasks )
125
126/* end of include file */
Note: See TracBrowser for help on using the repository browser.