summaryrefslogtreecommitdiffstats
path: root/rtemsbsd
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-10-09 22:52:54 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-10-10 09:08:23 +0200
commite599318e912d8836c59d8b5202e3e31a6b8dcae9 (patch)
tree1172b8b830a1c3236e45c834c2b80e01325ea144 /rtemsbsd
parentMove files to match FreeBSD layout (diff)
downloadrtems-libbsd-e599318e912d8836c59d8b5202e3e31a6b8dcae9.tar.bz2
Update files to match FreeBSD layout
Add compatibility with Newlib header files. Some FreeBSD header files are mapped by the translation script: o rtems/bsd/sys/_types.h o rtems/bsd/sys/errno.h o rtems/bsd/sys/lock.h o rtems/bsd/sys/param.h o rtems/bsd/sys/resource.h o rtems/bsd/sys/time.h o rtems/bsd/sys/timespec.h o rtems/bsd/sys/types.h o rtems/bsd/sys/unistd.h It is now possible to include <sys/socket.h> directly for example. Generate one Makefile which builds everything including tests.
Diffstat (limited to 'rtemsbsd')
-rw-r--r--rtemsbsd/bfin/include/freebsd/machine/cpufunc.h1
-rw-r--r--rtemsbsd/freebsd/machine/_align.h33
-rw-r--r--rtemsbsd/freebsd/machine/_stdint.h30
-rw-r--r--rtemsbsd/freebsd/machine/_types.h30
-rw-r--r--rtemsbsd/freebsd/machine/endian.h85
-rw-r--r--rtemsbsd/freebsd/machine/param.h42
-rw-r--r--rtemsbsd/freebsd/machine/resource.h30
-rw-r--r--rtemsbsd/freebsd/machine/rtems-bsd-select.h76
-rw-r--r--rtemsbsd/freebsd/sys/_iovec.h2
-rw-r--r--rtemsbsd/freebsd/sys/cdefs.h7
-rw-r--r--rtemsbsd/freebsd/sys/signal.h2
-rw-r--r--rtemsbsd/freebsd/sys/uio.h2
-rw-r--r--rtemsbsd/h8300/include/freebsd/machine/cpufunc.h1
-rw-r--r--rtemsbsd/include/machine/_bus.h2
-rw-r--r--rtemsbsd/include/machine/_limits.h35
-rw-r--r--rtemsbsd/include/machine/bus.h8
-rw-r--r--rtemsbsd/include/machine/bus_dma.h2
-rw-r--r--rtemsbsd/include/machine/bus_space-i386.h6
-rw-r--r--rtemsbsd/include/machine/elf.h1
-rw-r--r--rtemsbsd/include/machine/mutex.h31
-rw-r--r--rtemsbsd/include/machine/pcb.h1
-rw-r--r--rtemsbsd/include/machine/resource.h38
-rw-r--r--rtemsbsd/include/machine/rtems-bsd-bus-dma.h12
-rw-r--r--rtemsbsd/include/machine/rtems-bsd-config.h.in137
-rw-r--r--rtemsbsd/include/machine/rtems-bsd-devicet.h2
-rw-r--r--rtemsbsd/include/machine/rtems-bsd-endian.h107
-rw-r--r--rtemsbsd/include/machine/rtems-bsd-param.h59
-rw-r--r--rtemsbsd/include/machine/rtems-bsd-symbols.h1
-rw-r--r--rtemsbsd/include/machine/rtems-bsd-syscall-api.h59
-rw-r--r--rtemsbsd/include/machine/rtems-bsd-sysinit.h6
-rw-r--r--rtemsbsd/include/machine/smp.h1
-rw-r--r--rtemsbsd/include/machine/vm.h1
-rw-r--r--rtemsbsd/include/poll.h3
-rw-r--r--rtemsbsd/include/pthread_np.h1
-rw-r--r--rtemsbsd/include/rtems/bsd/bsd.h37
-rw-r--r--rtemsbsd/include/rtems/bsd/local/vnode_if.h4
-rw-r--r--rtemsbsd/include/rtems/bsd/sys/_types.h116
-rw-r--r--rtemsbsd/include/rtems/bsd/sys/errno.h8
-rw-r--r--rtemsbsd/include/rtems/bsd/sys/lock.h10
-rw-r--r--rtemsbsd/include/rtems/bsd/sys/param.h33
-rw-r--r--rtemsbsd/include/rtems/bsd/sys/resource.h16
-rw-r--r--rtemsbsd/include/rtems/bsd/sys/time.h21
-rw-r--r--rtemsbsd/include/rtems/bsd/sys/timespec.h90
-rw-r--r--rtemsbsd/include/rtems/bsd/sys/types.h18
-rw-r--r--rtemsbsd/include/rtems/bsd/sys/unistd.h12
-rw-r--r--rtemsbsd/include/sys/_pthreadtypes.h2
-rw-r--r--rtemsbsd/include/sys/signalvar.h2
-rw-r--r--rtemsbsd/include/vm/vm_extern.h1
-rw-r--r--rtemsbsd/include/vm/vm_kern.h1
-rw-r--r--rtemsbsd/include/vm/vm_object.h1
-rw-r--r--rtemsbsd/include/vm/vm_page.h1
-rw-r--r--rtemsbsd/lm32/include/freebsd/machine/cpufunc.h1
-rw-r--r--rtemsbsd/local/bus_if.c18
-rw-r--r--rtemsbsd/local/cryptodev_if.c16
-rw-r--r--rtemsbsd/local/device_if.c14
-rw-r--r--rtemsbsd/local/miibus_if.c14
-rw-r--r--rtemsbsd/local/pci_if.c14
-rw-r--r--rtemsbsd/local/pcib_if.c16
-rw-r--r--rtemsbsd/local/usb_if.c14
-rw-r--r--rtemsbsd/m32c/include/freebsd/machine/cpufunc.h1
-rw-r--r--rtemsbsd/m32r/include/freebsd/machine/cpufunc.h1
-rw-r--r--rtemsbsd/m68k/include/freebsd/machine/cpufunc.h1
-rw-r--r--rtemsbsd/nios2/include/freebsd/machine/cpufunc.h1
-rw-r--r--rtemsbsd/rtems/ipsec_get_policylen.c4
-rw-r--r--rtemsbsd/rtems/kvm_private.h2
-rw-r--r--rtemsbsd/rtems/rtems-bsd-assert.c6
-rw-r--r--rtemsbsd/rtems/rtems-bsd-autoconf.c12
-rw-r--r--rtemsbsd/rtems/rtems-bsd-bus-dma-mbuf.c6
-rw-r--r--rtemsbsd/rtems/rtems-bsd-bus-dma.c10
-rw-r--r--rtemsbsd/rtems/rtems-bsd-cam.c36
-rw-r--r--rtemsbsd/rtems/rtems-bsd-condvar.c14
-rw-r--r--rtemsbsd/rtems/rtems-bsd-conf.c6
-rw-r--r--rtemsbsd/rtems/rtems-bsd-copyinout.c2
-rw-r--r--rtemsbsd/rtems/rtems-bsd-delay.c10
-rw-r--r--rtemsbsd/rtems/rtems-bsd-descrip.c38
-rw-r--r--rtemsbsd/rtems/rtems-bsd-generic.c30
-rw-r--r--rtemsbsd/rtems/rtems-bsd-init-with-irq.c4
-rw-r--r--rtemsbsd/rtems/rtems-bsd-init.c18
-rw-r--r--rtemsbsd/rtems/rtems-bsd-jail.c60
-rw-r--r--rtemsbsd/rtems/rtems-bsd-lock.c20
-rw-r--r--rtemsbsd/rtems/rtems-bsd-log.c6
-rw-r--r--rtemsbsd/rtems/rtems-bsd-malloc.c12
-rw-r--r--rtemsbsd/rtems/rtems-bsd-mutex.c14
-rw-r--r--rtemsbsd/rtems/rtems-bsd-nexus.c32
-rw-r--r--rtemsbsd/rtems/rtems-bsd-page.c8
-rw-r--r--rtemsbsd/rtems/rtems-bsd-panic.c16
-rw-r--r--rtemsbsd/rtems/rtems-bsd-pci_bus.c71
-rw-r--r--rtemsbsd/rtems/rtems-bsd-pci_cfgreg.c22
-rw-r--r--rtemsbsd/rtems/rtems-bsd-rwlock.c17
-rw-r--r--rtemsbsd/rtems/rtems-bsd-shell.c24
-rw-r--r--rtemsbsd/rtems/rtems-bsd-signal.c8
-rw-r--r--rtemsbsd/rtems/rtems-bsd-smp.c10
-rw-r--r--rtemsbsd/rtems/rtems-bsd-subr_param.c2
-rw-r--r--rtemsbsd/rtems/rtems-bsd-support.c10
-rw-r--r--rtemsbsd/rtems/rtems-bsd-sx.c12
-rw-r--r--rtemsbsd/rtems/rtems-bsd-synch.c20
-rw-r--r--rtemsbsd/rtems/rtems-bsd-syscall-api.c32
-rw-r--r--rtemsbsd/rtems/rtems-bsd-syscalls.c36
-rw-r--r--rtemsbsd/rtems/rtems-bsd-sysctl.c7
-rw-r--r--rtemsbsd/rtems/rtems-bsd-sysctlbyname.c8
-rw-r--r--rtemsbsd/rtems/rtems-bsd-sysctlnametomib.c8
-rw-r--r--rtemsbsd/rtems/rtems-bsd-taskqueue.c2
-rw-r--r--rtemsbsd/rtems/rtems-bsd-thread.c26
-rw-r--r--rtemsbsd/rtems/rtems-bsd-thread0-ucred.c16
-rw-r--r--rtemsbsd/rtems/rtems-bsd-timesupport.c2
-rw-r--r--rtemsbsd/rtems/rtems-bsd-vm_glue.c18
-rw-r--r--rtemsbsd/rtems/rtems-net-setup.c3
-rw-r--r--rtemsbsd/rtems/rtems-syspoll.c2
-rw-r--r--rtemsbsd/rtems/rtems-uthread_kqueue.c2
-rw-r--r--rtemsbsd/rtems/syslog.c2
-rw-r--r--rtemsbsd/sh/include/freebsd/machine/cpufunc.h1
-rw-r--r--rtemsbsd/sparc/include/freebsd/machine/cpufunc.h1
-rw-r--r--rtemsbsd/sys/dev/usb/controller/ehci_mpc83xx.c66
-rw-r--r--rtemsbsd/sys/dev/usb/controller/ohci_lpc24xx.c66
-rw-r--r--rtemsbsd/sys/dev/usb/controller/ohci_lpc32xx.c66
-rw-r--r--rtemsbsd/v850/include/freebsd/machine/cpufunc.h1
116 files changed, 1187 insertions, 1078 deletions
diff --git a/rtemsbsd/bfin/include/freebsd/machine/cpufunc.h b/rtemsbsd/bfin/include/freebsd/machine/cpufunc.h
deleted file mode 100644
index fa882cb5..00000000
--- a/rtemsbsd/bfin/include/freebsd/machine/cpufunc.h
+++ /dev/null
@@ -1 +0,0 @@
-/* empty file */
diff --git a/rtemsbsd/freebsd/machine/_align.h b/rtemsbsd/freebsd/machine/_align.h
deleted file mode 100644
index a307acaa..00000000
--- a/rtemsbsd/freebsd/machine/_align.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- * @file
- *
- * @ingroup rtems_bsd_machine
- *
- * @brief TODO.
- */
-
-/*
- * Copyright (c) 2009, 2010 embedded brains GmbH. All rights reserved.
- *
- * embedded brains GmbH
- * Obere Lagerstr. 30
- * 82178 Puchheim
- * Germany
- * <rtems@embedded-brains.de>
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.com/license/LICENSE.
- */
-
-#ifndef _RTEMS_BSD_MACHINE__ALIGN_H_
-#define _RTEMS_BSD_MACHINE__ALIGN_H_
-
-#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_CONFIG_H_
-#error "the header file <freebsd/machine/rtems-bsd-config.h> must be included first"
-#endif
-
-#define _ALIGNBYTES ((uintptr_t) (CPU_ALIGNMENT - 1))
-#define _ALIGN(p) (((uintptr_t) (p) + _ALIGNBYTES) & ~_ALIGNBYTES)
-
-#endif /* _RTEMS_BSD_MACHINE__ALIGN_H_ */
diff --git a/rtemsbsd/freebsd/machine/_stdint.h b/rtemsbsd/freebsd/machine/_stdint.h
deleted file mode 100644
index c41425f6..00000000
--- a/rtemsbsd/freebsd/machine/_stdint.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * @file
- *
- * @ingroup rtems_bsd_machine
- *
- * @brief TODO.
- */
-
-/*
- * Copyright (c) 2009, 2010 embedded brains GmbH. All rights reserved.
- *
- * embedded brains GmbH
- * Obere Lagerstr. 30
- * 82178 Puchheim
- * Germany
- * <rtems@embedded-brains.de>
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.com/license/LICENSE.
- */
-
-#ifndef _RTEMS_BSD_MACHINE__STDINT_H_
-#define _RTEMS_BSD_MACHINE__STDINT_H_
-
-#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_CONFIG_H_
-#error "the header file <freebsd/machine/rtems-bsd-config.h> must be included first"
-#endif
-
-#endif /* _RTEMS_BSD_MACHINE__STDINT_H_ */
diff --git a/rtemsbsd/freebsd/machine/_types.h b/rtemsbsd/freebsd/machine/_types.h
deleted file mode 100644
index 0a1c80b0..00000000
--- a/rtemsbsd/freebsd/machine/_types.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * @file
- *
- * @ingroup rtems_bsd_machine
- *
- * @brief TODO.
- */
-
-/*
- * Copyright (c) 2009, 2010 embedded brains GmbH. All rights reserved.
- *
- * embedded brains GmbH
- * Obere Lagerstr. 30
- * 82178 Puchheim
- * Germany
- * <rtems@embedded-brains.de>
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.com/license/LICENSE.
- */
-
-#ifndef _RTEMS_BSD_MACHINE__TYPES_H_
-#define _RTEMS_BSD_MACHINE__TYPES_H_
-
-#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_CONFIG_H_
-#error "the header file <freebsd/machine/rtems-bsd-config.h> must be included first"
-#endif
-
-#endif /* _RTEMS_BSD_MACHINE__TYPES_H_ */
diff --git a/rtemsbsd/freebsd/machine/endian.h b/rtemsbsd/freebsd/machine/endian.h
deleted file mode 100644
index 358200c3..00000000
--- a/rtemsbsd/freebsd/machine/endian.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/**
- * @file
- *
- * @ingroup rtems_bsd_machine
- *
- * @brief TODO.
- */
-
-/*
- * Copyright (c) 2009-2012 embedded brains GmbH. All rights reserved.
- *
- * embedded brains GmbH
- * Obere Lagerstr. 30
- * 82178 Puchheim
- * Germany
- * <rtems@embedded-brains.de>
- *
- * Copyright (c) 1987, 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef _RTEMS_BSD_MACHINE_ENDIAN_H
-#define _RTEMS_BSD_MACHINE_ENDIAN_H
-
-#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_CONFIG_H_
-#error "the header file <freebsd/machine/rtems-bsd-config.h> must be included first"
-#endif
-
-#include <rtems/endian.h>
-
-#define _LITTLE_ENDIAN 1234 /* LSB first: i386, vax */
-#define _BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */
-#define _PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */
-
-#if CPU_BIG_ENDIAN
-# define _BYTE_ORDER _BIG_ENDIAN
-#elif CPU_LITTLE_ENDIAN
-# define _BYTE_ORDER _LITTLE_ENDIAN
-#else
-# error "undefined endian"
-#endif
-
-#define __bswap16(x) CPU_swap_u16(x)
-#define __bswap32(x) CPU_swap_u32(x)
-
-#define __htonl(x) __bswap32(x)
-#define __htons(x) __bswap16(x)
-#define __ntohl(x) __bswap32(x)
-#define __ntohs(x) __bswap16(x)
-
-static __inline uint64_t
-__bswap64(uint64_t _x)
-{
-
- return ((_x >> 56) | ((_x >> 40) & 0xff00) | ((_x >> 24) & 0xff0000) |
- ((_x >> 8) & 0xff000000) | ((_x << 8) & ((uint64_t)0xff << 32)) |
- ((_x << 24) & ((uint64_t)0xff << 40)) |
- ((_x << 40) & ((uint64_t)0xff << 48)) | ((_x << 56)));
-}
-
-#endif /* _RTEMS_BSD_MACHINE_ENDIAN_H */
diff --git a/rtemsbsd/freebsd/machine/param.h b/rtemsbsd/freebsd/machine/param.h
deleted file mode 100644
index c0472daf..00000000
--- a/rtemsbsd/freebsd/machine/param.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * @file
- *
- * @ingroup rtems_bsd_machine
- *
- * @brief TODO.
- */
-
-/*
- * Copyright (c) 2009, 2010 embedded brains GmbH. All rights reserved.
- *
- * embedded brains GmbH
- * Obere Lagerstr. 30
- * 82178 Puchheim
- * Germany
- * <rtems@embedded-brains.de>
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.com/license/LICENSE.
- */
-
-#ifndef _RTEMS_BSD_MACHINE_PARAM_H_
-#define _RTEMS_BSD_MACHINE_PARAM_H_
-
-#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_CONFIG_H_
-#error "the header file <freebsd/machine/rtems-bsd-config.h> must be included first"
-#endif
-
-#include <machine/param.h>
-
-#define MAXCPU 1
-
-#define CACHE_LINE_SHIFT 7
-
-#define CACHE_LINE_SIZE (1 << CACHE_LINE_SHIFT)
-
-#define MAXPAGESIZES 1 /* maximum number of supported page sizes */
-
-#define MACHINE_ARCH "rtems"
-
-#endif /* _RTEMS_BSD_MACHINE_PARAM_H_ */
diff --git a/rtemsbsd/freebsd/machine/resource.h b/rtemsbsd/freebsd/machine/resource.h
deleted file mode 100644
index b29a0aca..00000000
--- a/rtemsbsd/freebsd/machine/resource.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * @file
- *
- * @ingroup rtems_bsd_machine
- *
- * @brief TODO.
- */
-
-/*
- * Copyright (c) 2009, 2010 embedded brains GmbH. All rights reserved.
- *
- * embedded brains GmbH
- * Obere Lagerstr. 30
- * 82178 Puchheim
- * Germany
- * <rtems@embedded-brains.de>
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.com/license/LICENSE.
- */
-
-#ifndef _RTEMS_BSD_MACHINE_RESOURCE_H_
-#define _RTEMS_BSD_MACHINE_RESOURCE_H_
-
-#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_CONFIG_H_
-#error "the header file <freebsd/machine/rtems-bsd-config.h> must be included first"
-#endif
-
-#endif /* _RTEMS_BSD_MACHINE_RESOURCE_H_ */
diff --git a/rtemsbsd/freebsd/machine/rtems-bsd-select.h b/rtemsbsd/freebsd/machine/rtems-bsd-select.h
deleted file mode 100644
index 368c285b..00000000
--- a/rtemsbsd/freebsd/machine/rtems-bsd-select.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*-
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)select.h 8.2 (Berkeley) 1/4/94
- * $Id: select.h,v 1.7 2010/04/02 07:39:34 ralf Exp $
- */
-
-#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_SELECT_H_
-#define _RTEMS_BSD_MACHINE_RTEMS_BSD_SELECT_H_
-
-#ifndef _KERNEL
-
-#include <sys/time.h> /* struct timeval */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Used to maintain information about processes that wish to be
- * notified when I/O becomes possible.
- */
-#if 0
-struct selinfo {
- pid_t si_pid; /* process to be notified */
- short si_flags; /* see below */
-};
-#endif
-#define SI_COLL 0x0001 /* collision occurred */
-
-/* Check the first NFDS descriptors each in READFDS (if not NULL) for read
- readiness, in WRITEFDS (if not NULL) for write readiness, and in EXCEPTFDS
- (if not NULL) for exceptional conditions. If TIMEOUT is not NULL, time out
- after waiting the interval specified therein. Returns the number of ready
- descriptors, or -1 for errors. */
-extern int select (int __nfds, fd_set *__readfds,
- fd_set *__writefds,
- fd_set *__exceptfds,
- struct timeval *__timeout);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !_KERNEL */
-
-#endif /* !_RTEMS_BSD_MACHINE_RTEMS_BSD_SELECT_H_ */
diff --git a/rtemsbsd/freebsd/sys/_iovec.h b/rtemsbsd/freebsd/sys/_iovec.h
deleted file mode 100644
index 8e9ba4a4..00000000
--- a/rtemsbsd/freebsd/sys/_iovec.h
+++ /dev/null
@@ -1,2 +0,0 @@
-/* <sys/_iovec.h> is installed by RTEMS */
-#include <sys/_iovec.h>
diff --git a/rtemsbsd/freebsd/sys/cdefs.h b/rtemsbsd/freebsd/sys/cdefs.h
deleted file mode 100644
index 522eecd4..00000000
--- a/rtemsbsd/freebsd/sys/cdefs.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef __RTEMSBSD_FREEBSD_SYS_CDEFS_h
-#define __RTEMSBSD_FREEBSD_SYS_CDEFS_h
-
-/* <sys/cdefs.h> is owned by newlib */
-#include <sys/cdefs.h>
-
-#endif /* !__RTEMSBSD_FREEBSD_SYS_CDEFS_h */
diff --git a/rtemsbsd/freebsd/sys/signal.h b/rtemsbsd/freebsd/sys/signal.h
deleted file mode 100644
index 1032e153..00000000
--- a/rtemsbsd/freebsd/sys/signal.h
+++ /dev/null
@@ -1,2 +0,0 @@
-/* <sys/signal.h> is owned by newlib */
-#include <sys/signal.h>
diff --git a/rtemsbsd/freebsd/sys/uio.h b/rtemsbsd/freebsd/sys/uio.h
deleted file mode 100644
index 896bca3d..00000000
--- a/rtemsbsd/freebsd/sys/uio.h
+++ /dev/null
@@ -1,2 +0,0 @@
-/* <sys/uio.h> is installed by RTEMS */
-#include <sys/uio.h>
diff --git a/rtemsbsd/h8300/include/freebsd/machine/cpufunc.h b/rtemsbsd/h8300/include/freebsd/machine/cpufunc.h
deleted file mode 100644
index fa882cb5..00000000
--- a/rtemsbsd/h8300/include/freebsd/machine/cpufunc.h
+++ /dev/null
@@ -1 +0,0 @@
-/* empty file */
diff --git a/rtemsbsd/include/machine/_bus.h b/rtemsbsd/include/machine/_bus.h
index 436fb584..3891cb15 100644
--- a/rtemsbsd/include/machine/_bus.h
+++ b/rtemsbsd/include/machine/_bus.h
@@ -1 +1 @@
-#include <freebsd/machine/bus.h>
+#include <machine/bus.h>
diff --git a/rtemsbsd/include/machine/_limits.h b/rtemsbsd/include/machine/_limits.h
index 46cac302..c7187c60 100644
--- a/rtemsbsd/include/machine/_limits.h
+++ b/rtemsbsd/include/machine/_limits.h
@@ -7,24 +7,43 @@
*/
/*
- * Copyright (c) 2009, 2010 embedded brains GmbH. All rights reserved.
+ * Copyright (c) 2009-2013 embedded brains GmbH. All rights reserved.
*
* embedded brains GmbH
- * Obere Lagerstr. 30
+ * Dornierstr. 4
* 82178 Puchheim
* Germany
* <rtems@embedded-brains.de>
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.com/license/LICENSE.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
*/
#ifndef _RTEMS_BSD_MACHINE__LIMITS_H_
#define _RTEMS_BSD_MACHINE__LIMITS_H_
-#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_CONFIG_H_
-#error "the header file <freebsd/machine/rtems-bsd-config.h> must be included first"
-#endif
+#include <limits.h>
+
+#define __CHAR_BIT CHAR_BIT
+
+#define __INT_MAX INT_MAX
#endif /* _RTEMS_BSD_MACHINE__LIMITS_H_ */
diff --git a/rtemsbsd/include/machine/bus.h b/rtemsbsd/include/machine/bus.h
index 18689dec..28558905 100644
--- a/rtemsbsd/include/machine/bus.h
+++ b/rtemsbsd/include/machine/bus.h
@@ -213,15 +213,15 @@ bus_space_free(bus_space_tag_t bst __unused, bus_space_handle_t bsh, bus_size_t
#if defined(__i386__)
- #include <freebsd/machine/bus_space-i386.h>
+ #include <machine/bus_space-i386.h>
#elif defined(__ppc__)
- #include <freebsd/machine/bus_space-simple_memory.h>
+ #include <machine/bus_space-simple_memory.h>
#else
#warning "Bus space routines not implemented for this architecture!!"
#warning "Defaulting to simple-memory Bus space routines!!"
- #include <freebsd/machine/bus_space-simple_memory.h>
+ #include <machine/bus_space-simple_memory.h>
#endif
-#include <freebsd/machine/bus_dma.h>
+#include <machine/bus_dma.h>
#endif /* _RTEMS_BSD_MACHINE_BUS_H_ */
diff --git a/rtemsbsd/include/machine/bus_dma.h b/rtemsbsd/include/machine/bus_dma.h
index 44ed7762..d4a1cfb8 100644
--- a/rtemsbsd/include/machine/bus_dma.h
+++ b/rtemsbsd/include/machine/bus_dma.h
@@ -27,6 +27,6 @@
#error "the header file <freebsd/machine/rtems-bsd-config.h> must be included first"
#endif
-#include <freebsd/sys/bus_dma.h>
+#include <sys/bus_dma.h>
#endif /* _RTEMS_BSD_MACHINE_BUS_DMA_H_ */
diff --git a/rtemsbsd/include/machine/bus_space-i386.h b/rtemsbsd/include/machine/bus_space-i386.h
index 748d883d..67868001 100644
--- a/rtemsbsd/include/machine/bus_space-i386.h
+++ b/rtemsbsd/include/machine/bus_space-i386.h
@@ -114,9 +114,9 @@
#ifndef _RTEMS_BSD_MACHINE_BUS_I386_H_
#define _RTEMS_BSD_MACHINE_BUS_I386_H_
-#include <freebsd/machine/_bus.h>
-#include <freebsd/machine/cpufunc.h>
-#include <freebsd/machine/resource.h>
+#include <machine/_bus.h>
+#include <machine/cpufunc.h>
+#include <machine/resource.h>
#if 0
#define I386_BUS_SPACE_IO SYS_RES_IOPORT
diff --git a/rtemsbsd/include/machine/elf.h b/rtemsbsd/include/machine/elf.h
index 936ffd88..e69de29b 100644
--- a/rtemsbsd/include/machine/elf.h
+++ b/rtemsbsd/include/machine/elf.h
@@ -1 +0,0 @@
-/* EMPTY */
diff --git a/rtemsbsd/include/machine/mutex.h b/rtemsbsd/include/machine/mutex.h
index 8ab14405..7b36e6b9 100644
--- a/rtemsbsd/include/machine/mutex.h
+++ b/rtemsbsd/include/machine/mutex.h
@@ -7,24 +7,39 @@
*/
/*
- * Copyright (c) 2009, 2010 embedded brains GmbH. All rights reserved.
+ * Copyright (c) 2009-2013 embedded brains GmbH. All rights reserved.
*
* embedded brains GmbH
- * Obere Lagerstr. 30
+ * Dornierstr. 4
* 82178 Puchheim
* Germany
* <rtems@embedded-brains.de>
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.com/license/LICENSE.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
*/
#ifndef _RTEMS_BSD_MACHINE_MUTEX_H_
#define _RTEMS_BSD_MACHINE_MUTEX_H_
-#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_CONFIG_H_
-#error "the header file <freebsd/machine/rtems-bsd-config.h> must be included first"
-#endif
+/* Empty */
#endif /* _RTEMS_BSD_MACHINE_MUTEX_H_ */
diff --git a/rtemsbsd/include/machine/pcb.h b/rtemsbsd/include/machine/pcb.h
index 936ffd88..e69de29b 100644
--- a/rtemsbsd/include/machine/pcb.h
+++ b/rtemsbsd/include/machine/pcb.h
@@ -1 +0,0 @@
-/* EMPTY */
diff --git a/rtemsbsd/include/machine/resource.h b/rtemsbsd/include/machine/resource.h
index 9b143810..35ad0924 100644
--- a/rtemsbsd/include/machine/resource.h
+++ b/rtemsbsd/include/machine/resource.h
@@ -1,10 +1,32 @@
-#ifndef _MACHINE_RESOURCE_H_
-#define _MACHINE_RESOURCE_H_ 1
+/**
+ * @file
+ *
+ * @ingroup rtems_bsd_machine
+ *
+ * @brief TODO.
+ */
-#define SYS_RES_IRQ 1 /* interrupt lines */
-#define SYS_RES_DRQ 2 /* isa dma lines */
-#define SYS_RES_MEMORY 3 /* i/o memory */
-#define SYS_RES_IOPORT 4 /* i/o ports */
-#define SYS_RES_GPIO 5 /* general purpose i/o */
+/*
+ * Copyright (c) 2009, 2010 embedded brains GmbH. All rights reserved.
+ *
+ * embedded brains GmbH
+ * Obere Lagerstr. 30
+ * 82178 Puchheim
+ * Germany
+ * <rtems@embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
-#endif /* !_MACHINE_RESOURCE_H_ */
+#ifndef _RTEMS_BSD_MACHINE_RESOURCE_H_
+#define _RTEMS_BSD_MACHINE_RESOURCE_H_
+
+#define SYS_RES_IRQ 1
+#define SYS_RES_DRQ 2
+#define SYS_RES_MEMORY 3
+#define SYS_RES_IOPORT 4
+#define SYS_RES_GPIO 5
+
+#endif /* _RTEMS_BSD_MACHINE_RESOURCE_H_ */
diff --git a/rtemsbsd/include/machine/rtems-bsd-bus-dma.h b/rtemsbsd/include/machine/rtems-bsd-bus-dma.h
index e9115e42..5cff23b1 100644
--- a/rtemsbsd/include/machine/rtems-bsd-bus-dma.h
+++ b/rtemsbsd/include/machine/rtems-bsd-bus-dma.h
@@ -47,12 +47,12 @@
#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_BUS_DMA_H_
#define _RTEMS_BSD_MACHINE_RTEMS_BSD_BUS_DMA_H_
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/machine/bus.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/systm.h>
+#include <machine/bus.h>
struct bus_dma_tag {
bus_dma_tag_t parent;
diff --git a/rtemsbsd/include/machine/rtems-bsd-config.h.in b/rtemsbsd/include/machine/rtems-bsd-config.h.in
index 655d319a..64dce1cc 100644
--- a/rtemsbsd/include/machine/rtems-bsd-config.h.in
+++ b/rtemsbsd/include/machine/rtems-bsd-config.h.in
@@ -23,33 +23,14 @@
#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_CONFIG_H_
#define _RTEMS_BSD_MACHINE_RTEMS_BSD_CONFIG_H_
-/* We compile for RTEMS and FreeBSD */
-#define __rtems__ 1
-#define __FreeBSD__ 1
-#define __BSD_VISIBLE 1
-
/* XXX hack so /opt.../machine/param.h can disable MSIZE and use this one */
#define __NEW_RTEMS_BSD__
-#include <sys/cdefs.h>
-
-#ifndef _RTEMS_BSD_BSD_HH_
/* General defines to activate BSD kernel parts */
#define _KERNEL 1
-/* Disable standard system headers */
-#undef _SYS_UNISTD_H
-#define _SYS_UNISTD_H 1
-#undef _SYS_TTYCOM_H_
-#define _SYS_TTYCOM_H_ 1
-
-/* Disable some quirks in the standard headers */
-#define _POSIX_SOURCE 1
-
-/* We need POSIX threads */
-#define _POSIX_THREADS 1
-
-#endif /* !_RTEMS_BSD_BSD_HH_ */
+#include <sys/cdefs.h>
+#include <sys/types.h>
/* Type set from the C standard */
#include <stdarg.h>
@@ -59,8 +40,6 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
-#include <errno.h>
-#include <sys/types.h>
/* Ensure that we are RTEMS compatible and can use RTEMS */
#include <rtems.h>
@@ -68,7 +47,6 @@
#include <rtems/chain.h>
#include <rtems/libio.h>
-#ifndef _RTEMS_BSD_BSD_HH_
/* Ensure that we can use POSIX threads */
#include <pthread.h>
@@ -78,8 +56,6 @@
/* Symbol undefines */
#undef MAXPATHLEN
-#endif /* !_RTEMS_BSD_BSD_HH_ */
-
/* Networking */
#define IPSEC 1
#define INET 1
@@ -88,131 +64,26 @@
/* Integer type definitions */
-#define __INT_MAX INT_MAX
-#define GID_MAX UINT_MAX /* max value for a gid_t */
-#define UID_MAX UINT_MAX /* max value for a uid_t */
-
-#define __int8_t int8_t
-#define __int16_t int16_t
-#define __int32_t int32_t
-#define __int64_t int64_t
-
-#define __int_least8_t int_least8_t
-#define __int_least16_t int_least16_t
-#define __int_least32_t int_least32_t
-#define __int_least64_t int_least64_t
-
-#define __int_fast8_t int_fast8_t
-#define __int_fast16_t int_fast16_t
-#define __int_fast32_t int_fast32_t
-#define __int_fast64_t int_fast64_t
-
-#define __uint8_t uint8_t
-#define __uint16_t uint16_t
-#define __uint32_t uint32_t
-#define __uint64_t uint64_t
-
-#define __uint_least8_t uint_least8_t
-#define __uint_least16_t uint_least16_t
-#define __uint_least32_t uint_least32_t
-#define __uint_least64_t uint_least64_t
-
-#define __uint_fast8_t uint_fast8_t
-#define __uint_fast16_t uint_fast16_t
-#define __uint_fast32_t uint_fast32_t
-#define __uint_fast64_t uint_fast64_t
-
-#define __intfptr_t intptr_t
-#define __uintfptr_t uintptr_t
-
-#define __intptr_t intptr_t
-#define __uintptr_t uintptr_t
-
-#define __intmax_t intmax_t
-#define __uintmax_t uintmax_t
-
-#define __register_t int
-#define __u_register_t unsigned int
-
#define __float_t float
#define __double_t double
-#define __vm_offset_t uintptr_t
-#define __vm_ooffset_t uint64_t
-#define __vm_paddr_t uintptr_t
-#define __vm_pindex_t uint64_t
-#define __vm_size_t uintptr_t
-
#define __clock_t clock_t
#define __cpumask_t unsigned int
#define __critical_t intptr_t
#define __ptrdiff_t ptrdiff_t
-#define __segsz_t intptr_t
#define __time_t time_t
-#define __va_list va_list
-
-#undef __size_t
-#define __size_t size_t
-
#define _CLOCKID_T_DECLARED 1
-#define _DEV_T_DECLARED 1
-#define _GID_T_DECLARED 1
-#define _MODE_T_DECLARED 1
-#define _OFF_T_DECLARED 1
-#define _PID_T_DECLARED 1
-#define _SSIZE_T_DECLARED 1
#define _TIMER_T_DECLARED 1
#define _TIME_T_DECLARED 1
-#define _UID_T_DECLARED 1
#define _USECONDS_T_DECLARED 1
#define _FSBLKCNT_T_DECLARED 1
#define _BLKSIZE_T_DECLARED 1
#define _BLKCNT_T_DECLARED 1
-#define __dev_t _bsd_dev_t
-#define __gid_t _bsd_gid_t
-#define __off_t _bsd_off_t
-#define __pid_t _bsd_pid_t
-#define __uid_t _bsd_uid_t
-
-/* Missing error number */
-//#define ENOIOCTL EINVAL
-
-/* multiple user space methods and commands use this */
-#ifndef _PATH_DEVNULL
-#define _PATH_DEVNULL "/dev/null"
-#endif
-
-/* used by some user space code */
-#ifndef SIZE_T_MAX
-#define SIZE_T_MAX SIZE_MAX
-#endif
-
-/* used by some user space code */
-#ifndef O_EXLOCK
-#define O_EXLOCK O_EXCL
-#endif
-
-/* used by some user space code */
-#if !defined O_NOFOLLOW
-#define O_NOFOLLOW 0
-#endif
-
-/* used by some user space code */
-#ifndef O_SHLOCK
-#define O_SHLOCK 0
-#endif
-
-/* from limits.h on FreeBSD */
-#ifndef _POSIX_HOST_NAME_MAX
-#define _POSIX_HOST_NAME_MAX 255
-#endif
-
-#ifndef _RTEMS_BSD_BSD_HH_
/* Symbol rename */
-#include <freebsd/machine/rtems-bsd-symbols.h>
+#include <machine/rtems-bsd-symbols.h>
#define gets _bsd_gets
#define realloc _bsd_realloc
@@ -276,6 +147,4 @@ extern rtems_chain_control rtems_bsd_malloc_chain;
/* CPU definitions */
#define cpu_spinwait() /* nothing */
-#endif /* !_RTEMS_BSD_BSD_HH_ */
-
#endif /* _RTEMS_BSD_MACHINE_RTEMS_BSD_CONFIG_H_ */
diff --git a/rtemsbsd/include/machine/rtems-bsd-devicet.h b/rtemsbsd/include/machine/rtems-bsd-devicet.h
index 2db95850..9c59577b 100644
--- a/rtemsbsd/include/machine/rtems-bsd-devicet.h
+++ b/rtemsbsd/include/machine/rtems-bsd-devicet.h
@@ -41,7 +41,7 @@
#include <stdarg.h>
#include <stdio.h>
-#include <freebsd/sys/queue.h>
+#include <sys/queue.h>
typedef struct device *device_t;
diff --git a/rtemsbsd/include/machine/rtems-bsd-endian.h b/rtemsbsd/include/machine/rtems-bsd-endian.h
new file mode 100644
index 00000000..006a9f37
--- /dev/null
+++ b/rtemsbsd/include/machine/rtems-bsd-endian.h
@@ -0,0 +1,107 @@
+/**
+ * @file
+ *
+ * @ingroup rtems_bsd_machine
+ *
+ * @brief TODO.
+ */
+
+/*
+ * Copyright (c) 2009-2013 embedded brains GmbH. All rights reserved.
+ *
+ * embedded brains GmbH
+ * Dornierstr. 4
+ * 82178 Puchheim
+ * Germany
+ * <rtems@embedded-brains.de>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef _RTEMS_BSD_MACHINE_ENDIAN_H
+#define _RTEMS_BSD_MACHINE_ENDIAN_H
+
+#include <machine/endian.h>
+#include <stdint.h>
+
+#if __BSD_VISIBLE
+
+#define _BYTE_ORDER BYTE_ORDER
+#define _BIG_ENDIAN BIG_ENDIAN
+#define _LITTLE_ENDIAN LITTLE_ENDIAN
+
+#if BYTE_ORDER == BIG_ENDIAN
+#define __ntohl(x) ((uint32_t) (x))
+#define __ntohs(x) ((uint16_t) (x))
+#define __htonl(x) ((uint32_t) (x))
+#define __htons(x) ((uint16_t) (x))
+#else
+#define __ntohl(x) (__bswap32(x))
+#define __ntohs(x) (__bswap16(x))
+#define __htonl(x) (__bswap32(x))
+#define __htons(x) (__bswap16(x))
+#endif
+
+static inline uint16_t
+__bswap16(uint16_t v)
+{
+#ifdef __GNUC__
+ return __builtin_bswap16(v);
+#else
+ return (uint16_t) ((v >> 8)
+ | ((v & 0xffU) << 8));
+#endif
+}
+
+static inline uint32_t
+__bswap32(uint32_t v)
+{
+#ifdef __GNUC__
+ return __builtin_bswap32(v);
+#else
+ return (uint32_t) ((v >> 24)
+ | ((v >> 8) && 0xff00U)
+ | ((v & 0xff00U) << 8)
+ | ((v & 0xffU) << 24));
+#endif
+}
+
+static inline uint64_t
+__bswap64(uint64_t v)
+{
+#ifdef __GNUC__
+ return __builtin_bswap64(v);
+#else
+ return (uint64_t) ((v >> 56)
+ | ((v >> 40) && 0xff00U)
+ | ((v >> 24) && 0xff0000U)
+ | ((v >> 8) && 0xff000000U)
+ | ((v & 0xff000000U) << 8)
+ | ((v & 0xff0000U) << 24)
+ | ((v & 0xff00U) << 40)
+ | ((v & 0xffU) << 56));
+#endif
+}
+
+#endif /* __BSD_VISIBLE */
+
+#endif /* _RTEMS_BSD_MACHINE_ENDIAN_H */
diff --git a/rtemsbsd/include/machine/rtems-bsd-param.h b/rtemsbsd/include/machine/rtems-bsd-param.h
new file mode 100644
index 00000000..ffcbf926
--- /dev/null
+++ b/rtemsbsd/include/machine/rtems-bsd-param.h
@@ -0,0 +1,59 @@
+/**
+ * @file
+ *
+ * @ingroup rtems_bsd_machine
+ *
+ * @brief TODO.
+ */
+
+/*
+ * Copyright (c) 2009-2013 embedded brains GmbH. All rights reserved.
+ *
+ * embedded brains GmbH
+ * Dornierstr. 4
+ * 82178 Puchheim
+ * Germany
+ * <rtems@embedded-brains.de>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef _RTEMS_BSD_MACHINE_PARAM_H_
+#define _RTEMS_BSD_MACHINE_PARAM_H_
+
+#include <machine/param.h>
+
+#define _ALIGNBYTES ALIGNBYTES
+
+#define _ALIGN(p) ALIGN(p)
+
+#define MAXCPU 1
+
+#define CACHE_LINE_SHIFT 7
+
+#define CACHE_LINE_SIZE (1 << CACHE_LINE_SHIFT)
+
+#define MAXPAGESIZES 1 /* maximum number of supported page sizes */
+
+#define MACHINE_ARCH "rtems"
+
+#endif /* _RTEMS_BSD_MACHINE_PARAM_H_ */
diff --git a/rtemsbsd/include/machine/rtems-bsd-symbols.h b/rtemsbsd/include/machine/rtems-bsd-symbols.h
index 4c3be853..5ab4a756 100644
--- a/rtemsbsd/include/machine/rtems-bsd-symbols.h
+++ b/rtemsbsd/include/machine/rtems-bsd-symbols.h
@@ -23,7 +23,6 @@
#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_SYMBOLS_H_
#define _RTEMS_BSD_MACHINE_RTEMS_BSD_SYMBOLS_H_
-#define bootverbose _bsd_bootverbose
#define bus_activate_resource _bsd_bus_activate_resource
#define bus_activate_resource _bsd_bus_activate_resource
#define bus_activate_resource_desc _bsd_bus_activate_resource_desc
diff --git a/rtemsbsd/include/machine/rtems-bsd-syscall-api.h b/rtemsbsd/include/machine/rtems-bsd-syscall-api.h
new file mode 100644
index 00000000..7d53606b
--- /dev/null
+++ b/rtemsbsd/include/machine/rtems-bsd-syscall-api.h
@@ -0,0 +1,59 @@
+/**
+ * @file
+ *
+ * @ingroup rtems_bsd_machine
+ *
+ * @brief TODO.
+ *
+ * This file helps to ensure that the system calls match the user space
+ * declaration. The user space declaration is normally not visible to the
+ * kernel space due to the _KERNEL guard.
+ */
+
+/*
+ * Copyright (c) 2013 embedded brains GmbH. All rights reserved.
+ *
+ * embedded brains GmbH
+ * Dornierstr. 4
+ * 82178 Puchheim
+ * Germany
+ * <rtems@embedded-brains.de>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_SYSCALL_API_H_
+#define _RTEMS_BSD_MACHINE_RTEMS_BSD_SYSCALL_API_H_
+
+#include <sys/cdefs.h>
+#include <sys/select.h>
+
+__BEGIN_DECLS
+
+int pselect(int, fd_set *__restrict, fd_set *__restrict, fd_set *__restrict,
+ const struct timespec *__restrict, const sigset_t *__restrict);
+
+int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
+
+__END_DECLS
+
+#endif /* _RTEMS_BSD_MACHINE_RTEMS_BSD_SYSCALL_API_H_ */
diff --git a/rtemsbsd/include/machine/rtems-bsd-sysinit.h b/rtemsbsd/include/machine/rtems-bsd-sysinit.h
index 0e31d3ec..6242d790 100644
--- a/rtemsbsd/include/machine/rtems-bsd-sysinit.h
+++ b/rtemsbsd/include/machine/rtems-bsd-sysinit.h
@@ -23,9 +23,9 @@
#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_SYSINIT_H_
#define _RTEMS_BSD_MACHINE_RTEMS_BSD_SYSINIT_H_
-#include <freebsd/sys/cdefs.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/kernel.h>
+#include <sys/cdefs.h>
+#include <sys/queue.h>
+#include <sys/kernel.h>
#define SYSINIT_NEED_FREEBSD_CORE \
SYSINIT_REFERENCE(configure1); \
diff --git a/rtemsbsd/include/machine/smp.h b/rtemsbsd/include/machine/smp.h
index 936ffd88..e69de29b 100644
--- a/rtemsbsd/include/machine/smp.h
+++ b/rtemsbsd/include/machine/smp.h
@@ -1 +0,0 @@
-/* EMPTY */
diff --git a/rtemsbsd/include/machine/vm.h b/rtemsbsd/include/machine/vm.h
index 936ffd88..e69de29b 100644
--- a/rtemsbsd/include/machine/vm.h
+++ b/rtemsbsd/include/machine/vm.h
@@ -1 +0,0 @@
-/* EMPTY */
diff --git a/rtemsbsd/include/poll.h b/rtemsbsd/include/poll.h
index 48572ee4..06fb41ab 100644
--- a/rtemsbsd/include/poll.h
+++ b/rtemsbsd/include/poll.h
@@ -1,2 +1 @@
-#include <freebsd/bsd.h>
-#include <freebsd/sys/poll.h>
+#include <sys/poll.h>
diff --git a/rtemsbsd/include/pthread_np.h b/rtemsbsd/include/pthread_np.h
new file mode 100644
index 00000000..936ffd88
--- /dev/null
+++ b/rtemsbsd/include/pthread_np.h
@@ -0,0 +1 @@
+/* EMPTY */
diff --git a/rtemsbsd/include/rtems/bsd/bsd.h b/rtemsbsd/include/rtems/bsd/bsd.h
index 6eafb4e5..d7348420 100644
--- a/rtemsbsd/include/rtems/bsd/bsd.h
+++ b/rtemsbsd/include/rtems/bsd/bsd.h
@@ -7,29 +7,44 @@
*/
/*
- * Copyright (c) 2009, 2010 embedded brains GmbH. All rights reserved.
+ * Copyright (c) 2009-2013 embedded brains GmbH. All rights reserved.
*
* embedded brains GmbH
- * Obere Lagerstr. 30
+ * Dornierstr. 4
* 82178 Puchheim
* Germany
* <rtems@embedded-brains.de>
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.com/license/LICENSE.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
*/
-#ifndef _RTEMS_BSD_BSD_HH_
-#define _RTEMS_BSD_BSD_HH_
+#ifndef _RTEMS_BSD_BSD_H_
+#define _RTEMS_BSD_BSD_H_
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
-#include <freebsd/machine/rtems-bsd-config.h>
-#include <freebsd/machine/rtems-bsd-select.h>
-#include <freebsd/machine/_align.h>
+#include <rtems.h>
rtems_status_code rtems_bsd_initialize(void);
@@ -41,4 +56,4 @@ void rtems_bsd_shell_initialize(void);
}
#endif /* __cplusplus */
-#endif /* _RTEMS_BSD_BSD_HH_ */
+#endif /* _RTEMS_BSD_BSD_H_ */
diff --git a/rtemsbsd/include/rtems/bsd/local/vnode_if.h b/rtemsbsd/include/rtems/bsd/local/vnode_if.h
index c90e6c8e..367a8db7 100644
--- a/rtemsbsd/include/rtems/bsd/local/vnode_if.h
+++ b/rtemsbsd/include/rtems/bsd/local/vnode_if.h
@@ -6,8 +6,8 @@
*/
extern struct vnodeop_desc vop_default_desc;
-#include <freebsd/local/vnode_if_typedef.h>
-#include <freebsd/local/vnode_if_newproto.h>
+#include <rtems/bsd/local/vnode_if_typedef.h>
+#include <rtems/bsd/local/vnode_if_newproto.h>
struct vop_islocked_args {
struct vop_generic_args a_gen;
struct vnode *a_vp;
diff --git a/rtemsbsd/include/rtems/bsd/sys/_types.h b/rtemsbsd/include/rtems/bsd/sys/_types.h
index b9f4d392..e9acaf4e 100644
--- a/rtemsbsd/include/rtems/bsd/sys/_types.h
+++ b/rtemsbsd/include/rtems/bsd/sys/_types.h
@@ -26,11 +26,12 @@
* $FreeBSD$
*/
-#ifndef _SYS__TYPES_HH_
-#define _SYS__TYPES_HH_
+#ifndef _RTEMS_BSD_SYS__TYPES_H_
+#define _RTEMS_BSD_SYS__TYPES_H_
-#include <freebsd/sys/cdefs.h>
-#include <freebsd/machine/_types.h>
+#include <sys/cdefs.h>
+#ifndef __rtems__
+#include <machine/_types.h>
/*
* Standard type definitions.
@@ -101,5 +102,110 @@ typedef union {
char __mbstate8[128];
__int64_t _mbstateL; /* for alignment */
} __mbstate_t;
+#else /* __rtems__ */
+#include <sys/types.h>
-#endif /* !_SYS__TYPES_HH_ */
+#ifdef __BSD_VISIBLE
+
+#include <machine/rtems-bsd-endian.h>
+#include <stdarg.h>
+
+#define _INT8_T_DECLARED
+#define _UINT8_T_DECLARED
+
+#define _INT16_T_DECLARED
+#define _UINT16_T_DECLARED
+
+#define _INT32_T_DECLARED
+#define _UINT32_T_DECLARED
+
+#define _INT64_T_DECLARED
+#define _UINT64_T_DECLARED
+
+#define _INTPTR_T_DECLARED
+
+#ifdef _KERNEL
+
+typedef int boolean_t;
+
+typedef struct device *device_t;
+
+typedef intptr_t intfptr_t;
+typedef uintptr_t uintfptr_t;
+
+typedef uint32_t intrmask_t;
+
+typedef char vm_memattr_t;
+
+#endif /* _KERNEL */
+
+typedef int accmode_t;
+#define _ACCMODE_T_DECLARED
+
+typedef const char *c_caddr_t;
+
+typedef uint32_t cpumask_t;
+
+typedef int cpusetid_t;
+
+#define _DEV_T_DECLARED
+
+typedef uint32_t __fixpt_t;
+typedef __fixpt_t fixpt_t;
+
+#define _GID_T_DECLARED
+
+typedef uint32_t in_addr_t;
+#define _IN_ADDR_T_DECLARED
+
+typedef uint16_t in_port_t;
+#define _IN_PORT_T_DECLARED
+
+#define _MODE_T_DECLARED
+
+typedef _off_t __off_t;
+#define _OFF_T_DECLARED
+
+#define _PID_T_DECLARED
+
+typedef int register_t;
+typedef unsigned int u_register_t;
+
+typedef intptr_t segsz_t;
+
+#undef __size_t
+typedef size_t __size_t;
+#define _SIZE_T_DECLARED
+
+#define __ssize_t ssize_t
+#define _SSIZE_T_DECLARED
+
+#define _UID_T_DECLARED
+
+#define __va_list va_list
+
+typedef uintptr_t vm_offset_t;
+typedef uint64_t vm_ooffset_t;
+typedef uintptr_t vm_paddr_t;
+typedef uint64_t vm_pindex_t;
+typedef uintptr_t vm_size_t;
+
+typedef int lwpid_t;
+#define _LWPID_T_DECLARED
+
+typedef int64_t rlim_t;
+#define _RLIM_T_DECLARED
+
+typedef uint8_t sa_family_t;
+#define _SA_FAMILY_T_DECLARED
+
+typedef uint32_t socklen_t;
+#define _SOCKLEN_T_DECLARED
+
+#define SIZE_T_MAX SIZE_MAX
+
+#endif /* __BSD_VISIBLE */
+
+#endif /* __rtems__ */
+
+#endif /* !_RTEMS_BSD_SYS__TYPES_H_ */
diff --git a/rtemsbsd/include/rtems/bsd/sys/errno.h b/rtemsbsd/include/rtems/bsd/sys/errno.h
index 9b68014d..2ed71acc 100644
--- a/rtemsbsd/include/rtems/bsd/sys/errno.h
+++ b/rtemsbsd/include/rtems/bsd/sys/errno.h
@@ -35,11 +35,11 @@
* $FreeBSD$
*/
-#ifndef _SYS_ERRNO_HH_
-#define _SYS_ERRNO_HH_
+#ifndef _RTEMS_BSD_SYS_ERRNO_H_
+#define _RTEMS_BSD_SYS_ERRNO_H_
#ifndef _KERNEL
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__BEGIN_DECLS
int * __error(void);
__END_DECLS
@@ -181,6 +181,8 @@ __END_DECLS
#ifndef _POSIX_SOURCE
#define ELAST 93 /* Must be equal largest errno */
#endif /* _POSIX_SOURCE */
+#else /* __rtems__ */
+#include <errno.h>
#endif /* __rtems__ */
#ifdef _KERNEL
diff --git a/rtemsbsd/include/rtems/bsd/sys/lock.h b/rtemsbsd/include/rtems/bsd/sys/lock.h
index f86ec765..f252976c 100644
--- a/rtemsbsd/include/rtems/bsd/sys/lock.h
+++ b/rtemsbsd/include/rtems/bsd/sys/lock.h
@@ -29,11 +29,11 @@
* $FreeBSD$
*/
-#ifndef _SYS_LOCK_HH_
-#define _SYS_LOCK_HH_
+#ifndef _RTEMS_BSD_SYS_LOCK_H_
+#define _RTEMS_BSD_SYS_LOCK_H_
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/_lock.h>
+#include <sys/queue.h>
+#include <sys/_lock.h>
struct lock_list_entry;
struct thread;
@@ -316,4 +316,4 @@ void witness_thread_exit(struct thread *);
WITNESS_CHECKORDER(&(l)->lock_object, 0, LOCK_FILE, LOCK_LINE, NULL)
#endif /* _KERNEL */
-#endif /* _SYS_LOCK_HH_ */
+#endif /* _RTEMS_BSD_SYS_LOCK_H_ */
diff --git a/rtemsbsd/include/rtems/bsd/sys/param.h b/rtemsbsd/include/rtems/bsd/sys/param.h
index cd00ea4c..93e2ef44 100644
--- a/rtemsbsd/include/rtems/bsd/sys/param.h
+++ b/rtemsbsd/include/rtems/bsd/sys/param.h
@@ -35,10 +35,13 @@
* $FreeBSD$
*/
-#ifndef _SYS_PARAM_HH_
-#define _SYS_PARAM_HH_
+#ifndef _RTEMS_BSD_SYS_PARAM_H_
+#define _RTEMS_BSD_SYS_PARAM_H_
-#include <freebsd/sys/_null.h>
+#ifdef __rtems__
+#include <sys/param.h>
+#endif /* __rtems__ */
+#include <sys/_null.h>
#define BSD 199506 /* System version (year & month). */
#define BSD4_3 1
@@ -66,7 +69,7 @@
#endif
#ifndef LOCORE
-#include <freebsd/sys/types.h>
+#include <rtems/bsd/sys/types.h>
#endif
/*
@@ -76,11 +79,11 @@
* MAXCOMLEN should be >= sizeof(ac_comm) (see <acct.h>)
* MAXLOGNAME should be == UT_NAMESIZE+1 (see <utmp.h>)
*/
-#include <freebsd/sys/syslimits.h>
+#include <sys/syslimits.h>
#define MAXCOMLEN 19 /* max command name remembered */
-#define MAXINTERP 32 /* max interpreter file name length */
-#define MAXLOGNAME 17 /* max login name length (incl. NUL) */
+#define MAXINTERP PATH_MAX /* max interpreter file name length */
+#define MAXLOGNAME 33 /* max login name length (incl. NUL) */
#define MAXUPRC CHILD_MAX /* max simultaneous processes */
#define NCARGS ARG_MAX /* max bytes for an exec function */
#define NGROUPS (NGROUPS_MAX+1) /* max number groups */
@@ -91,11 +94,11 @@
/* More types and definitions used throughout the kernel. */
#ifdef _KERNEL
-#include <freebsd/sys/cdefs.h>
-#include <freebsd/sys/errno.h>
+#include <sys/cdefs.h>
+#include <rtems/bsd/sys/errno.h>
#ifndef LOCORE
-#include <freebsd/sys/time.h>
-#include <freebsd/sys/priority.h>
+#include <rtems/bsd/sys/time.h>
+#include <sys/priority.h>
#endif
#ifndef FALSE
@@ -108,13 +111,13 @@
#ifndef _KERNEL
/* Signals. */
-#include <freebsd/sys/signal.h>
+#include <sys/signal.h>
#endif
/* Machine type dependent parameters. */
-#include <freebsd/machine/param.h>
+#include <machine/rtems-bsd-param.h>
#ifndef _KERNEL
-#include <freebsd/sys/limits.h>
+#include <sys/limits.h>
#endif
#ifndef _NO_NAMESPACE_POLLUTION
@@ -329,4 +332,4 @@ __END_DECLS
#define member2struct(s, m, x) \
((struct s *)(void *)((char *)(x) - offsetof(struct s, m)))
-#endif /* _SYS_PARAM_HH_ */
+#endif /* _RTEMS_BSD_SYS_PARAM_H_ */
diff --git a/rtemsbsd/include/rtems/bsd/sys/resource.h b/rtemsbsd/include/rtems/bsd/sys/resource.h
index 74a43c34..09f68696 100644
--- a/rtemsbsd/include/rtems/bsd/sys/resource.h
+++ b/rtemsbsd/include/rtems/bsd/sys/resource.h
@@ -30,12 +30,12 @@
* $FreeBSD$
*/
-#ifndef _SYS_RESOURCE_HH_
-#define _SYS_RESOURCE_HH_
+#ifndef _RTEMS_BSD_SYS_RESOURCE_H_
+#define _RTEMS_BSD_SYS_RESOURCE_H_
-#include <freebsd/sys/cdefs.h>
-#include <freebsd/sys/_timeval.h>
-#include <freebsd/sys/_types.h>
+#include <sys/cdefs.h>
+#include <sys/_timeval.h>
+#include <rtems/bsd/sys/_types.h>
/*
* Process priority specifications to get/setpriority.
@@ -56,6 +56,7 @@
#define RUSAGE_SELF 0
#define RUSAGE_CHILDREN -1
+#ifndef __rtems__
#define RUSAGE_THREAD 1
struct rusage {
@@ -78,6 +79,9 @@ struct rusage {
long ru_nivcsw; /* involuntary " */
#define ru_last ru_nivcsw
};
+#else /* __rtems__ */
+#include <sys/resource.h>
+#endif /* __rtems__ */
/*
* Resource limits
@@ -173,4 +177,4 @@ int setrlimit(int, const struct rlimit *);
__END_DECLS
#endif /* _KERNEL */
-#endif /* !_SYS_RESOURCE_HH_ */
+#endif /* !_RTEMS_BSD_SYS_RESOURCE_H_ */
diff --git a/rtemsbsd/include/rtems/bsd/sys/time.h b/rtemsbsd/include/rtems/bsd/sys/time.h
index f34af077..7dea42bd 100644
--- a/rtemsbsd/include/rtems/bsd/sys/time.h
+++ b/rtemsbsd/include/rtems/bsd/sys/time.h
@@ -30,12 +30,15 @@
* $FreeBSD$
*/
-#ifndef _SYS_TIME_HH_
-#define _SYS_TIME_HH_
+#ifndef _RTEMS_BSD_SYS_TIME_H_
+#define _RTEMS_BSD_SYS_TIME_H_
-#include <freebsd/sys/_timeval.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/timespec.h>
+#include <sys/_timeval.h>
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/timespec.h>
+#ifdef __rtems__
+#include <sys/time.h>
+#endif /* __rtems__ */
#ifndef __rtems__
struct timezone {
@@ -320,10 +323,10 @@ void timevaladd(struct timeval *t1, const struct timeval *t2);
void timevalsub(struct timeval *t1, const struct timeval *t2);
int tvtohz(struct timeval *tv);
#else /* !_KERNEL */
-#include <freebsd/time.h>
+#include <time.h>
-#include <freebsd/sys/cdefs.h>
-#include <freebsd/sys/select.h>
+#include <sys/cdefs.h>
+#include <sys/select.h>
__BEGIN_DECLS
int setitimer(int, const struct itimerval *, struct itimerval *);
@@ -348,4 +351,4 @@ __END_DECLS
#endif /* !_KERNEL */
-#endif /* !_SYS_TIME_HH_ */
+#endif /* !_RTEMS_BSD_SYS_TIME_H_ */
diff --git a/rtemsbsd/include/rtems/bsd/sys/timespec.h b/rtemsbsd/include/rtems/bsd/sys/timespec.h
index 4ec4147e..19a4ba3e 100644
--- a/rtemsbsd/include/rtems/bsd/sys/timespec.h
+++ b/rtemsbsd/include/rtems/bsd/sys/timespec.h
@@ -1,10 +1,80 @@
-#define TIMEVAL_TO_TIMESPEC(tv, ts) \
- do { \
- (ts)->tv_sec = (tv)->tv_sec; \
- (ts)->tv_nsec = (tv)->tv_usec * 1000; \
- } while (0)
-#define TIMESPEC_TO_TIMEVAL(tv, ts) \
- do { \
- (tv)->tv_sec = (ts)->tv_sec; \
- (tv)->tv_usec = (ts)->tv_nsec / 1000; \
- } while (0)
+/*-
+ * Copyright (c) 1982, 1986, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)time.h 8.5 (Berkeley) 5/4/95
+ * from: FreeBSD: src/sys/sys/time.h,v 1.43 2000/03/20 14:09:05 phk Exp
+ * $FreeBSD$
+ */
+
+/*
+ * Prerequisites: <sys/cdefs.h>, <sys/_types.h>
+ */
+
+#ifndef _RTEMS_BSD_SYS_TIMESPEC_H_
+#define _RTEMS_BSD_SYS_TIMESPEC_H_
+
+#ifndef __rtems__
+#ifndef _TIME_T_DECLARED
+typedef __time_t time_t;
+#define _TIME_T_DECLARED
+#endif
+
+struct timespec {
+ time_t tv_sec; /* seconds */
+ long tv_nsec; /* and nanoseconds */
+};
+#else /* __rtems__ */
+#include <rtems/bsd/sys/types.h>
+#endif /* __rtems__ */
+
+#if __BSD_VISIBLE
+#define TIMEVAL_TO_TIMESPEC(tv, ts) \
+ do { \
+ (ts)->tv_sec = (tv)->tv_sec; \
+ (ts)->tv_nsec = (tv)->tv_usec * 1000; \
+ } while (0)
+#define TIMESPEC_TO_TIMEVAL(tv, ts) \
+ do { \
+ (tv)->tv_sec = (ts)->tv_sec; \
+ (tv)->tv_usec = (ts)->tv_nsec / 1000; \
+ } while (0)
+
+#endif /* __BSD_VISIBLE */
+
+#ifndef __rtems__
+/*
+ * Structure defined by POSIX.1b to be like a itimerval, but with
+ * timespecs. Used in the timer_*() system calls.
+ */
+struct itimerspec {
+ struct timespec it_interval;
+ struct timespec it_value;
+};
+#endif /* __rtems__ */
+
+#endif /* _RTEMS_BSD_SYS_TIMESPEC_H_ */
diff --git a/rtemsbsd/include/rtems/bsd/sys/types.h b/rtemsbsd/include/rtems/bsd/sys/types.h
index 38ae5c68..a8c47ef3 100644
--- a/rtemsbsd/include/rtems/bsd/sys/types.h
+++ b/rtemsbsd/include/rtems/bsd/sys/types.h
@@ -35,16 +35,17 @@
* $FreeBSD$
*/
-#ifndef _SYS_TYPES_HH_
-#define _SYS_TYPES_HH_
+#ifndef _RTEMS_BSD_SYS_TYPES_H_
+#define _RTEMS_BSD_SYS_TYPES_H_
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
/* Machine type dependent parameters. */
-#include <freebsd/machine/endian.h>
-#include <freebsd/sys/_types.h>
+#include <machine/rtems-bsd-endian.h>
+#include <rtems/bsd/sys/_types.h>
-#include <freebsd/sys/_pthreadtypes.h>
+#ifndef __rtems__
+#include <sys/_pthreadtypes.h>
#if __BSD_VISIBLE
typedef unsigned char u_char;
@@ -318,7 +319,7 @@ typedef struct vm_page *vm_page_t;
*/
#if __BSD_VISIBLE
-#include <freebsd/sys/select.h>
+#include <sys/select.h>
/*
* minor() gives a cookie instead of an index since we don't want to
@@ -356,5 +357,6 @@ __END_DECLS
#endif /* !_KERNEL */
#endif /* __BSD_VISIBLE */
+#endif /* __rtems__ */
-#endif /* !_SYS_TYPES_HH_ */
+#endif /* !_RTEMS_BSD_SYS_TYPES_H_ */
diff --git a/rtemsbsd/include/rtems/bsd/sys/unistd.h b/rtemsbsd/include/rtems/bsd/sys/unistd.h
index 2918d563..5c3208c7 100644
--- a/rtemsbsd/include/rtems/bsd/sys/unistd.h
+++ b/rtemsbsd/include/rtems/bsd/sys/unistd.h
@@ -30,11 +30,12 @@
* $FreeBSD$
*/
-#ifndef _SYS_UNISTD_HH_
-#define _SYS_UNISTD_HH_
+#ifndef _RTEMS_BSD_SYS_UNISTD_H_
+#define _RTEMS_BSD_SYS_UNISTD_H_
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
+#ifndef __rtems__
/*
* POSIX options and option groups we unconditionally do or don't
* implement. Those options which are implemented (or not) entirely
@@ -158,6 +159,9 @@
/* From OpenSolaris, used by SEEK_DATA/SEEK_HOLE. */
#define _PC_MIN_HOLE_SIZE 21
+#else /* __rtems__ */
+#include <unistd.h>
+#endif /* __rtems__ */
#if __BSD_VISIBLE
/*
@@ -185,4 +189,4 @@
#endif /* __BSD_VISIBLE */
-#endif /* !_SYS_UNISTD_HH_ */
+#endif /* !_RTEMS_BSD_SYS_UNISTD_H_ */
diff --git a/rtemsbsd/include/sys/_pthreadtypes.h b/rtemsbsd/include/sys/_pthreadtypes.h
index fa882cb5..936ffd88 100644
--- a/rtemsbsd/include/sys/_pthreadtypes.h
+++ b/rtemsbsd/include/sys/_pthreadtypes.h
@@ -1 +1 @@
-/* empty file */
+/* EMPTY */
diff --git a/rtemsbsd/include/sys/signalvar.h b/rtemsbsd/include/sys/signalvar.h
index baa28bdd..936ffd88 100644
--- a/rtemsbsd/include/sys/signalvar.h
+++ b/rtemsbsd/include/sys/signalvar.h
@@ -1 +1 @@
-/* deliberately empty file */
+/* EMPTY */
diff --git a/rtemsbsd/include/vm/vm_extern.h b/rtemsbsd/include/vm/vm_extern.h
new file mode 100644
index 00000000..936ffd88
--- /dev/null
+++ b/rtemsbsd/include/vm/vm_extern.h
@@ -0,0 +1 @@
+/* EMPTY */
diff --git a/rtemsbsd/include/vm/vm_kern.h b/rtemsbsd/include/vm/vm_kern.h
new file mode 100644
index 00000000..936ffd88
--- /dev/null
+++ b/rtemsbsd/include/vm/vm_kern.h
@@ -0,0 +1 @@
+/* EMPTY */
diff --git a/rtemsbsd/include/vm/vm_object.h b/rtemsbsd/include/vm/vm_object.h
new file mode 100644
index 00000000..936ffd88
--- /dev/null
+++ b/rtemsbsd/include/vm/vm_object.h
@@ -0,0 +1 @@
+/* EMPTY */
diff --git a/rtemsbsd/include/vm/vm_page.h b/rtemsbsd/include/vm/vm_page.h
new file mode 100644
index 00000000..936ffd88
--- /dev/null
+++ b/rtemsbsd/include/vm/vm_page.h
@@ -0,0 +1 @@
+/* EMPTY */
diff --git a/rtemsbsd/lm32/include/freebsd/machine/cpufunc.h b/rtemsbsd/lm32/include/freebsd/machine/cpufunc.h
deleted file mode 100644
index fa882cb5..00000000
--- a/rtemsbsd/lm32/include/freebsd/machine/cpufunc.h
+++ /dev/null
@@ -1 +0,0 @@
-/* empty file */
diff --git a/rtemsbsd/local/bus_if.c b/rtemsbsd/local/bus_if.c
index 10f9ef46..77a982b8 100644
--- a/rtemsbsd/local/bus_if.c
+++ b/rtemsbsd/local/bus_if.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*
* This file is produced automatically.
@@ -12,14 +12,14 @@
* See the source file for legal information
*/
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/kobj.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/local/bus_if.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <sys/kernel.h>
+#include <sys/kobj.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <rtems/bsd/local/bus_if.h>
static struct resource *
diff --git a/rtemsbsd/local/cryptodev_if.c b/rtemsbsd/local/cryptodev_if.c
index d4875e46..6b252130 100644
--- a/rtemsbsd/local/cryptodev_if.c
+++ b/rtemsbsd/local/cryptodev_if.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*
* This file is produced automatically.
@@ -12,13 +12,13 @@
* See the source file for legal information
*/
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/kobj.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/opencrypto/cryptodev.h>
-#include <freebsd/local/cryptodev_if.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <sys/kernel.h>
+#include <sys/kobj.h>
+#include <sys/malloc.h>
+#include <opencrypto/cryptodev.h>
+#include <rtems/bsd/local/cryptodev_if.h>
struct kobj_method cryptodev_newsession_method_default = {
&cryptodev_newsession_desc, (kobjop_t) kobj_error_method
diff --git a/rtemsbsd/local/device_if.c b/rtemsbsd/local/device_if.c
index e6f3189a..ba29ef4a 100644
--- a/rtemsbsd/local/device_if.c
+++ b/rtemsbsd/local/device_if.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*
* This file is produced automatically.
@@ -12,12 +12,12 @@
* See the source file for legal information
*/
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/kobj.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/local/device_if.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <sys/kernel.h>
+#include <sys/kobj.h>
+#include <sys/bus.h>
+#include <rtems/bsd/local/device_if.h>
static int null_shutdown(device_t dev)
diff --git a/rtemsbsd/local/miibus_if.c b/rtemsbsd/local/miibus_if.c
index 2f5127e8..6fbdd911 100644
--- a/rtemsbsd/local/miibus_if.c
+++ b/rtemsbsd/local/miibus_if.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*
* This file is produced automatically.
@@ -12,12 +12,12 @@
* See the source file for legal information
*/
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/kobj.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/local/miibus_if.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <sys/kernel.h>
+#include <sys/kobj.h>
+#include <sys/bus.h>
+#include <rtems/bsd/local/miibus_if.h>
struct kobj_method miibus_readreg_method_default = {
&miibus_readreg_desc, (kobjop_t) kobj_error_method
diff --git a/rtemsbsd/local/pci_if.c b/rtemsbsd/local/pci_if.c
index 257e890b..7a939f6a 100644
--- a/rtemsbsd/local/pci_if.c
+++ b/rtemsbsd/local/pci_if.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*
* This file is produced automatically.
@@ -12,12 +12,12 @@
* See the source file for legal information
*/
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/kobj.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/local/pci_if.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <sys/kernel.h>
+#include <sys/kobj.h>
+#include <sys/bus.h>
+#include <rtems/bsd/local/pci_if.h>
static int
diff --git a/rtemsbsd/local/pcib_if.c b/rtemsbsd/local/pcib_if.c
index cc460893..bdb60e44 100644
--- a/rtemsbsd/local/pcib_if.c
+++ b/rtemsbsd/local/pcib_if.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*
* This file is produced automatically.
@@ -12,13 +12,13 @@
* See the source file for legal information
*/
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/kobj.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/dev/pci/pcivar.h>
-#include <freebsd/local/pcib_if.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <sys/kernel.h>
+#include <sys/kobj.h>
+#include <sys/bus.h>
+#include <dev/pci/pcivar.h>
+#include <rtems/bsd/local/pcib_if.h>
static int
diff --git a/rtemsbsd/local/usb_if.c b/rtemsbsd/local/usb_if.c
index db9b2670..766b1243 100644
--- a/rtemsbsd/local/usb_if.c
+++ b/rtemsbsd/local/usb_if.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/*
* This file is produced automatically.
@@ -12,12 +12,12 @@
* See the source file for legal information
*/
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/kobj.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/local/usb_if.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <sys/kernel.h>
+#include <sys/kobj.h>
+#include <sys/bus.h>
+#include <rtems/bsd/local/usb_if.h>
struct kobj_method usb_handle_request_method_default = {
&usb_handle_request_desc, (kobjop_t) kobj_error_method
diff --git a/rtemsbsd/m32c/include/freebsd/machine/cpufunc.h b/rtemsbsd/m32c/include/freebsd/machine/cpufunc.h
deleted file mode 100644
index fa882cb5..00000000
--- a/rtemsbsd/m32c/include/freebsd/machine/cpufunc.h
+++ /dev/null
@@ -1 +0,0 @@
-/* empty file */
diff --git a/rtemsbsd/m32r/include/freebsd/machine/cpufunc.h b/rtemsbsd/m32r/include/freebsd/machine/cpufunc.h
deleted file mode 100644
index fa882cb5..00000000
--- a/rtemsbsd/m32r/include/freebsd/machine/cpufunc.h
+++ /dev/null
@@ -1 +0,0 @@
-/* empty file */
diff --git a/rtemsbsd/m68k/include/freebsd/machine/cpufunc.h b/rtemsbsd/m68k/include/freebsd/machine/cpufunc.h
deleted file mode 100644
index fa882cb5..00000000
--- a/rtemsbsd/m68k/include/freebsd/machine/cpufunc.h
+++ /dev/null
@@ -1 +0,0 @@
-/* empty file */
diff --git a/rtemsbsd/nios2/include/freebsd/machine/cpufunc.h b/rtemsbsd/nios2/include/freebsd/machine/cpufunc.h
deleted file mode 100644
index fa882cb5..00000000
--- a/rtemsbsd/nios2/include/freebsd/machine/cpufunc.h
+++ /dev/null
@@ -1 +0,0 @@
-/* empty file */
diff --git a/rtemsbsd/rtems/ipsec_get_policylen.c b/rtemsbsd/rtems/ipsec_get_policylen.c
index 160c5e52..c5d910ad 100644
--- a/rtemsbsd/rtems/ipsec_get_policylen.c
+++ b/rtemsbsd/rtems/ipsec_get_policylen.c
@@ -1,6 +1,6 @@
-#include <sys/types.h>
-#include <sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/param.h>
#include <netipsec/ipsec.h>
diff --git a/rtemsbsd/rtems/kvm_private.h b/rtemsbsd/rtems/kvm_private.h
index 7655511a..5b9c9b04 100644
--- a/rtemsbsd/rtems/kvm_private.h
+++ b/rtemsbsd/rtems/kvm_private.h
@@ -8,6 +8,6 @@ typedef struct {
uintptr_t value;
} kvm_symval_t;
-kvm_symval_t rtems_kvm_symbols[];
+extern kvm_symval_t rtems_kvm_symbols[];
#endif
diff --git a/rtemsbsd/rtems/rtems-bsd-assert.c b/rtemsbsd/rtems/rtems-bsd-assert.c
index 2228fe8d..410f1026 100644
--- a/rtemsbsd/rtems/rtems-bsd-assert.c
+++ b/rtemsbsd/rtems/rtems-bsd-assert.c
@@ -38,10 +38,10 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
void
rtems_bsd_assert_func(const char *file, int line, const char *func, const char *expr)
diff --git a/rtemsbsd/rtems/rtems-bsd-autoconf.c b/rtemsbsd/rtems/rtems-bsd-autoconf.c
index 94cf5355..5febcbcc 100644
--- a/rtemsbsd/rtems/rtems-bsd-autoconf.c
+++ b/rtemsbsd/rtems/rtems-bsd-autoconf.c
@@ -38,13 +38,13 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/kernel.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/kernel.h>
static void
configure_first(void *dummy)
diff --git a/rtemsbsd/rtems/rtems-bsd-bus-dma-mbuf.c b/rtemsbsd/rtems/rtems-bsd-bus-dma-mbuf.c
index 97e0149b..9056b489 100644
--- a/rtemsbsd/rtems/rtems-bsd-bus-dma-mbuf.c
+++ b/rtemsbsd/rtems/rtems-bsd-bus-dma-mbuf.c
@@ -43,10 +43,10 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
-#include <freebsd/machine/rtems-bsd-bus-dma.h>
+#include <machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-bus-dma.h>
-#include <freebsd/sys/mbuf.h>
+#include <sys/mbuf.h>
/*
* Like bus_dmamap_load(), but for mbufs.
diff --git a/rtemsbsd/rtems/rtems-bsd-bus-dma.c b/rtemsbsd/rtems/rtems-bsd-bus-dma.c
index e186e8ba..34f46eed 100644
--- a/rtemsbsd/rtems/rtems-bsd-bus-dma.c
+++ b/rtemsbsd/rtems/rtems-bsd-bus-dma.c
@@ -45,14 +45,14 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
-#include <freebsd/machine/rtems-bsd-cache.h>
-#include <freebsd/machine/rtems-bsd-bus-dma.h>
+#include <machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-cache.h>
+#include <machine/rtems-bsd-bus-dma.h>
#include <rtems/malloc.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/machine/atomic.h>
+#include <sys/malloc.h>
+#include <machine/atomic.h>
#ifdef CPU_DATA_CACHE_ALIGNMENT
#define CLSZ ((uintptr_t) CPU_DATA_CACHE_ALIGNMENT)
diff --git a/rtemsbsd/rtems/rtems-bsd-cam.c b/rtemsbsd/rtems/rtems-bsd-cam.c
index 1f039412..baad15f2 100644
--- a/rtemsbsd/rtems/rtems-bsd-cam.c
+++ b/rtemsbsd/rtems/rtems-bsd-cam.c
@@ -38,24 +38,24 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/condvar.h>
-
-#include <freebsd/cam/cam.h>
-#include <freebsd/cam/cam_ccb.h>
-#include <freebsd/cam/cam_sim.h>
-#include <freebsd/cam/cam_xpt.h>
-#include <freebsd/cam/cam_xpt_sim.h>
-#include <freebsd/cam/cam_debug.h>
-
-#include <freebsd/cam/scsi/scsi_all.h>
+#include <machine/rtems-bsd-config.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/condvar.h>
+
+#include <cam/cam.h>
+#include <cam/cam_ccb.h>
+#include <cam/cam_sim.h>
+#include <cam/cam_xpt.h>
+#include <cam/cam_xpt_sim.h>
+#include <cam/cam_debug.h>
+
+#include <cam/scsi/scsi_all.h>
#include <rtems/media.h>
#include <rtems/libio.h>
diff --git a/rtemsbsd/rtems/rtems-bsd-condvar.c b/rtemsbsd/rtems/rtems-bsd-condvar.c
index cb97174d..f5022191 100644
--- a/rtemsbsd/rtems/rtems-bsd-condvar.c
+++ b/rtemsbsd/rtems/rtems-bsd-condvar.c
@@ -37,19 +37,19 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
#include <rtems/score/objectimpl.h>
#include <rtems/score/threaddispatch.h>
#include <rtems/score/threadqimpl.h>
#include <rtems/posix/condimpl.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/condvar.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/condvar.h>
RTEMS_CHAIN_DEFINE_EMPTY(rtems_bsd_condvar_chain);
diff --git a/rtemsbsd/rtems/rtems-bsd-conf.c b/rtemsbsd/rtems/rtems-bsd-conf.c
index cfe8e823..bb1666c2 100644
--- a/rtemsbsd/rtems/rtems-bsd-conf.c
+++ b/rtemsbsd/rtems/rtems-bsd-conf.c
@@ -33,14 +33,14 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
#include <stdio.h>
#include <rtems.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/conf.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/conf.h>
struct cdev *
make_dev(struct cdevsw *devsw, int unit, uid_t uid, gid_t gid, int mode,
diff --git a/rtemsbsd/rtems/rtems-bsd-copyinout.c b/rtemsbsd/rtems/rtems-bsd-copyinout.c
index 334de961..3d3707a5 100644
--- a/rtemsbsd/rtems/rtems-bsd-copyinout.c
+++ b/rtemsbsd/rtems/rtems-bsd-copyinout.c
@@ -33,7 +33,7 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
#include <string.h>
#include <stdio.h>
diff --git a/rtemsbsd/rtems/rtems-bsd-delay.c b/rtemsbsd/rtems/rtems-bsd-delay.c
index e7fe9ae9..9eb34c40 100644
--- a/rtemsbsd/rtems/rtems-bsd-delay.c
+++ b/rtemsbsd/rtems/rtems-bsd-delay.c
@@ -38,12 +38,12 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
void
DELAY(int usec)
diff --git a/rtemsbsd/rtems/rtems-bsd-descrip.c b/rtemsbsd/rtems/rtems-bsd-descrip.c
index 72539987..d0d7944e 100644
--- a/rtemsbsd/rtems/rtems-bsd-descrip.c
+++ b/rtemsbsd/rtems/rtems-bsd-descrip.c
@@ -32,27 +32,27 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
-#include <freebsd/sys/conf.h>
-#include <freebsd/sys/domain.h>
-#include <freebsd/sys/fcntl.h>
-#include <freebsd/sys/file.h>
-#include <freebsd/sys/filedesc.h>
-#include <freebsd/sys/filio.h>
-#include <freebsd/sys/jail.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/limits.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/mount.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/namei.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/proc.h>
+#include <sys/conf.h>
+#include <sys/domain.h>
+#include <sys/fcntl.h>
+#include <sys/file.h>
+#include <sys/filedesc.h>
+#include <sys/filio.h>
+#include <sys/jail.h>
+#include <sys/kernel.h>
+#include <sys/limits.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/malloc.h>
+#include <sys/mount.h>
+#include <sys/mutex.h>
+#include <sys/namei.h>
+#include <sys/priv.h>
+#include <sys/proc.h>
/*
* This routine is not supported in the RTEMS interface
diff --git a/rtemsbsd/rtems/rtems-bsd-generic.c b/rtemsbsd/rtems/rtems-bsd-generic.c
index 4b32f6df..b7d7e110 100644
--- a/rtemsbsd/rtems/rtems-bsd-generic.c
+++ b/rtemsbsd/rtems/rtems-bsd-generic.c
@@ -37,21 +37,21 @@
* SUCH DAMAGE.
*/
-#include <sys/types.h> //needed for fd_mask and such
-#include <freebsd/machine/rtems-bsd-config.h>
-
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/selinfo.h>
-#include <freebsd/sys/fcntl.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/select.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/malloc.h>
+#include <rtems/bsd/sys/types.h> //needed for fd_mask and such
+#include <machine/rtems-bsd-config.h>
+
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/selinfo.h>
+#include <sys/fcntl.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/protosw.h>
+#include <sys/select.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/malloc.h>
void selrecord(struct thread *selector, struct selinfo *sip)
{
diff --git a/rtemsbsd/rtems/rtems-bsd-init-with-irq.c b/rtemsbsd/rtems/rtems-bsd-init-with-irq.c
index c1917e6b..a663fe34 100644
--- a/rtemsbsd/rtems/rtems-bsd-init-with-irq.c
+++ b/rtemsbsd/rtems/rtems-bsd-init-with-irq.c
@@ -37,11 +37,11 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
#include <rtems/irq-extension.h>
-#include <freebsd/bsd.h>
+#include <rtems/bsd/bsd.h>
rtems_status_code
rtems_bsd_initialize_with_interrupt_server(void)
diff --git a/rtemsbsd/rtems/rtems-bsd-init.c b/rtemsbsd/rtems/rtems-bsd-init.c
index 429f0649..22cb1440 100644
--- a/rtemsbsd/rtems/rtems-bsd-init.c
+++ b/rtemsbsd/rtems/rtems-bsd-init.c
@@ -37,17 +37,17 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/proc.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/proc.h>
-#include <freebsd/bsd.h>
+#include <rtems/bsd/bsd.h>
/* In FreeBSD this is a local function */
void mi_startup(void);
diff --git a/rtemsbsd/rtems/rtems-bsd-jail.c b/rtemsbsd/rtems/rtems-bsd-jail.c
index 6294e98c..d6e0c345 100644
--- a/rtemsbsd/rtems/rtems-bsd-jail.c
+++ b/rtemsbsd/rtems/rtems-bsd-jail.c
@@ -37,38 +37,38 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
-/*#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/jail.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>*/
+/*#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/jail.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>*/
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/errno.h>
-#include <freebsd/sys/sysproto.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/osd.h>
-#include <freebsd/sys/priv.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/taskqueue.h>
-#include <freebsd/sys/fcntl.h>
-#include <freebsd/sys/jail.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/sysent.h>
-#include <freebsd/sys/namei.h>
-#include <freebsd/sys/mount.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/syscallsubr.h>
-#include <freebsd/sys/sysctl.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/kernel.h>
+#include <sys/systm.h>
+#include <rtems/bsd/sys/errno.h>
+#include <sys/sysproto.h>
+#include <sys/malloc.h>
+#include <sys/osd.h>
+#include <sys/priv.h>
+#include <sys/proc.h>
+#include <sys/taskqueue.h>
+#include <sys/fcntl.h>
+#include <sys/jail.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/sx.h>
+#include <sys/sysent.h>
+#include <sys/namei.h>
+#include <sys/mount.h>
+#include <sys/queue.h>
+#include <sys/socket.h>
+#include <sys/syscallsubr.h>
+#include <sys/sysctl.h>
#define DEFAULT_HOSTUUID "00000000-0000-0000-0000-000000000000"
diff --git a/rtemsbsd/rtems/rtems-bsd-lock.c b/rtemsbsd/rtems/rtems-bsd-lock.c
index 6af64ea0..fbcc6710 100644
--- a/rtemsbsd/rtems/rtems-bsd-lock.c
+++ b/rtemsbsd/rtems/rtems-bsd-lock.c
@@ -40,17 +40,17 @@
/* Necessary to obtain some internal functions */
#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/ktr.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/rwlock.h>
-#include <freebsd/sys/proc.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/ktr.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/sx.h>
+#include <sys/rwlock.h>
+#include <sys/proc.h>
struct lock_class *lock_classes[LOCK_CLASS_MAX + 1] = {
&lock_class_mtx_spin,
diff --git a/rtemsbsd/rtems/rtems-bsd-log.c b/rtemsbsd/rtems/rtems-bsd-log.c
index 05d94e89..fee0b1cc 100644
--- a/rtemsbsd/rtems/rtems-bsd-log.c
+++ b/rtemsbsd/rtems/rtems-bsd-log.c
@@ -32,10 +32,10 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
/*
* Log writes to the log buffer, and guarantees not to sleep (so can be
diff --git a/rtemsbsd/rtems/rtems-bsd-malloc.c b/rtemsbsd/rtems/rtems-bsd-malloc.c
index 244f6a66..f5484712 100644
--- a/rtemsbsd/rtems/rtems-bsd-malloc.c
+++ b/rtemsbsd/rtems/rtems-bsd-malloc.c
@@ -37,13 +37,13 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/kernel.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/kernel.h>
MALLOC_DEFINE(M_DEVBUF, "devbuf", "device driver memory");
diff --git a/rtemsbsd/rtems/rtems-bsd-mutex.c b/rtemsbsd/rtems/rtems-bsd-mutex.c
index 23249148..bc364191 100644
--- a/rtemsbsd/rtems/rtems-bsd-mutex.c
+++ b/rtemsbsd/rtems/rtems-bsd-mutex.c
@@ -37,18 +37,18 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
#include <rtems/score/objectimpl.h>
#include <rtems/rtems/attrimpl.h>
#include <rtems/rtems/semimpl.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/proc.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/proc.h>
static void assert_mtx(struct lock_object *lock, int what);
static void lock_mtx(struct lock_object *lock, int how);
diff --git a/rtemsbsd/rtems/rtems-bsd-nexus.c b/rtemsbsd/rtems/rtems-bsd-nexus.c
index ba85c05d..1c2ef7a3 100644
--- a/rtemsbsd/rtems/rtems-bsd-nexus.c
+++ b/rtemsbsd/rtems/rtems-bsd-nexus.c
@@ -37,24 +37,24 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
-#include <freebsd/machine/rtems-bsd-sysinit.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/rman.h>
-#include <freebsd/sys/malloc.h>
+#include <machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-sysinit.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
+#include <sys/rman.h>
+#include <sys/malloc.h>
#include <bsp.h>
-#include <freebsd/machine/rtems-bsd-devicet.h>
+#include <machine/rtems-bsd-devicet.h>
#include <bsp/irq.h>
#include <rtems/irq.h>
#include <rtems/irq-extension.h>
-#include <freebsd/machine/bus.h>
+#include <machine/bus.h>
/* XXX Note: These defines should be moved. */
#if defined(__i386__)
@@ -180,9 +180,10 @@ nexus_attach(device_t dev)
static int
nexus_probe(device_t dev)
{
- size_t unit = 0;
#if 0
/* FIXME */
+ size_t unit = 0;
+
for (unit = 0; _bsd_nexus_devices [unit] != NULL; ++unit) {
device_add_child(dev, _bsd_nexus_devices [unit], unit);
}
@@ -353,9 +354,6 @@ nexus_release_resource(device_t bus, device_t child, int type, int rid,
return (rman_release_resource(r));
}
-static void noop(const rtems_irq_connect_data *unused) {};
-static int noop1(const rtems_irq_connect_data *unused) { return 0;};
-
static int
bspExtInstallSharedISR(int irqLine, void (*isr)(void *), void * uarg, int flags)
{
diff --git a/rtemsbsd/rtems/rtems-bsd-page.c b/rtemsbsd/rtems/rtems-bsd-page.c
index 2a807178..250c8fb0 100644
--- a/rtemsbsd/rtems/rtems-bsd-page.c
+++ b/rtemsbsd/rtems/rtems-bsd-page.c
@@ -37,11 +37,11 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/malloc.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
#include <rtems/chain.h>
diff --git a/rtemsbsd/rtems/rtems-bsd-panic.c b/rtemsbsd/rtems/rtems-bsd-panic.c
index e4361110..6b1d8507 100644
--- a/rtemsbsd/rtems/rtems-bsd-panic.c
+++ b/rtemsbsd/rtems/rtems-bsd-panic.c
@@ -37,15 +37,15 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/proc.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/proc.h>
static void
suspend_all_threads(void)
diff --git a/rtemsbsd/rtems/rtems-bsd-pci_bus.c b/rtemsbsd/rtems/rtems-bsd-pci_bus.c
new file mode 100644
index 00000000..4ceddfce
--- /dev/null
+++ b/rtemsbsd/rtems/rtems-bsd-pci_bus.c
@@ -0,0 +1,71 @@
+#include <machine/rtems-bsd-config.h>
+
+/**
+ * @file
+ *
+ * @ingroup rtems_bsd_rtems
+ *
+ * @brief This file contains methods that are rtems specific implementation
+ * of methods in pci_bus.c.
+ */
+
+/*
+ * COPYRIGHT (c) 2012. On-Line Applications Research Corporation (OAR).
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <rtems/bsd/local/opt_cpu.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/kernel.h>
+
+#include <dev/pci/pcivar.h>
+#include <dev/pci/pcireg.h>
+#include <dev/pci/pcib_private.h>
+#include <machine/resource.h>
+
+#include <rtems/bsd/local/pcib_if.h>
+#include <rtems/pci.h>
+#include <machine/bus.h>
+
+int
+pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin)
+{
+ int bus;
+ int slot;
+ int func;
+ uint8_t irq;
+
+ bus = pci_get_bus(dev);
+ slot = pci_get_slot(dev);
+ func = pci_get_function(dev);
+
+ pci_read_config_byte(bus, slot, func, PCI_INTERRUPT_LINE, &irq);
+ return irq;
+}
diff --git a/rtemsbsd/rtems/rtems-bsd-pci_cfgreg.c b/rtemsbsd/rtems/rtems-bsd-pci_cfgreg.c
index c6d47823..14c9edd0 100644
--- a/rtemsbsd/rtems/rtems-bsd-pci_cfgreg.c
+++ b/rtemsbsd/rtems/rtems-bsd-pci_cfgreg.c
@@ -1,4 +1,4 @@
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
/**
* @file
@@ -36,18 +36,18 @@
* SUCH DAMAGE.
*/
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/dev/pci/pcivar.h>
-#include <freebsd/dev/pci/pcireg.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/sysctl.h>
+#include <dev/pci/pcivar.h>
+#include <dev/pci/pcireg.h>
#include <rtems/pci.h>
diff --git a/rtemsbsd/rtems/rtems-bsd-rwlock.c b/rtemsbsd/rtems/rtems-bsd-rwlock.c
index a38a9a14..50e39997 100644
--- a/rtemsbsd/rtems/rtems-bsd-rwlock.c
+++ b/rtemsbsd/rtems/rtems-bsd-rwlock.c
@@ -37,19 +37,16 @@
* SUCH DAMAGE.
*/
-#include <pthread.h>
-
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
#include <rtems/score/objectimpl.h>
#include <rtems/posix/rwlockimpl.h>
-#include <sys/types.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/rwlock.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/rwlock.h>
#ifndef INVARIANTS
#define _rw_assert(rw, what, file, line)
@@ -234,7 +231,7 @@ _rw_wlock(struct rwlock *rw, const char *file, int line)
{
int iret;
- pthread_rwlock_wrlock( &rw->lock_object.lo_id );
+ iret = pthread_rwlock_wrlock( &rw->lock_object.lo_id );
BSD_ASSERT( iret == 0 );
return 0;
diff --git a/rtemsbsd/rtems/rtems-bsd-shell.c b/rtemsbsd/rtems/rtems-bsd-shell.c
index f80e9371..fba191a0 100644
--- a/rtemsbsd/rtems/rtems-bsd-shell.c
+++ b/rtemsbsd/rtems/rtems-bsd-shell.c
@@ -37,18 +37,18 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/condvar.h>
-#include <freebsd/sys/proc.h>
-
-#include <freebsd/bsd.h>
+#include <machine/rtems-bsd-config.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/callout.h>
+#include <sys/condvar.h>
+#include <sys/proc.h>
+
+#include <rtems/bsd/bsd.h>
#include <rtems/shell.h>
static void
diff --git a/rtemsbsd/rtems/rtems-bsd-signal.c b/rtemsbsd/rtems/rtems-bsd-signal.c
index 8ba40693..0c024487 100644
--- a/rtemsbsd/rtems/rtems-bsd-signal.c
+++ b/rtemsbsd/rtems/rtems-bsd-signal.c
@@ -37,11 +37,11 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/signalvar.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/signalvar.h>
void
psignal(struct proc *p, int sig)
diff --git a/rtemsbsd/rtems/rtems-bsd-smp.c b/rtemsbsd/rtems/rtems-bsd-smp.c
index f2a46520..f6cbfc8c 100644
--- a/rtemsbsd/rtems/rtems-bsd-smp.c
+++ b/rtemsbsd/rtems/rtems-bsd-smp.c
@@ -33,13 +33,13 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
-#include <freebsd/sys/types.h>
+#include <rtems/bsd/sys/types.h>
-#include <freebsd/sys/smp.h>
-#include <freebsd/machine/smp.h>
-#include <freebsd/sys/sysctl.h>
+#include <sys/smp.h>
+#include <machine/smp.h>
+#include <sys/sysctl.h>
int mp_ncpus;
int mp_maxcpus;
diff --git a/rtemsbsd/rtems/rtems-bsd-subr_param.c b/rtemsbsd/rtems/rtems-bsd-subr_param.c
index 5bdc63d2..efbd7384 100644
--- a/rtemsbsd/rtems/rtems-bsd-subr_param.c
+++ b/rtemsbsd/rtems/rtems-bsd-subr_param.c
@@ -32,6 +32,6 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
int vm_guest = 0;
diff --git a/rtemsbsd/rtems/rtems-bsd-support.c b/rtemsbsd/rtems/rtems-bsd-support.c
index 8c0ccac7..ed34a10a 100644
--- a/rtemsbsd/rtems/rtems-bsd-support.c
+++ b/rtemsbsd/rtems/rtems-bsd-support.c
@@ -39,14 +39,14 @@
/* FIXME: This file needs careful review. */
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
#include <rtems/score/threaddispatch.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/uio.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/uio.h>
int maxproc = 32; /* XXX Used value of rtems KERN_MAXPROC */
int ngroups_max = NGROUPS_MAX; /* XXX */
diff --git a/rtemsbsd/rtems/rtems-bsd-sx.c b/rtemsbsd/rtems/rtems-bsd-sx.c
index 73df4f6f..5b2bc4da 100644
--- a/rtemsbsd/rtems/rtems-bsd-sx.c
+++ b/rtemsbsd/rtems/rtems-bsd-sx.c
@@ -37,17 +37,17 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
#include <rtems/score/objectimpl.h>
#include <rtems/rtems/attrimpl.h>
#include <rtems/rtems/semimpl.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/sx.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/sx.h>
#ifndef INVARIANTS
#define _sx_assert(sx, what, file, line)
diff --git a/rtemsbsd/rtems/rtems-bsd-synch.c b/rtemsbsd/rtems/rtems-bsd-synch.c
index 40e08e1c..19ab0971 100644
--- a/rtemsbsd/rtems/rtems-bsd-synch.c
+++ b/rtemsbsd/rtems/rtems-bsd-synch.c
@@ -41,22 +41,22 @@
* FIXME: This seems to be a completely broken implementation.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
#include <rtems/score/statesimpl.h>
#include <rtems/score/threaddispatch.h>
#include <rtems/score/thread.h>
#include <rtems/score/threadqimpl.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/ktr.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/machine/pcpu.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/ktr.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/proc.h>
+#include <machine/pcpu.h>
#define STATES_WAITING_FOR_SLEEP 0x40000
diff --git a/rtemsbsd/rtems/rtems-bsd-syscall-api.c b/rtemsbsd/rtems/rtems-bsd-syscall-api.c
new file mode 100644
index 00000000..63274a0e
--- /dev/null
+++ b/rtemsbsd/rtems/rtems-bsd-syscall-api.c
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2013 embedded brains GmbH. All rights reserved.
+ *
+ * embedded brains GmbH
+ * Dornierstr. 4
+ * 82178 Puchheim
+ * Germany
+ * <rtems@embedded-brains.de>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <machine/rtems-bsd-syscall-api.h>
diff --git a/rtemsbsd/rtems/rtems-bsd-syscalls.c b/rtemsbsd/rtems/rtems-bsd-syscalls.c
index 821fcc9c..4ae9de44 100644
--- a/rtemsbsd/rtems/rtems-bsd-syscalls.c
+++ b/rtemsbsd/rtems/rtems-bsd-syscalls.c
@@ -37,24 +37,24 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
-
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/fcntl.h>
-#include <freebsd/sys/protosw.h>
-#include <freebsd/sys/mbuf.h>
-#include <freebsd/sys/socket.h>
-#include <freebsd/sys/socketvar.h>
-#include <freebsd/sys/uio.h>
-#include <freebsd/machine/pcpu.h>
-#include <freebsd/net/vnet.h>
+#include <machine/rtems-bsd-config.h>
+
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/malloc.h>
+#include <sys/proc.h>
+#include <sys/fcntl.h>
+#include <sys/protosw.h>
+#include <sys/mbuf.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/uio.h>
+#include <machine/pcpu.h>
+#include <net/vnet.h>
#include <rtems/libio_.h>
#include <rtems/libio.h>
diff --git a/rtemsbsd/rtems/rtems-bsd-sysctl.c b/rtemsbsd/rtems/rtems-bsd-sysctl.c
index 8d3b7570..bd9f31f6 100644
--- a/rtemsbsd/rtems/rtems-bsd-sysctl.c
+++ b/rtemsbsd/rtems/rtems-bsd-sysctl.c
@@ -37,10 +37,11 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/sysctl.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/sysctl.h>
+#include <sys/errno.h>
int sysctl(
int *name,
diff --git a/rtemsbsd/rtems/rtems-bsd-sysctlbyname.c b/rtemsbsd/rtems/rtems-bsd-sysctlbyname.c
index 6b7c2018..a0ba592b 100644
--- a/rtemsbsd/rtems/rtems-bsd-sysctlbyname.c
+++ b/rtemsbsd/rtems/rtems-bsd-sysctlbyname.c
@@ -18,13 +18,13 @@
*
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/sysctl.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/sysctl.h>
int
sysctlbyname(const char *name, void *oldp, size_t *oldlenp,
diff --git a/rtemsbsd/rtems/rtems-bsd-sysctlnametomib.c b/rtemsbsd/rtems/rtems-bsd-sysctlnametomib.c
index ecd5cbf1..6f65fa5c 100644
--- a/rtemsbsd/rtems/rtems-bsd-sysctlnametomib.c
+++ b/rtemsbsd/rtems/rtems-bsd-sysctlnametomib.c
@@ -34,13 +34,13 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/sysctl.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/sysctl.h>
#include <string.h>
/*
diff --git a/rtemsbsd/rtems/rtems-bsd-taskqueue.c b/rtemsbsd/rtems/rtems-bsd-taskqueue.c
index 36bbf235..58959df2 100644
--- a/rtemsbsd/rtems/rtems-bsd-taskqueue.c
+++ b/rtemsbsd/rtems/rtems-bsd-taskqueue.c
@@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$");
#include <rtems.h>
#include <rtems/error.h>
-#include <freebsd/machine/rtems-bsd-taskqueue.h>
+#include <machine/rtems-bsd-taskqueue.h>
/*
#define STATIC static
diff --git a/rtemsbsd/rtems/rtems-bsd-thread.c b/rtemsbsd/rtems/rtems-bsd-thread.c
index ca1ff1f2..357fb45c 100644
--- a/rtemsbsd/rtems/rtems-bsd-thread.c
+++ b/rtemsbsd/rtems/rtems-bsd-thread.c
@@ -37,19 +37,19 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
-
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/kthread.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/jail.h>
-#include <freebsd/sys/resourcevar.h>
-#include <freebsd/sys/filedesc.h>
+#include <machine/rtems-bsd-config.h>
+
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/proc.h>
+#include <sys/kthread.h>
+#include <sys/malloc.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/jail.h>
+#include <sys/resourcevar.h>
+#include <sys/filedesc.h>
RTEMS_CHAIN_DEFINE_EMPTY(rtems_bsd_thread_chain);
diff --git a/rtemsbsd/rtems/rtems-bsd-thread0-ucred.c b/rtemsbsd/rtems/rtems-bsd-thread0-ucred.c
index 4ff61ea4..095e360b 100644
--- a/rtemsbsd/rtems/rtems-bsd-thread0-ucred.c
+++ b/rtemsbsd/rtems/rtems-bsd-thread0-ucred.c
@@ -30,14 +30,15 @@
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/proc.h>
-#include <freebsd/sys/jail.h>
-#include <freebsd/sys/kernel.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/proc.h>
+#include <sys/jail.h>
+#include <sys/kernel.h>
+#include <sys/resourcevar.h>
struct ucred *rtems_bsd_thread0_ucred;
@@ -46,7 +47,6 @@ static void rtems_bsd_thread0_ucred_init(void *arg)
rtems_bsd_thread0_ucred = crget();
rtems_bsd_thread0_ucred->cr_ngroups = 1; /* group 0 */
rtems_bsd_thread0_ucred->cr_uidinfo = uifind(0);
- rtems_bsd_thread0_ucred = uifind(0);
rtems_bsd_thread0_ucred->cr_prison = &prison0;
}
diff --git a/rtemsbsd/rtems/rtems-bsd-timesupport.c b/rtemsbsd/rtems/rtems-bsd-timesupport.c
index 5d730c45..c26c0b07 100644
--- a/rtemsbsd/rtems/rtems-bsd-timesupport.c
+++ b/rtemsbsd/rtems/rtems-bsd-timesupport.c
@@ -37,7 +37,7 @@
* This violation is specifically for _Timespec_To_ticks
*/
#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
#include <rtems/score/timespec.h>
diff --git a/rtemsbsd/rtems/rtems-bsd-vm_glue.c b/rtemsbsd/rtems/rtems-bsd-vm_glue.c
index 284f7d60..9bee98e5 100644
--- a/rtemsbsd/rtems/rtems-bsd-vm_glue.c
+++ b/rtemsbsd/rtems/rtems-bsd-vm_glue.c
@@ -32,19 +32,19 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
-#include <freebsd/sys/types.h>
-#include <sys/param.h>
-#include <sys/lock.h>
+#include <rtems/bsd/sys/types.h>
+#include <rtems/bsd/sys/param.h>
+#include <rtems/bsd/sys/lock.h>
#include <sys/sched.h>
-#include <freebsd/sys/cdefs.h>
+#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <freebsd/sys/kernel.h>
-#include <freebsd/vm/uma.h>
-#include <freebsd/vm/uma_int.h>
-#include <freebsd/sys/systm.h>
+#include <sys/kernel.h>
+#include <vm/uma.h>
+#include <vm/uma_int.h>
+#include <sys/systm.h>
/*
* System initialization
diff --git a/rtemsbsd/rtems/rtems-net-setup.c b/rtemsbsd/rtems/rtems-net-setup.c
index 7774cd26..6f33a08b 100644
--- a/rtemsbsd/rtems/rtems-net-setup.c
+++ b/rtemsbsd/rtems/rtems-net-setup.c
@@ -4,8 +4,9 @@
* XXX integrate using old configuration structure as it makes sense
*/
-#include <freebsd/bsd.h>
#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <sys/errno.h>
#include <net/if.h>
#include <netinet/in.h>
#include <arpa/inet.h>
diff --git a/rtemsbsd/rtems/rtems-syspoll.c b/rtemsbsd/rtems/rtems-syspoll.c
index d53d14e8..33e05006 100644
--- a/rtemsbsd/rtems/rtems-syspoll.c
+++ b/rtemsbsd/rtems/rtems-syspoll.c
@@ -3,7 +3,7 @@
#include <sys/time.h>
#include <rtems.h>
#include <rtems/error.h>
-#include <freebsd/sys/poll.h>
+#include <sys/poll.h>
struct poll_args {
struct pollfd *fds;
diff --git a/rtemsbsd/rtems/rtems-uthread_kqueue.c b/rtemsbsd/rtems/rtems-uthread_kqueue.c
index 0693412f..268ca658 100644
--- a/rtemsbsd/rtems/rtems-uthread_kqueue.c
+++ b/rtemsbsd/rtems/rtems-uthread_kqueue.c
@@ -1,4 +1,4 @@
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <fcntl.h>
#include <unistd.h>
#include <rtems.h>
diff --git a/rtemsbsd/rtems/syslog.c b/rtemsbsd/rtems/syslog.c
index 10a75a61..f2f20fd0 100644
--- a/rtemsbsd/rtems/syslog.c
+++ b/rtemsbsd/rtems/syslog.c
@@ -11,7 +11,7 @@
#include <stdarg.h>
#include <errno.h>
#include <syslog.h>
-#include <sys/types.h>
+#include <rtems/bsd/sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <string.h>
diff --git a/rtemsbsd/sh/include/freebsd/machine/cpufunc.h b/rtemsbsd/sh/include/freebsd/machine/cpufunc.h
deleted file mode 100644
index fa882cb5..00000000
--- a/rtemsbsd/sh/include/freebsd/machine/cpufunc.h
+++ /dev/null
@@ -1 +0,0 @@
-/* empty file */
diff --git a/rtemsbsd/sparc/include/freebsd/machine/cpufunc.h b/rtemsbsd/sparc/include/freebsd/machine/cpufunc.h
deleted file mode 100644
index fa882cb5..00000000
--- a/rtemsbsd/sparc/include/freebsd/machine/cpufunc.h
+++ /dev/null
@@ -1 +0,0 @@
-/* empty file */
diff --git a/rtemsbsd/sys/dev/usb/controller/ehci_mpc83xx.c b/rtemsbsd/sys/dev/usb/controller/ehci_mpc83xx.c
index 88952e5f..b9bc7244 100644
--- a/rtemsbsd/sys/dev/usb/controller/ehci_mpc83xx.c
+++ b/rtemsbsd/sys/dev/usb/controller/ehci_mpc83xx.c
@@ -12,7 +12,7 @@
* http://www.rtems.com/license/LICENSE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
#include <bsp.h>
@@ -33,38 +33,38 @@
#define BSP_EHCI_IRQ_VECTOR QORIQ_IRQ_USB_1
#endif
-#include <freebsd/sys/cdefs.h>
-#include <freebsd/sys/stdint.h>
-#include <freebsd/sys/stddef.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/linker_set.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/condvar.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/unistd.h>
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/priv.h>
-
-#include <freebsd/dev/usb/usb.h>
-#include <freebsd/dev/usb/usbdi.h>
-
-#include <freebsd/dev/usb/usb_core.h>
-#include <freebsd/dev/usb/usb_busdma.h>
-#include <freebsd/dev/usb/usb_process.h>
-#include <freebsd/dev/usb/usb_util.h>
-
-#include <freebsd/dev/usb/usb_controller.h>
-#include <freebsd/dev/usb/usb_bus.h>
-#include <freebsd/dev/usb/controller/ehci.h>
+#include <sys/cdefs.h>
+#include <sys/stdint.h>
+#include <sys/stddef.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/bus.h>
+#include <sys/linker_set.h>
+#include <sys/module.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/condvar.h>
+#include <sys/sysctl.h>
+#include <sys/sx.h>
+#include <rtems/bsd/sys/unistd.h>
+#include <sys/callout.h>
+#include <sys/malloc.h>
+#include <sys/priv.h>
+
+#include <dev/usb/usb.h>
+#include <dev/usb/usbdi.h>
+
+#include <dev/usb/usb_core.h>
+#include <dev/usb/usb_busdma.h>
+#include <dev/usb/usb_process.h>
+#include <dev/usb/usb_util.h>
+
+#include <dev/usb/usb_controller.h>
+#include <dev/usb/usb_bus.h>
+#include <dev/usb/controller/ehci.h>
static device_probe_t ehci_mpc83xx_probe;
static device_attach_t ehci_mpc83xx_attach;
diff --git a/rtemsbsd/sys/dev/usb/controller/ohci_lpc24xx.c b/rtemsbsd/sys/dev/usb/controller/ohci_lpc24xx.c
index dc32510c..72077906 100644
--- a/rtemsbsd/sys/dev/usb/controller/ohci_lpc24xx.c
+++ b/rtemsbsd/sys/dev/usb/controller/ohci_lpc24xx.c
@@ -12,7 +12,7 @@
* http://www.rtems.com/license/LICENSE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
#include <bsp.h>
@@ -22,38 +22,38 @@
#include <bsp/io.h>
#include <bsp/lpc24xx.h>
-#include <freebsd/sys/cdefs.h>
-#include <freebsd/sys/stdint.h>
-#include <freebsd/sys/stddef.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/linker_set.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/condvar.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/unistd.h>
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/priv.h>
-
-#include <freebsd/dev/usb/usb.h>
-#include <freebsd/dev/usb/usbdi.h>
-
-#include <freebsd/dev/usb/usb_core.h>
-#include <freebsd/dev/usb/usb_busdma.h>
-#include <freebsd/dev/usb/usb_process.h>
-#include <freebsd/dev/usb/usb_util.h>
-
-#include <freebsd/dev/usb/usb_controller.h>
-#include <freebsd/dev/usb/usb_bus.h>
-#include <freebsd/dev/usb/controller/ohci.h>
+#include <sys/cdefs.h>
+#include <sys/stdint.h>
+#include <sys/stddef.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/bus.h>
+#include <sys/linker_set.h>
+#include <sys/module.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/condvar.h>
+#include <sys/sysctl.h>
+#include <sys/sx.h>
+#include <rtems/bsd/sys/unistd.h>
+#include <sys/callout.h>
+#include <sys/malloc.h>
+#include <sys/priv.h>
+
+#include <dev/usb/usb.h>
+#include <dev/usb/usbdi.h>
+
+#include <dev/usb/usb_core.h>
+#include <dev/usb/usb_busdma.h>
+#include <dev/usb/usb_process.h>
+#include <dev/usb/usb_util.h>
+
+#include <dev/usb/usb_controller.h>
+#include <dev/usb/usb_bus.h>
+#include <dev/usb/controller/ohci.h>
static device_probe_t ohci_lpc24xx_probe;
static device_attach_t ohci_lpc24xx_attach;
diff --git a/rtemsbsd/sys/dev/usb/controller/ohci_lpc32xx.c b/rtemsbsd/sys/dev/usb/controller/ohci_lpc32xx.c
index 9c7e8efb..ee3a0ebf 100644
--- a/rtemsbsd/sys/dev/usb/controller/ohci_lpc32xx.c
+++ b/rtemsbsd/sys/dev/usb/controller/ohci_lpc32xx.c
@@ -12,7 +12,7 @@
* http://www.rtems.com/license/LICENSE.
*/
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
#include <bsp.h>
@@ -21,38 +21,38 @@
#include <bsp/irq.h>
#include <bsp/lpc32xx.h>
-#include <freebsd/sys/cdefs.h>
-#include <freebsd/sys/stdint.h>
-#include <freebsd/sys/stddef.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/queue.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
-#include <freebsd/sys/kernel.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/linker_set.h>
-#include <freebsd/sys/module.h>
-#include <freebsd/sys/lock.h>
-#include <freebsd/sys/mutex.h>
-#include <freebsd/sys/condvar.h>
-#include <freebsd/sys/sysctl.h>
-#include <freebsd/sys/sx.h>
-#include <freebsd/sys/unistd.h>
-#include <freebsd/sys/callout.h>
-#include <freebsd/sys/malloc.h>
-#include <freebsd/sys/priv.h>
-
-#include <freebsd/dev/usb/usb.h>
-#include <freebsd/dev/usb/usbdi.h>
-
-#include <freebsd/dev/usb/usb_core.h>
-#include <freebsd/dev/usb/usb_busdma.h>
-#include <freebsd/dev/usb/usb_process.h>
-#include <freebsd/dev/usb/usb_util.h>
-
-#include <freebsd/dev/usb/usb_controller.h>
-#include <freebsd/dev/usb/usb_bus.h>
-#include <freebsd/dev/usb/controller/ohci.h>
+#include <sys/cdefs.h>
+#include <sys/stdint.h>
+#include <sys/stddef.h>
+#include <rtems/bsd/sys/param.h>
+#include <sys/queue.h>
+#include <rtems/bsd/sys/types.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/bus.h>
+#include <sys/linker_set.h>
+#include <sys/module.h>
+#include <rtems/bsd/sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/condvar.h>
+#include <sys/sysctl.h>
+#include <sys/sx.h>
+#include <rtems/bsd/sys/unistd.h>
+#include <sys/callout.h>
+#include <sys/malloc.h>
+#include <sys/priv.h>
+
+#include <dev/usb/usb.h>
+#include <dev/usb/usbdi.h>
+
+#include <dev/usb/usb_core.h>
+#include <dev/usb/usb_busdma.h>
+#include <dev/usb/usb_process.h>
+#include <dev/usb/usb_util.h>
+
+#include <dev/usb/usb_controller.h>
+#include <dev/usb/usb_bus.h>
+#include <dev/usb/controller/ohci.h>
#define USB_CTRL_SLAVE_HCLK_EN (1U << 24)
#define USB_CTRL_I2C_EN (1U << 23)
diff --git a/rtemsbsd/v850/include/freebsd/machine/cpufunc.h b/rtemsbsd/v850/include/freebsd/machine/cpufunc.h
deleted file mode 100644
index fa882cb5..00000000
--- a/rtemsbsd/v850/include/freebsd/machine/cpufunc.h
+++ /dev/null
@@ -1 +0,0 @@
-/* empty file */