source: rtems/testsuites/samples/fileio/system.h @ 8f71a36

4.104.114.84.95
Last change on this file since 8f71a36 was 8f71a36, checked in by Ralf Corsepius <ralf.corsepius@…>, on 04/20/04 at 07:09:31

Remove stray white spaces.

  • Property mode set to 100644
File size: 3.4 KB
RevLine 
[ac0a2af]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-1999.
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
[3e26377b]11 *  http://www.rtems.com/license/LICENSE.
[ac0a2af]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#include <libchip/ata.h> /* for ata driver prototype */
31#include <libchip/ide_ctrl.h> /* for general ide driver prototype */
32
33#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
34#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
35#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
36
37#define CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE
38
39#ifdef CONFIGURE_INIT
40rtems_driver_address_table Device_drivers[] =
41        {
42        CONSOLE_DRIVER_TABLE_ENTRY
43        ,CLOCK_DRIVER_TABLE_ENTRY
44#ifdef RTEMS_BSP_HAS_IDE_DRIVER
45        ,IDE_CONTROLLER_DRIVER_TABLE_ENTRY
46        /* important: ATA driver must be after ide drivers */
[8f71a36]47        ,ATA_DRIVER_TABLE_ENTRY
[ac0a2af]48#endif
49        };
50
51#include <rtems/bdbuf.h>
52rtems_bdbuf_config rtems_bdbuf_configuration[] = {
53  {512,128,NULL}
54};
55int rtems_bdbuf_configuration_size =( sizeof(rtems_bdbuf_configuration)
56                                     /sizeof(rtems_bdbuf_configuration[0]));
57#endif
58
59
60/*
61 * XXX: these values are higher than needed...
62 */
63#define CONFIGURE_MAXIMUM_TASKS             20
64#define CONFIGURE_MAXIMUM_SEMAPHORES        20
65#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES    20
66#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 20
67#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
68
69#define CONFIGURE_EXTRA_TASK_STACKS         (3 * RTEMS_MINIMUM_STACK_SIZE)
70
[c8fea7a]71#include <rtems/confdefs.h>
[ac0a2af]72
73/*
74 *  Handy macros and static inline functions
75 */
76
77/*
78 *  Macro to hide the ugliness of printing the time.
79 */
80
81#define print_time(_s1, _tb, _s2) \
82  do { \
83    printf( "%s%02d:%02d:%02d   %02d/%02d/%04d%s", \
84       _s1, (_tb)->hour, (_tb)->minute, (_tb)->second, \
85       (_tb)->month, (_tb)->day, (_tb)->year, _s2 ); \
86    fflush(stdout); \
87  } while ( 0 )
88
89/*
90 *  Macro to print an task name that is composed of ASCII characters.
91 *
92 */
93
94#define put_name( _name, _crlf ) \
95  do { \
[4c84d7b]96    uint32_t   c0, c1, c2, c3; \
[ac0a2af]97    \
98    c0 = ((_name) >> 24) & 0xff; \
99    c1 = ((_name) >> 16) & 0xff; \
100    c2 = ((_name) >> 8) & 0xff; \
101    c3 = (_name) & 0xff; \
102    putchar( (char)c0 ); \
103    if ( c1 ) putchar( (char)c1 ); \
104    if ( c2 ) putchar( (char)c2 ); \
105    if ( c3 ) putchar( (char)c3 ); \
106    if ( (_crlf) ) \
107      putchar( '\n' ); \
108  } while (0)
109
110/*
111 *  static inline routine to make obtaining ticks per second easier.
112 */
113
[4c84d7b]114static inline uint32_t   get_ticks_per_second( void )
[ac0a2af]115{
116  rtems_interval ticks_per_second;
117  (void) rtems_clock_get( RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticks_per_second );  return ticks_per_second;
118}
119
120
121/*
122 *  This allows us to view the "Test_task" instantiations as a set
123 *  of numbered tasks by eliminating the number of application
124 *  tasks created.
125 *
126 *  In reality, this is too complex for the purposes of this
127 *  example.  It would have been easier to pass a task argument. :)
128 *  But it shows how rtems_id's can sometimes be used.
129 */
130
131#define task_number( tid ) \
132  ( rtems_get_index( tid ) - \
133     rtems_configuration_get_rtems_api_configuration()->number_of_initialization_tasks )
134
135/* end of include file */
Note: See TracBrowser for help on using the repository browser.