Skip to content

Commit

Permalink
network: Use kernel/user space header files
Browse files Browse the repository at this point in the history
Add and use <machine/rtems-bsd-kernel-space.h> and
<machine/rtems-bsd-user-space.h> similar to the libbsd to avoid command
line defines and defines scattered throught the code base.

Simplify cpukit/libnetworking/Makefile.am.

Update #3375.
  • Loading branch information
sebhub committed Sep 10, 2018
1 parent 43fb904 commit cb68253
Show file tree
Hide file tree
Showing 178 changed files with 483 additions and 221 deletions.
3 changes: 1 addition & 2 deletions bsps/arm/atsam/net/if_atsam.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
#include <libchip/include/gmacd.h>
#include <libchip/include/pio.h>

#define __INSIDE_RTEMS_BSD_TCPIP_STACK__ 1
#define __BSD_VISIBLE 1
#include <machine/rtems-bsd-kernel-space.h>

#include <bsp.h>
#include <bsp/irq.h>
Expand Down
2 changes: 1 addition & 1 deletion bsps/arm/csb336/net/lan91c11x.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* http://www.rtems.org/license/LICENSE.
*/

#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
#include <machine/rtems-bsd-kernel-space.h>

#include <rtems.h>
#include "lan91c11x.h"
Expand Down
2 changes: 1 addition & 1 deletion bsps/arm/csb336/net/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* http://www.rtems.org/license/LICENSE.
*/

#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
#include <machine/rtems-bsd-kernel-space.h>

#include <rtems.h>
#include <rtems/rtems_bsdnet.h>
Expand Down
2 changes: 1 addition & 1 deletion bsps/arm/csb337/net/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* MicroMonitor 1.17.
*/

#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
#include <machine/rtems-bsd-kernel-space.h>

#include <rtems.h>
#include <rtems/rtems_bsdnet.h>
Expand Down
2 changes: 1 addition & 1 deletion bsps/arm/edb7312/net/network.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
#include <machine/rtems-bsd-kernel-space.h>

#include <rtems.h>
#include <sys/param.h>
Expand Down
2 changes: 1 addition & 1 deletion bsps/arm/gumstix/net/rtl8019.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* http://www.rtems.org/license/LICENSE.
*/

#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
#include <machine/rtems-bsd-kernel-space.h>

#include <bsp.h>
#include <bsp/irq.h>
Expand Down
2 changes: 1 addition & 1 deletion bsps/arm/rtl22xx/net/network.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*Note: this file is copy from 7312 BSP, and untested yet*/

#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
#include <machine/rtems-bsd-kernel-space.h>

#include <rtems.h>
#include <sys/param.h>
Expand Down
2 changes: 1 addition & 1 deletion bsps/arm/shared/net/lpc-ethernet.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* http://www.rtems.org/license/LICENSE.
*/

#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
#include <machine/rtems-bsd-kernel-space.h>

#include <errno.h>
#include <inttypes.h>
Expand Down
2 changes: 1 addition & 1 deletion bsps/bfin/bf537Stamp/net/ethernet.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
*/

#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
#include <machine/rtems-bsd-kernel-space.h>

#include <rtems.h>
#include <rtems/rtems_bsdnet.h>
Expand Down
2 changes: 1 addition & 1 deletion bsps/bfin/bf537Stamp/net/networkconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* http://www.rtems.org/license/LICENSE.
*/

#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
#include <machine/rtems-bsd-kernel-space.h>

#include <bsp.h>
#include <rtems/rtems_bsdnet.h>
Expand Down
2 changes: 1 addition & 1 deletion bsps/i386/pc386/net/3c509.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
* [email protected]
*/

#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
#include <machine/rtems-bsd-kernel-space.h>

#include <bsp.h>

Expand Down
2 changes: 1 addition & 1 deletion bsps/i386/pc386/net/elink.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* Common code for dealing with 3COM ethernet cards.
*/

#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
#include <machine/rtems-bsd-kernel-space.h>

#include <sys/types.h>

Expand Down
2 changes: 1 addition & 1 deletion bsps/i386/pc386/net/ne2000.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* that.
*/

#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
#include <machine/rtems-bsd-kernel-space.h>

#include <bsp.h>
#include <libchip/wd80x3.h>
Expand Down
2 changes: 1 addition & 1 deletion bsps/i386/pc386/net/wd8003.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* [email protected]
*/

#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
#include <machine/rtems-bsd-kernel-space.h>

