source: rtems/testsuites/samples/fileio/system.h @ de90869d

4.104.115
Last change on this file since de90869d was efc6c73, checked in by Joel Sherrill <joel.sherrill@…>, on 08/10/09 at 13:33:17

2009-08-10 Joel Sherrill <joel.sherrill@…>

  • fileio/system.h: Switch to unified work area.
  • 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_APPLICATION_NEEDS_CONSOLE_DRIVER
42#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
43#ifdef RTEMS_BSP_HAS_IDE_DRIVER
44#define CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER
45#endif
46#define CONFIGURE_APPLICATION_NEEDS_LIBBLOCK
47#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
48
49/*
50 * XXX: these values are higher than needed...
51 */
52#define CONFIGURE_MAXIMUM_TASKS             20
53#define CONFIGURE_MAXIMUM_SEMAPHORES        20
54#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES    20
55#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 20
56#define CONFIGURE_STACK_CHECKER_ENABLED
57#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
58
59#define CONFIGURE_EXTRA_TASK_STACKS         (6 * RTEMS_MINIMUM_STACK_SIZE)
60
61#define CONFIGURE_MALLOC_STATISTICS
62
63#define CONFIGURE_UNIFIED_WORK_AREAS
64#include <rtems/confdefs.h>
65
66/*
67 *  Handy macros and static inline functions
68 */
69
70/*
71 *  Macro to hide the ugliness of printing the time.
72 */
73
74#define print_time(_s1, _tb, _s2) \
75  do { \
76    printf( "%s%02d:%02d:%02d   %02d/%02d/%04d%s", \
77       _s1, (_tb)->hour, (_tb)->minute, (_tb)->second, \
78       (_tb)->month, (_tb)->day, (_tb)->year, _s2 ); \
79    fflush(stdout); \
80  } while ( 0 )
81
82/*
83 *  Macro to print an task name that is composed of ASCII characters.
84 *
85 */
86
87#define put_name( _name, _crlf ) \
88  do { \
89    uint32_t   c0, c1, c2, c3; \
90    \
91    c0 = ((_name) >> 24) & 0xff; \
92    c1 = ((_name) >> 16) & 0xff; \
93    c2 = ((_name) >> 8) & 0xff; \
94    c3 = (_name) & 0xff; \
95    putchar( (char)c0 ); \
96    if ( c1 ) putchar( (char)c1 ); \
97    if ( c2 ) putchar( (char)c2 ); \
98    if ( c3 ) putchar( (char)c3 ); \
99    if ( (_crlf) ) \
100      putchar( '\n' ); \
101  } while (0)
102
103/*
104 *  static inline routine to make obtaining ticks per second easier.
105 */
106
107static inline uint32_t   get_ticks_per_second( void )
108{
109  rtems_interval ticks_per_second;
110  (void) rtems_clock_get( RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticks_per_second );  return ticks_per_second;
111}
112
113
114/*
115 *  This allows us to view the "Test_task" instantiations as a set
116 *  of numbered tasks by eliminating the number of application
117 *  tasks created.
118 *
119 *  In reality, this is too complex for the purposes of this
120 *  example.  It would have been easier to pass a task argument. :)
121 *  But it shows how rtems_id's can sometimes be used.
122 */
123
124#define task_number( tid ) \
125  ( rtems_object_id_get_index( tid ) - \
126      rtems_configuration_get_rtems_api_configuration()-> \
127        number_of_initialization_tasks )
128
129/* end of include file */
Note: See TracBrowser for help on using the repository browser.