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

4.104.115
Last change on this file since c0ec0d82 was c0ec0d82, checked in by Chris Johns <chrisj@…>, on 04/28/09 at 05:04:11

2009-04-28 Chris Johns <chrisj@…>

  • fileio/init.c, fileio/system.h, iostream/init.cc, loopback/init.c, pppd/init.c, pppd/pppdapp.c: Do not build if BSP_SMALL_MEMORY is defined. Remove this code once a better way is supported by the build system.
  • Property mode set to 100644
File size: 3.2 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-2008.
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#include <rtems/confdefs.h>
64
65/*
66 *  Handy macros and static inline functions
67 */
68
69/*
70 *  Macro to hide the ugliness of printing the time.
71 */
72
73#define print_time(_s1, _tb, _s2) \
74  do { \
75    printf( "%s%02d:%02d:%02d   %02d/%02d/%04d%s", \
76       _s1, (_tb)->hour, (_tb)->minute, (_tb)->second, \
77       (_tb)->month, (_tb)->day, (_tb)->year, _s2 ); \
78    fflush(stdout); \
79  } while ( 0 )
80
81/*
82 *  Macro to print an task name that is composed of ASCII characters.
83 *
84 */
85
86#define put_name( _name, _crlf ) \
87  do { \
88    uint32_t   c0, c1, c2, c3; \
89    \
90    c0 = ((_name) >> 24) & 0xff; \
91    c1 = ((_name) >> 16) & 0xff; \
92    c2 = ((_name) >> 8) & 0xff; \
93    c3 = (_name) & 0xff; \
94    putchar( (char)c0 ); \
95    if ( c1 ) putchar( (char)c1 ); \
96    if ( c2 ) putchar( (char)c2 ); \
97    if ( c3 ) putchar( (char)c3 ); \
98    if ( (_crlf) ) \
99      putchar( '\n' ); \
100  } while (0)
101
102/*
103 *  static inline routine to make obtaining ticks per second easier.
104 */
105
106static inline uint32_t   get_ticks_per_second( void )
107{
108  rtems_interval ticks_per_second;
109  (void) rtems_clock_get( RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticks_per_second );  return ticks_per_second;
110}
111
112
113/*
114 *  This allows us to view the "Test_task" instantiations as a set
115 *  of numbered tasks by eliminating the number of application
116 *  tasks created.
117 *
118 *  In reality, this is too complex for the purposes of this
119 *  example.  It would have been easier to pass a task argument. :)
120 *  But it shows how rtems_id's can sometimes be used.
121 */
122
123#define task_number( tid ) \
124  ( rtems_object_id_get_index( tid ) - \
125      rtems_configuration_get_rtems_api_configuration()-> \
126        number_of_initialization_tasks )
127
128/* end of include file */
Note: See TracBrowser for help on using the repository browser.