#include <bsp.h>
#include <libchip/wd80x3.h>
Expand Down
2 changes: 1 addition & 1 deletion bsps/lm32/shared/net/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Copyright (C) 2011 Sebastien Bourdeauducq
*/

#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
#include <machine/rtems-bsd-kernel-space.h>
#define RTEMS_STATUS_CHECKS_USE_PRINTK

#include <bsp.h>
Expand Down
3 changes: 1 addition & 2 deletions bsps/lm32/shared/net/tsmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
* Micro-Research Finland Oy
*/

#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
#define _KERNEL
#include <machine/rtems-bsd-kernel-space.h>

#include <rtems.h>
#include <bsp.h>
Expand Down
2 changes: 1 addition & 1 deletion bsps/m68k/av5282/net/network.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
#include <machine/rtems-bsd-kernel-space.h>

#include <bsp.h>
#include <stdio.h>
Expand Down
2 changes: 1 addition & 1 deletion bsps/m68k/csb360/net/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* Copyright (c) 1999, National Research Council of Canada
*/

#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
#include <machine/rtems-bsd-kernel-space.h>

#include <bsp.h>
#include <stdio.h>
Expand Down
2 changes: 1 addition & 1 deletion bsps/m68k/gen68360/net/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* [email protected]
*/

#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
#include <machine/rtems-bsd-kernel-space.h>

#include <bsp.h>
#include <rtems/m68k/m68360.h>
Expand Down
2 changes: 1 addition & 1 deletion bsps/m68k/genmcf548x/net/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
*
*/

#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
#include <machine/rtems-bsd-kernel-space.h>

#include <rtems.h>
#include <rtems/error.h>
Expand Down
2 changes: 1 addition & 1 deletion bsps/m68k/mcf5235/net/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* TO DO: Check network stack code -- force longword alignment of all tx mbufs?
*/

#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
#include <machine/rtems-bsd-kernel-space.h>

#include <bsp.h>
#include <stdio.h>
Expand Down
2 changes: 1 addition & 1 deletion bsps/m68k/mcf5329/net/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* TO DO: Check network stack code -- force longword alignment of all tx mbufs?
*/

#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
#include <machine/rtems-bsd-kernel-space.h>

#include <bsp.h>
#include <stdio.h>
Expand Down
3 changes: 1 addition & 2 deletions bsps/m68k/mvme167/net/network.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
/* network.c: An 82596 ethernet driver for rtems-bsd.
*/

#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
#define KERNEL
#include <machine/rtems-bsd-kernel-space.h>

/*
* Selectively define to debug the network driver. If you define any of these
Expand Down
2 changes: 1 addition & 1 deletion bsps/m68k/uC5282/net/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* http://www.rtems.org/license/LICENSE.
*/

#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
#include <machine/rtems-bsd-kernel-space.h>

#include <bsp.h>
#include <stdio.h>
Expand Down
2 changes: 1 addition & 1 deletion bsps/mips/csb350/net/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* http://www.rtems.org/license/LICENSE.
*/

#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
#include <machine/rtems-bsd-kernel-space.h>

#include <rtems.h>
#include <rtems/rtems_bsdnet.h>
Expand Down
2 changes: 1 addition & 1 deletion bsps/powerpc/beatnik/net/porting/rtemscompat.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static inline void the_real_free(void *p)
return free(p);
}

#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
#include <machine/rtems-bsd-kernel-space.h>
#include <rtems/rtems_bsdnet.h>
#include <rtems/rtems_bsdnet_internal.h>
#ifdef __i386__
Expand Down
3 changes: 1 addition & 2 deletions bsps/powerpc/gen5200/net/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@
*
*/

#define __INSIDE_RTEMS_BSD_TCPIP_STACK__ 1
#define __BSD_VISIBLE 1
#include <machine/rtems-bsd-kernel-space.h>

#include <rtems.h>
#include <rtems/error.h>
Expand Down
2 changes: 1 addition & 1 deletion bsps/powerpc/gen83xx/net/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
| of the network interface driver |
\*===============================================================*/

#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
#include <machine/rtems-bsd-kernel-space.h>

#include <rtems.h>
#include <rtems/rtems_bsdnet.h>
Expand Down
2 changes: 1 addition & 1 deletion bsps/powerpc/haleakala/net/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*
*/

#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
#include <machine/rtems-bsd-kernel-space.h>

#include <bsp.h>
#include <stdio.h>
Expand Down
3 changes: 1 addition & 2 deletions bsps/powerpc/mpc55xxevb/net/smsc9218i.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@

