source: rtems/cpukit/include/rtems/confdefs/iodrivers.h @ 470dfa1f

Last change on this file since 470dfa1f was 470dfa1f, checked in by Sebastian Huber <sebastian.huber@…>, on Feb 25, 2020 at 12:49:45 PM

config: Resurrect NULL_DRIVER_TABLE_ENTRY

This define may be used by application configurations for the
CONFIGURE_APPLICATION_EXTRA_DRIVERS definition.

Update #3875.

  • Property mode set to 100644
File size: 5.3 KB
Line 
1/* SPDX-License-Identifier: BSD-2-Clause */
2
3/**
4 * @file
5 *
6 * @ingroup RTEMSApplicationConfiguration
7 *
8 * @brief Evaluate IO Driver Configuration Options
9 */
10
11/*
12 * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
13 *
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions
16 * are met:
17 * 1. Redistributions of source code must retain the above copyright
18 *    notice, this list of conditions and the following disclaimer.
19 * 2. Redistributions in binary form must reproduce the above copyright
20 *    notice, this list of conditions and the following disclaimer in the
21 *    documentation and/or other materials provided with the distribution.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 * POSSIBILITY OF SUCH DAMAGE.
34 */
35
36#ifndef _RTEMS_CONFDEFS_IODRIVERS_H
37#define _RTEMS_CONFDEFS_IODRIVERS_H
38
39#ifndef __CONFIGURATION_TEMPLATE_h
40#error "Do not include this file directly, use <rtems/confdefs.h> instead"
41#endif
42
43#ifdef CONFIGURE_INIT
44
45#include <rtems/ioimpl.h>
46
47#ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
48  #if defined(CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER) \
49    || defined(CONFIGURE_APPLICATION_NEEDS_SIMPLE_TASK_CONSOLE_DRIVER)
50    #error "CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER, CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER, and CONFIGURE_APPLICATION_NEEDS_SIMPLE_TASK_CONSOLE_DRIVER are mutually exclusive"
51  #endif
52
53  #include <rtems/console.h>
54#endif
55
56#ifdef CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
57  #include <rtems/btimer.h>
58#endif
59
60#ifdef CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER
61  #include <rtems/rtc.h>
62#endif
63
64#ifdef CONFIGURE_APPLICATION_NEEDS_WATCHDOG_DRIVER
65  #include <rtems/watchdogdrv.h>
66#endif
67
68#ifdef CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER
69  #include <rtems/framebuffer.h>
70#endif
71
72#ifdef CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER
73  #include <rtems/devnull.h>
74#endif
75
76#ifdef CONFIGURE_APPLICATION_NEEDS_ZERO_DRIVER
77  #include <rtems/devzero.h>
78#endif
79
80#ifdef CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER
81  #ifndef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
82    #define CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
83  #endif
84
85  #include <libchip/ide_ctrl.h>
86#endif
87
88#ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
89  #include <libchip/ata.h>
90#endif
91
92#ifndef CONFIGURE_MAXIMUM_DRIVERS
93  #define CONFIGURE_MAXIMUM_DRIVERS
94#endif
95
96#define NULL_DRIVER_TABLE_ENTRY { NULL, NULL, NULL, NULL, NULL, NULL }
97
98#ifdef __cplusplus
99extern "C" {
100#endif
101
102rtems_driver_address_table
103_IO_Driver_address_table[ CONFIGURE_MAXIMUM_DRIVERS ] = {
104  #ifdef CONFIGURE_BSP_PREREQUISITE_DRIVERS
105    CONFIGURE_BSP_PREREQUISITE_DRIVERS,
106  #endif
107  #ifdef CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS
108    CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS,
109  #endif
110  #ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
111    CONSOLE_DRIVER_TABLE_ENTRY,
112  #endif
113  #ifdef CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER
114    RTC_DRIVER_TABLE_ENTRY,
115  #endif
116  #ifdef CONFIGURE_APPLICATION_NEEDS_WATCHDOG_DRIVER
117    WATCHDOG_DRIVER_TABLE_ENTRY,
118  #endif
119  #ifdef CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER
120    DEVNULL_DRIVER_TABLE_ENTRY,
121  #endif
122  #ifdef CONFIGURE_APPLICATION_NEEDS_ZERO_DRIVER
123    DEVZERO_DRIVER_TABLE_ENTRY,
124  #endif
125  #ifdef CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER
126    IDE_CONTROLLER_DRIVER_TABLE_ENTRY,
127  #endif
128  #ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
129    ATA_DRIVER_TABLE_ENTRY,
130  #endif
131  #ifdef CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER
132    FRAME_BUFFER_DRIVER_TABLE_ENTRY,
133  #endif
134  #ifdef CONFIGURE_APPLICATION_EXTRA_DRIVERS
135    CONFIGURE_APPLICATION_EXTRA_DRIVERS,
136  #endif
137  #if defined(CONFIGURE_APPLICATION_NEEDS_NULL_DRIVER) \
138    || ( !defined(CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER) \
139      && !defined(CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER) \
140      && !defined(CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER) \
141      && !defined(CONFIGURE_APPLICATION_NEEDS_ZERO_DRIVER) \
142      && !defined(CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER) \
143      && !defined(CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER) \
144      && !defined(CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER) \
145      && !defined(CONFIGURE_APPLICATION_EXTRA_DRIVERS) )
146    NULL_DRIVER_TABLE_ENTRY
147  #endif
148};
149
150const size_t _IO_Number_of_drivers =
151  RTEMS_ARRAY_SIZE( _IO_Driver_address_table );
152
153#ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
154  #ifndef CONFIGURE_ATA_DRIVER_TASK_PRIORITY
155    #define CONFIGURE_ATA_DRIVER_TASK_PRIORITY ATA_DRIVER_TASK_DEFAULT_PRIORITY
156  #endif
157
158  rtems_task_priority rtems_ata_driver_task_priority
159    = CONFIGURE_ATA_DRIVER_TASK_PRIORITY;
160#endif
161
162#ifdef __cplusplus
163}
164#endif
165
166#endif /* CONFIGURE_INIT */
167
168#endif /* _RTEMS_CONFDEFS_IODRIVERS_H */
Note: See TracBrowser for help on using the repository browser.