source: rtems-libbsd/rtemsbsd/include/machine/rtems-bsd-config.h @ ae9e46d

55-freebsd-126-freebsd-12
Last change on this file since ae9e46d was 045ff6e, checked in by Sebastian Huber <sebastian.huber@…>, on 02/21/17 at 14:26:31

Add poll() and select() support for Termios

  • Property mode set to 100644
File size: 7.7 KB
Line 
1/*
2 * Copyright (c) 2016 Chris Johns <chrisj@rtems.org>.  All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 *    notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 *    notice, this list of conditions and the following disclaimer in the
11 *    documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 * SUCH DAMAGE.
24 */
25
26/*
27 * Configure the LibBSD software stack.
28 *
29 * Configuration defines:
30 *
31 *  RTEMS_BSD_CONFIG_DOMAIN_PAGE_MBUFS_SIZE : Memory in bytes for mbufs
32 *  RTEMS_BSD_CONFIG_NET_PF_UNIX            : Packet Filter.
33 *  RTEMS_BSD_CONFIG_NET_IF_LAGG            : Link Aggregetion and Failover.
34 *  RTEMS_BSD_CONFIG_NET_IF_VLAN            : Virtual LAN.
35 *  RTEMS_BSD_CONFIG_SERVICE_TELNETD        : Telnet Protocol (TELNET).
36 *   RTEMS_BSD_CONFIG_TELNETD_STACK_SIZE    : Telnet shell task stack size.
37 *  RTEMS_BSD_CONFIG_SERVICE_FTPD           : File Transfer Protocol (FTP).
38 *  RTEMS_BSD_CONFIG_BSP_CONFIG             : Configure default BSP devices.
39 *  RTEMS_BSD_CONFIG_INIT                   : Configure the LibBSD support.
40 *
41 * Rules for adding to this file:
42 *  1. All user visible defines start with 'RTEMS_BSD_CONFIG_'.
43 *  2. Define an implementation define starting with 'RTEMS_BSD_CFGDECL_'.
44 *  3. Only declare anything in the 'RTEMS_BSD_CONFIG_INIT' section.
45 *  4. Do not use '#ifdef ..' or '#ifndef ..'.
46 *  5. All '#endif' statements need a comment showing the '#if ..' logic.
47 */
48
49#ifndef _RTEMS_BSD_CONFIG_h
50#define _RTEMS_BSD_CONFIG_h
51
52#include <stdbool.h>
53
54/*
55 * Include the Nexus bus.
56 */
57#include <machine/rtems-bsd-nexus-bus.h>
58
59/*
60 * Include the SYSINIT support.
61 */
62#include <machine/rtems-bsd-sysinit.h>
63
64/*
65 * Include the services.
66 */
67#include <machine/rtems-bsd-rc-conf-services.h>
68
69/*
70 * Include the RTEMS BSD support.
71 */
72#include <rtems/bsd/bsd.h>
73
74#ifdef __cplusplus
75extern "C" {
76#endif /* __cplusplus */
77
78/*
79 * BSD Kernel configuration.
80 */
81#if defined(RTEMS_BSD_CONFIG_DOMAIN_PAGE_MBUFS_SIZE)
82  #define RTEMS_BSD_CFGDECL_DOMAIN_PAGE_MBUFS_SIZE RTEMS_BSD_CONFIG_DOMAIN_PAGE_MBUFS_SIZE
83#else
84  #define RTEMS_BSD_CFGDECL_DOMAIN_PAGE_MBUFS_SIZE RTEMS_BSD_ALLOCATOR_DOMAIN_PAGE_MBUF_DEFAULT
85#endif
86
87/*
88 * BSD Kernel modules.
89 */
90
91/*
92 * Unix packet filter.
93 *  https://www.freebsd.org/doc/handbook/firewalls-pf.html
94 */
95#if defined(RTEMS_BSD_CONFIG_NET_PF_UNIX)
96  #define RTEMS_BSD_CFGDECL_NET_PF_UNIX SYSINIT_NEED_NET_PF_UNIX
97#else
98  #define RTEMS_BSD_CFGDECL_NET_PF_UNIX
99#endif /* RTEMS_BSD_CONFIG_NET_PF_UNIX */
100
101#if defined(RTEMS_BSD_CONFIG_NET_IP_MROUTE)
102  #define RTEMS_BSD_CFGDECL_NET_IP_MROUTE SYSINIT_NEED_NET_IP_MROUTE
103#else
104  #define RTEMS_BSD_CFGDECL_NET_IP_MROUTE
105#endif /* RTEMS_BSD_CONFIG_NET_IP_MROUTE */
106
107#if defined(RTEMS_BSD_CONFIG_NET_IP6_MROUTE)
108  #define RTEMS_BSD_CFGDECL_NET_IP6_MROUTE SYSINIT_NEED_NET_IP6_MROUTE
109#else
110  #define RTEMS_BSD_CFGDECL_NET_IP6_MROUTE
111#endif /* RTEMS_BSD_CONFIG_NET_IP6_MROUTE */
112
113/*
114 * Bridging.
115 *  https://www.freebsd.org/doc/handbook/network-bridging.html
116 */
117#if defined(RTEMS_BSD_CONFIG_NET_IF_BRIDGE)
118  #define RTEMS_BSD_CFGDECL_NET_IF_BRIDGE SYSINIT_NEED_NET_IF_BRIDGE
119#else
120  #define RTEMS_BSD_CFGDECL_NET_IF_BRIDGE
121#endif /* RTEMS_BSD_CONFIG_NET_IF_BRIDGE */
122
123/*
124 * Link Aggregation and Failover.
125 *  https://www.freebsd.org/doc/handbook/network-aggregation.html
126 */
127#if defined(RTEMS_BSD_CONFIG_NET_IF_LAGG)
128  #define RTEMS_BSD_CFGDECL_NET_IF_LAGG SYSINIT_NEED_NET_IF_LAGG
129#else
130  #define RTEMS_BSD_CFGDECL_NET_IF_LAGG
131#endif /* RTEMS_BSD_CONFIG_NET_IF_LAGG */
132
133/*
134 * Virtual LAN
135 *  https://www.freebsd.org/cgi/man.cgi?query=rc.conf then 'network_interfaces'.
136 */
137#if defined(RTEMS_BSD_CONFIG_NET_IF_VLAN)
138  #define RTEMS_BSD_CFGDECL_NET_IF_VLAN SYSINIT_NEED_NET_IF_VLAN
139#else
140  #define RTEMS_BSD_CFGDECL_NET_IF_VLAN
141#endif /* RTEMS_BSD_CONFIG_NET_IF_VLAN */
142
143/*
144 * Firewall PF
145 */
146#if defined(RTEMS_BSD_CONFIG_FIREWALL_PF)
147  #define RTEMS_BSD_CFGDECL_FIREWALL_PF SYSINIT_NEED_FIREWALL_PF
148  #define RTEMS_BSD_CFGDECL_FIREWALL_PF_SERVICE \
149      RTEMS_BSD_RC_CONF_SYSINT(rc_conf_firewall_pf)
150#else
151  #define RTEMS_BSD_CFGDECL_FIREWALL_PF
152  #define RTEMS_BSD_CFGDECL_FIREWALL_PF_SERVICE
153#endif /* RTEMS_BSD_CONFIG_FIREWALL_PF */
154
155#if defined(RTEMS_BSD_CONFIG_FIREWALL_PFLOG)
156  #define RTEMS_BSD_CFGDECL_FIREWALL_PFLOG SYSINIT_NEED_FIREWALL_PFLOG
157#else
158  #define RTEMS_BSD_CFGDECL_FIREWALL_PFLOG
159#endif /* RTEMS_BSD_CONFIG_FIREWALL_PFLOG */
160
161#if defined(RTEMS_BSD_CONFIG_FIREWALL_PFSYNC)
162  #define RTEMS_BSD_CFGDECL_FIREWALL_PFSYNC SYSINIT_NEED_FIREWALL_PFSYNC
163#else
164  #define RTEMS_BSD_CFGDECL_FIREWALL_PFSYNC
165#endif /* RTEMS_BSD_CONFIG_FIREWALL_PFSYNC */
166
167/*
168 * FTPD
169 */
170#if defined(RTEMS_BSD_CONFIG_SERVICE_FTPD)
171  #define RTEMS_BSD_CFGDECL_FTPD RTEMS_BSD_RC_CONF_SYSINT(rc_conf_ftpd)
172#else
173  #define RTEMS_BSD_CFGDECL_FTPD
174#endif /* RTEMS_BSD_CONFIG_SERVICE_FTPD */
175
176/*
177 * Telnetd
178 */
179#if defined(RTEMS_BSD_CONFIG_SERVICE_TELNETD)
180  #if !defined(RTEMS_BSD_CONFIG_TELNETD_STACK_SIZE)
181    #define RTEMS_BSD_CONFIG_TELNETD_STACK_SIZE (8 * 1024)
182  #endif /* RTEMS_BSD_CONFIG_TELNETD_STACK_SIZE */
183  #define RTEMS_BSD_CFGDECL_TELNETD_STACK_SIZE \
184    int rtems_telnetd_stack_size = RTEMS_BSD_CONFIG_TELNETD_STACK_SIZE
185  #define RTEMS_BSD_CFGDECL_TELNETD RTEMS_BSD_RC_CONF_SYSINT(rc_conf_telnetd)
186#else
187  #define RTEMS_BSD_CFGDECL_TELNETD_STACK_SIZE
188  #define RTEMS_BSD_CFGDECL_TELNETD
189#endif /* RTEMS_BSD_CONFIG_SERVICE_TELNETD */
190
191/*
192 * Termios
193 */
194#if defined(RTEMS_BSD_CONFIG_TERMIOS_KQUEUE_AND_POLL)
195  #define RTEMS_BSD_CFGDECL_TERMIOS_KQUEUE_AND_POLL SYSINIT_REFERENCE(termioskqueuepoll)
196#else
197  #define RTEMS_BSD_CFGDECL_TERMIOS_KQUEUE_AND_POLL
198#endif /* RTEMS_BSD_CONFIG_TERMIOS_KQUEUE_AND_POLL */
199
200/*
201 * Configure the system.
202 */
203#if defined(RTEMS_BSD_CONFIG_INIT)
204  /*
205   * Configure the domain allocation memory size.
206   */
207  uintptr_t rtems_bsd_allocator_domain_page_mbuf_size = \
208    RTEMS_BSD_CFGDECL_DOMAIN_PAGE_MBUFS_SIZE;
209
210  /*
211   * If a BSP configuration is requested include the Nexus bus BSP
212   * configuration.
213   */
214  #if defined(RTEMS_BSD_CONFIG_BSP_CONFIG)
215    #include <bsp/nexus-devices.h>
216  #endif /* RTEMS_BSD_CONFIG_BSP_CONFIG */
217
218  /*
219   * Create the networking modules and interfaces.
220   */
221  RTEMS_BSD_CFGDECL_NET_PF_UNIX;
222  RTEMS_BSD_CFGDECL_NET_IP_MROUTE;
223  RTEMS_BSD_CFGDECL_NET_IP6_MROUTE;
224  RTEMS_BSD_CFGDECL_NET_IF_BRIDGE;
225  RTEMS_BSD_CFGDECL_NET_IF_LAGG;
226  RTEMS_BSD_CFGDECL_NET_IF_VLAN;
227
228  /*
229   * Create the firewall
230   */
231  RTEMS_BSD_CFGDECL_FIREWALL_PF;
232  RTEMS_BSD_CFGDECL_FIREWALL_PF_SERVICE;
233  RTEMS_BSD_CFGDECL_FIREWALL_PFLOG;
234  RTEMS_BSD_CFGDECL_FIREWALL_PFSYNC;
235
236  /*
237   * Create the services.
238   */
239  RTEMS_BSD_CFGDECL_TELNETD;
240  RTEMS_BSD_CFGDECL_TELNETD_STACK_SIZE;
241  RTEMS_BSD_CFGDECL_FTPD;
242
243  RTEMS_BSD_CFGDECL_TERMIOS_KQUEUE_AND_POLL;
244#endif /* RTEMS_BSD_CONFIG_INIT */
245
246#ifdef __cplusplus
247}
248#endif /* __cplusplus */
249
250#endif /* _RTEMS_BSD_CONFIG_h */
Note: See TracBrowser for help on using the repository browser.