#if defined(RTEMS_NETWORKING) && defined(MPC55XX_HAS_SIU)

#define __INSIDE_RTEMS_BSD_TCPIP_STACK__ 1
#define __BSD_VISIBLE 1
#include <machine/rtems-bsd-kernel-space.h>

#include <errno.h>
#include <assert.h>
Expand Down
3 changes: 1 addition & 2 deletions bsps/powerpc/mpc8260ads/net/if_hdlcsubr.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,13 @@
* @(#)if_ethersubr.c 8.1 (Berkeley) 6/10/93
*/

#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
#include <machine/rtems-bsd-kernel-space.h>

#include <rtems/rtems_bsdnet.h>

#include <sys/param.h>
/*#include <sys/systm.h>
#include <sys/kernel.h> */
#define KERNEL
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/protosw.h>
Expand Down
2 changes: 1 addition & 1 deletion bsps/powerpc/mpc8260ads/net/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* [email protected]
*/

#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
#include <machine/rtems-bsd-kernel-space.h>

#include <bsp.h>
#include <bsp/irq.h>
Expand Down
9 changes: 1 addition & 8 deletions bsps/powerpc/mvme3100/net/tsec.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
* ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03
*/

#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
#include <machine/rtems-bsd-kernel-space.h>

#include <rtems.h>
#include <rtems/error.h>
Expand All @@ -56,13 +56,6 @@
#include <assert.h>
#include <bsp.h>

#ifndef KERNEL
#define KERNEL
#endif
#ifndef _KERNEL
#define _KERNEL
#endif

#include <rtems/rtems_bsdnet.h>
#include <sys/param.h>
#include <sys/mbuf.h>
Expand Down
2 changes: 1 addition & 1 deletion bsps/powerpc/mvme5500/net/if_100MHz/GT64260eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*
*/

#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
#include <machine/rtems-bsd-kernel-space.h>

#define BYTE_ORDER BIG_ENDIAN

Expand Down
2 changes: 1 addition & 1 deletion bsps/powerpc/mvme5500/net/if_1GHz/if_wm.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*
*/

#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
#include <machine/rtems-bsd-kernel-space.h>

#define BYTE_ORDER BIG_ENDIAN

Expand Down
3 changes: 1 addition & 2 deletions bsps/powerpc/qoriq/net/if_intercom.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
* http://www.rtems.org/license/LICENSE.
*/

#define __INSIDE_RTEMS_BSD_TCPIP_STACK__ 1
#define __BSD_VISIBLE 1
#include <machine/rtems-bsd-kernel-space.h>

#include <assert.h>
#include <errno.h>
Expand Down
3 changes: 1 addition & 2 deletions bsps/powerpc/qoriq/net/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
* http://www.rtems.org/license/LICENSE.
*/

#define __INSIDE_RTEMS_BSD_TCPIP_STACK__ 1
#define __BSD_VISIBLE 1
#include <machine/rtems-bsd-kernel-space.h>

#include <assert.h>
#include <string.h>
Expand Down
2 changes: 1 addition & 1 deletion bsps/powerpc/shared/net/tsec.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
| this file contains the MPC83xx TSEC networking driver |
\*===============================================================*/

#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
#include <machine/rtems-bsd-kernel-space.h>

#include <stdlib.h>
#include <bsp.h>
Expand Down
2 changes: 1 addition & 1 deletion bsps/powerpc/tqm8xx/net/network_fec.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
* Copyright (c) 1999, National Research Council of Canada
*/

#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
#include <machine/rtems-bsd-kernel-space.h>

#include <bsp.h>
#include <stdio.h>
Expand Down
2 changes: 1 addition & 1 deletion bsps/powerpc/tqm8xx/net/network_scc.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
* Copyright (c) 1999, National Research Council of Canada
*/

#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
#include <machine/rtems-bsd-kernel-space.h>

#include <bsp.h>
#include <stdio.h>
Expand Down
2 changes: 1 addition & 1 deletion bsps/powerpc/virtex/net/xiltemac.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
*/

#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
#include <machine/rtems-bsd-kernel-space.h>
#define PPC_HAS_CLASSIC_EXCEPTIONS FALSE

#include <bsp.h>
Expand Down
2 changes: 1 addition & 1 deletion bsps/shared/net/cs8900.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/

#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
#include <machine/rtems-bsd-kernel-space.h>

#include <errno.h>
#include <string.h>
Expand Down
Loading

0 comments on commit cb68253

Please sign in to comment.