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

55-freebsd-126-freebsd-12freebsd-9.3
Last change on this file since f01b1f72 was f01b1f72, checked in by Chris Johns <chrisj@…>, on 06/30/16 at 01:42:49

Add RTEMS_BSD_CONFIG_DOMAIN_PAGE_MBUFS_SIZE.

The domain allocator page abd mbuf size can be configured by the
user using RTEMS_BSD_CONFIG_DOMAIN_PAGE_MBUFS_SIZE.

  • Property mode set to 100644
File size: 4.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_FTPD           : File Transfer Protocol (FTP).
36 *  RTEMS_BSD_CONFIG_BSP_CONFIG             : Configure default BSP devices.
37 *  RTEMS_BSD_CONFIG_INIT                   : Configure the LibBSD support.
38 *
39 * Rules for adding to this file:
40 *  1. All user visible defines start with 'RTEMS_BSD_CONFIG_'.
41 *  2. Define an implementation define starting with 'RTEMS_BSD_CFGDECL_'.
42 *  3. Only declare anything in the 'RTEMS_BSD_CONFIG_INIT' section.
43 *  4. Do not use '#ifdef ..' or '#ifndef ..'.
44 *  5. All '#endif' statements need a comment showing the '#if ..' logic.
45 */
46
47#ifndef _RTEMS_BSD_CONFIG_h
48#define _RTEMS_BSD_CONFIG_h
49
50#include <stdbool.h>
51
52/*
53 * Include the Nexus bus.
54 */
55#include <machine/rtems-bsd-nexus-bus.h>
56
57/*
58 * Include the SYSINIT support.
59 */
60#include <machine/rtems-bsd-sysinit.h>
61
62/*
63 * Include the services.
64 */
65#include <machine/rtems-bsd-rc-conf-services.h>
66
67/*
68 * Include the RTEMS BSD support.
69 */
70#include <rtems/bsd/bsd.h>
71
72#ifdef __cplusplus
73extern "C" {
74#endif /* __cplusplus */
75
76/*
77 * BSD Kernel configuration.
78 */
79#if defined(RTEMS_BSD_CONFIG_DOMAIN_PAGE_MBUFS_SIZE)
80  #define RTEMS_BSD_CFGDECL_DOMAIN_PAGE_MBUFS_SIZE RTEMS_BSD_CONFIG_DOMAIN_PAGE_MBUFS_SIZE
81#else
82  #define RTEMS_BSD_CFGDECL_DOMAIN_PAGE_MBUFS_SIZE RTEMS_BSD_ALLOCATOR_DOMAIN_PAGE_MBUF_DEFAULT
83#endif
84
85/*
86 * BSD Kernel modules.
87 */
88
89/*
90 * Unix packet filter.
91 *  https://www.freebsd.org/doc/handbook/firewalls-pf.html
92 */
93#if defined(RTEMS_BSD_CONFIG_NET_PF_UNIX)
94  #define RTEMS_BSD_CFGDECL_NET_PF_UNIX SYSINIT_NEED_NET_PF_UNIX
95#endif /* RTEMS_BSD_CONFIG_NET_PF_UNIX */
96
97/*
98 * Link Aggregation and Failover.
99 *  https://www.freebsd.org/doc/handbook/network-aggregation.html
100 */
101#if defined(RTEMS_BSD_CONFIG_NET_IF_LAGG)
102  #define RTEMS_BSD_CFGDECL_IF_LAGG SYSINIT_NEED_NET_IF_LAGG
103#endif /* RTEMS_BSD_CONFIG_NET_IF_LAGG */
104
105/*
106 * Virtual LAN
107 *  https://www.freebsd.org/cgi/man.cgi?query=rc.conf then 'network_interfaces'.
108 */
109#if defined(RTEMS_BSD_CONFIG_NET_IF_VLAN)
110  #define RTEMS_BSD_CFGDECL_NET_IF_VLAN SYSINIT_NEED_NET_IF_VLAN
111#endif /* RTEMS_BSD_CONFIG_NET_IF_VLAN */
112
113/*
114 * FTPD
115 */
116#if defined(RTEMS_BSD_CONFIG_SERVICE_FTPD)
117  #define RTEMS_BSD_CFGDECL_FTPD RTEMS_BSD_RC_CONF_SYSINT(rc_conf_ftpd)
118#endif /* RTEMS_BSD_CONFIG_SERVICE_FTPD */
119
120/*
121 * Configure the system.
122 */
123#if defined(RTEMS_BSD_CONFIG_INIT)
124  /*
125   * Configure the domain allocation memory size.
126   */
127  uintptr_t rtems_bsd_allocator_domain_page_mbuf_size = \
128    RTEMS_BSD_CFGDECL_DOMAIN_PAGE_MBUFS_SIZE;
129
130  /*
131   * If a BSP configuration is requested include the Nexus bus BSP
132   * configuration.
133   */
134  #if defined(RTEMS_BSD_CONFIG_BSP_CONFIG)
135    #include <bsp/nexus-devices.h>
136  #endif /* RTEMS_BSD_CONFIG_BSP_CONFIG */
137
138  /*
139   * Create the networking modules and interfaces.
140   */
141  RTEMS_BSD_CFGDECL_NET_PF_UNIX;
142  RTEMS_BSD_CFGDECL_IF_LAGG;
143  RTEMS_BSD_CFGDECL_NET_IF_VLAN;
144
145  /*
146   * Create the services.
147   */
148  RTEMS_BSD_CFGDECL_FTPD;
149#endif /* RTEMS_BSD_CONFIG_INIT */
150
151#ifdef __cplusplus
152}
153#endif /* __cplusplus */
154
155#endif /* _RTEMS_BSD_CONFIG_h */
Note: See TracBrowser for help on using the repository browser.