diff options
author | Joel Sherrill <joel.sherrill@oarcorp.com> | 2012-03-07 09:52:04 -0600 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@oarcorp.com> | 2012-03-07 09:52:04 -0600 |
commit | a9153ec3040f54fa52b68e14dafed2aba7b780ae (patch) | |
tree | fda80e3380dfebf7d97868507aa185757852e882 /rtems/freebsd/machine | |
download | rtems-libbsd-a9153ec3040f54fa52b68e14dafed2aba7b780ae.tar.bz2 |
Initial import
Code is based on FreeBSD 8.2 with USB support from Sebastian Huber
and Thomas Doerfler. Initial TCP/IP stack work is from Kevel Kirspel.
Diffstat (limited to 'rtems/freebsd/machine')
29 files changed, 2807 insertions, 0 deletions
diff --git a/rtems/freebsd/machine/_align.h b/rtems/freebsd/machine/_align.h new file mode 100644 index 00000000..d28f51eb --- /dev/null +++ b/rtems/freebsd/machine/_align.h @@ -0,0 +1,33 @@ +/** + * @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 <rtems/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/rtems/freebsd/machine/_bus.h b/rtems/freebsd/machine/_bus.h new file mode 100644 index 00000000..b3025ccb --- /dev/null +++ b/rtems/freebsd/machine/_bus.h @@ -0,0 +1 @@ +#include <rtems/freebsd/machine/bus.h> diff --git a/rtems/freebsd/machine/_limits.h b/rtems/freebsd/machine/_limits.h new file mode 100644 index 00000000..5408c470 --- /dev/null +++ b/rtems/freebsd/machine/_limits.h @@ -0,0 +1,30 @@ +/** + * @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__LIMITS_H_ +#define _RTEMS_BSD_MACHINE__LIMITS_H_ + +#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_CONFIG_H_ +#error "the header file <rtems/freebsd/machine/rtems-bsd-config.h> must be included first" +#endif + +#endif /* _RTEMS_BSD_MACHINE__LIMITS_H_ */ diff --git a/rtems/freebsd/machine/_stdint.h b/rtems/freebsd/machine/_stdint.h new file mode 100644 index 00000000..0dd26f90 --- /dev/null +++ b/rtems/freebsd/machine/_stdint.h @@ -0,0 +1,30 @@ +/** + * @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 <rtems/freebsd/machine/rtems-bsd-config.h> must be included first" +#endif + +#endif /* _RTEMS_BSD_MACHINE__STDINT_H_ */ diff --git a/rtems/freebsd/machine/_types.h b/rtems/freebsd/machine/_types.h new file mode 100644 index 00000000..cb4f3e84 --- /dev/null +++ b/rtems/freebsd/machine/_types.h @@ -0,0 +1,30 @@ +/** + * @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 <rtems/freebsd/machine/rtems-bsd-config.h> must be included first" +#endif + +#endif /* _RTEMS_BSD_MACHINE__TYPES_H_ */ diff --git a/rtems/freebsd/machine/atomic.h b/rtems/freebsd/machine/atomic.h new file mode 100644 index 00000000..44c61842 --- /dev/null +++ b/rtems/freebsd/machine/atomic.h @@ -0,0 +1,367 @@ +/** + * @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_ATOMIC_H_ +#define _RTEMS_BSD_MACHINE_ATOMIC_H_ + +#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_CONFIG_H_ +#error "the header file <rtems/freebsd/machine/rtems-bsd-config.h> must be included first" +#endif + +#define mb() RTEMS_COMPILER_MEMORY_BARRIER() +#define wmb() RTEMS_COMPILER_MEMORY_BARRIER() +#define rmb() RTEMS_COMPILER_MEMORY_BARRIER() + +static inline void +atomic_add_int(volatile int *p, int v) +{ + rtems_interrupt_level level; + + rtems_interrupt_disable(level); + *p += v; + rtems_interrupt_enable(level); +} + +#define atomic_add_acq_int atomic_add_int +#define atomic_add_rel_int atomic_add_int + +static inline void +atomic_subtract_int(volatile int *p, int v) +{ + rtems_interrupt_level level; + + rtems_interrupt_disable(level); + *p -= v; + rtems_interrupt_enable(level); +} + +#define atomic_subtract_acq_int atomic_subtract_int +#define atomic_subtract_rel_int atomic_subtract_int + +static inline void +atomic_set_int(volatile int *p, int v) +{ + rtems_interrupt_level level; + + rtems_interrupt_disable(level); + *p |= v; + rtems_interrupt_enable(level); +} + +#define atomic_set_acq_int atomic_set_int +#define atomic_set_rel_int atomic_set_int + +static inline void +atomic_clear_int(volatile int *p, int v) +{ + rtems_interrupt_level level; + + rtems_interrupt_disable(level); + *p &= ~v; + rtems_interrupt_enable(level); +} + +#define atomic_clear_acq_int atomic_clear_int +#define atomic_clear_rel_int atomic_clear_int + +static inline int +atomic_cmpset_int(volatile int *p, int cmp, int set) +{ + rtems_interrupt_level level; + int rv; + + rtems_interrupt_disable(level); + rv = *p == cmp; + if (rv) { + *p = set; + } + rtems_interrupt_enable(level); + + return rv; +} + +#define atomic_cmpset_acq_int atomic_cmpset_int +#define atomic_cmpset_rel_int atomic_cmpset_int + +static inline int +atomic_fetchadd_int(volatile int *p, int v) +{ + rtems_interrupt_level level; + int tmp; + + rtems_interrupt_disable(level); + tmp = *p; + *p += v; + rtems_interrupt_enable(level); + + return tmp; +} + +static inline int +atomic_readandclear_int(volatile int *p) +{ + rtems_interrupt_level level; + int tmp; + + rtems_interrupt_disable(level); + tmp = *p; + *p = 0; + rtems_interrupt_enable(level); + + return tmp; +} + +static inline int +atomic_load_acq_int(volatile int *p) +{ + return *p; +} + +static inline void +atomic_store_rel_int(volatile int *p, int v) +{ + *p = v; +} + +static inline void +atomic_add_32(volatile uint32_t *p, uint32_t v) +{ + rtems_interrupt_level level; + + rtems_interrupt_disable(level); + *p += v; + rtems_interrupt_enable(level); +} + +#define atomic_add_acq_32 atomic_add_32 +#define atomic_add_rel_32 atomic_add_32 + +static inline void +atomic_subtract_32(volatile uint32_t *p, uint32_t v) +{ + rtems_interrupt_level level; + + rtems_interrupt_disable(level); + *p -= v; + rtems_interrupt_enable(level); +} + +#define atomic_subtract_acq_32 atomic_subtract_32 +#define atomic_subtract_rel_32 atomic_subtract_32 + +static inline void +atomic_set_32(volatile uint32_t *p, uint32_t v) +{ + rtems_interrupt_level level; + + rtems_interrupt_disable(level); + *p |= v; + rtems_interrupt_enable(level); +} + +#define atomic_set_acq_32 atomic_set_32 +#define atomic_set_rel_32 atomic_set_32 + +static inline void +atomic_clear_32(volatile uint32_t *p, uint32_t v) +{ + rtems_interrupt_level level; + + rtems_interrupt_disable(level); + *p &= ~v; + rtems_interrupt_enable(level); +} + +#define atomic_clear_acq_32 atomic_clear_32 +#define atomic_clear_rel_32 atomic_clear_32 + +static inline int +atomic_cmpset_32(volatile uint32_t *p, uint32_t cmp, uint32_t set) +{ + rtems_interrupt_level level; + int rv; + + rtems_interrupt_disable(level); + rv = *p == cmp; + if (rv) { + *p = set; + } + rtems_interrupt_enable(level); + + return rv; +} + +#define atomic_cmpset_acq_32 atomic_cmpset_32 +#define atomic_cmpset_rel_32 atomic_cmpset_32 + +static inline uint32_t +atomic_fetchadd_32(volatile uint32_t *p, uint32_t v) +{ + rtems_interrupt_level level; + uint32_t tmp; + + rtems_interrupt_disable(level); + tmp = *p; + *p += v; + rtems_interrupt_enable(level); + + return tmp; +} + +static inline uint32_t +atomic_readandclear_32(volatile uint32_t *p) +{ + rtems_interrupt_level level; + uint32_t tmp; + + rtems_interrupt_disable(level); + tmp = *p; + *p = 0; + rtems_interrupt_enable(level); + + return tmp; +} + +static inline uint32_t +atomic_load_acq_32(volatile uint32_t *p) +{ + return *p; +} + +static inline void +atomic_store_rel_32(volatile uint32_t *p, uint32_t v) +{ + *p = v; +} + +static inline void +atomic_add_long(volatile long *p, long v) +{ + rtems_interrupt_level level; + + rtems_interrupt_disable(level); + *p += v; + rtems_interrupt_enable(level); +} + +#define atomic_add_acq_long atomic_add_long +#define atomic_add_rel_long atomic_add_long + +static inline void +atomic_subtract_long(volatile long *p, long v) +{ + rtems_interrupt_level level; + + rtems_interrupt_disable(level); + *p -= v; + rtems_interrupt_enable(level); +} + +#define atomic_subtract_acq_long atomic_subtract_long +#define atomic_subtract_rel_long atomic_subtract_long + +static inline void +atomic_set_long(volatile long *p, long v) +{ + rtems_interrupt_level level; + + rtems_interrupt_disable(level); + *p |= v; + rtems_interrupt_enable(level); +} + +#define atomic_set_acq_long atomic_set_long +#define atomic_set_rel_long atomic_set_long + +static inline void +atomic_clear_long(volatile long *p, long v) +{ + rtems_interrupt_level level; + + rtems_interrupt_disable(level); + *p &= ~v; + rtems_interrupt_enable(level); +} + +#define atomic_clear_acq_long atomic_clear_long +#define atomic_clear_rel_long atomic_clear_long + +static inline int +atomic_cmpset_long(volatile long *p, long cmp, long set) +{ + rtems_interrupt_level level; + int rv; + + rtems_interrupt_disable(level); + rv = *p == cmp; + if (rv) { + *p = set; + } + rtems_interrupt_enable(level); + + return rv; +} + +#define atomic_cmpset_acq_long atomic_cmpset_long +#define atomic_cmpset_rel_long atomic_cmpset_long + +static inline long +atomic_fetchadd_long(volatile long *p, long v) +{ + rtems_interrupt_level level; + long tmp; + + rtems_interrupt_disable(level); + tmp = *p; + *p += v; + rtems_interrupt_enable(level); + + return tmp; +} + +static inline long +atomic_readandclear_long(volatile long *p) +{ + rtems_interrupt_level level; + long tmp; + + rtems_interrupt_disable(level); + tmp = *p; + *p = 0; + rtems_interrupt_enable(level); + + return tmp; +} + +static inline long +atomic_load_acq_long(volatile long *p) +{ + return *p; +} + +static inline void +atomic_store_rel_long(volatile long *p, long v) +{ + *p = v; +} + +#endif /* _RTEMS_BSD_MACHINE_ATOMIC_H_ */ diff --git a/rtems/freebsd/machine/bus.h b/rtems/freebsd/machine/bus.h new file mode 100644 index 00000000..3e01ce4a --- /dev/null +++ b/rtems/freebsd/machine/bus.h @@ -0,0 +1,781 @@ +/** + * @file + * + * @ingroup rtems_bsd_machine + * + * @brief TODO. + * + * File origin from FreeBSD 'sys/amd64/include/bus.h'. + */ + +/*- + * Copyright (c) 2009, 2010 embedded brains GmbH. All rights reserved. + * + * embedded brains GmbH + * Obere Lagerstr. 30 + * 82178 Puchheim + * Germany + * <rtems@embedded-brains.de> + * + * Copyright (c) KATO Takenori, 1999. + * + * All rights reserved. Unpublished rights reserved under the copyright + * laws of Japan. + * + * 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 as + * the first lines of this file unmodified. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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. + */ + +/*- + * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, + * NASA Ames Research Center. + * + * 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 NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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. + */ + +/*- + * Copyright (c) 1996 Charles M. Hannum. All rights reserved. + * Copyright (c) 1996 Christopher G. Demetriou. 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 Christopher G. Demetriou + * for the NetBSD Project. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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_BUS_H_ +#define _RTEMS_BSD_MACHINE_BUS_H_ + +#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_CONFIG_H_ +#error "the header file <rtems/freebsd/machine/rtems-bsd-config.h> must be included first" +#endif + +/* + * Bus address alignment. + */ +#define BUS_SPACE_ALIGNED_POINTER(p, t) ALIGNED_POINTER(p, t) + +/* + * Bus address maxima. + */ +#define BUS_SPACE_MAXADDR_24BIT 0xffffffU +#define BUS_SPACE_MAXADDR_32BIT 0xffffffffU +#define BUS_SPACE_MAXADDR 0xffffffffU +#define BUS_SPACE_MAXSIZE_24BIT 0xffffffU +#define BUS_SPACE_MAXSIZE_32BIT 0xffffffffU +#define BUS_SPACE_MAXSIZE 0xffffffffU + +/* + * Bus access. + */ +#define BUS_SPACE_UNRESTRICTED (~0U) + +/* + * Bus read/write barrier method. + */ +#define BUS_SPACE_BARRIER_READ 0x01 /* force read barrier */ +#define BUS_SPACE_BARRIER_WRITE 0x02 /* force write barrier */ + +/* + * Bus address and size types + */ +typedef unsigned int bus_addr_t; +typedef unsigned int bus_size_t; + +/* + * Access methods for bus resources and address space. + */ +typedef int bus_space_tag_t; +typedef unsigned int bus_space_handle_t; + +/* + * Map a region of device bus space into CPU virtual address space. + */ + +static __inline int +bus_space_map(bus_space_tag_t t __unused, bus_addr_t addr, + bus_size_t size __unused, int flags __unused, + bus_space_handle_t *bshp) +{ + *bshp = addr; + return (0); +} + +/* + * Unmap a region of device bus space. + */ +static __inline void +bus_space_unmap(bus_space_tag_t bst __unused, bus_space_handle_t bsh __unused, + bus_size_t size __unused) +{ + /* Do nothing */ +} + + +/* + * Get a new handle for a subregion of an already-mapped area of bus space. + */ +static __inline int +bus_space_subregion(bus_space_tag_t bst __unused, bus_space_handle_t bsh, + bus_size_t ofs, bus_size_t size, bus_space_handle_t *nbshp) +{ + *nbshp = bsh + ofs; + return (0); +} + + +/* + * Allocate a region of memory that is accessible to devices in bus space. + */ +int +bus_space_alloc(bus_space_tag_t bst __unused, bus_addr_t rstart, bus_addr_t rend, + bus_size_t size, bus_size_t align, bus_size_t boundary, int flags, + bus_addr_t *addrp, bus_space_handle_t *bshp); + + +/* + * Free a region of bus space accessible memory. + */ +void +bus_space_free(bus_space_tag_t bst __unused, bus_space_handle_t bsh, bus_size_t size); + + +static __inline void +bus_space_barrier(bus_space_tag_t bst __unused, bus_space_handle_t bsh, bus_size_t ofs, + bus_size_t size, int flags) +{ + /* Do nothing */ +} + + +/* + * Read 1 unit of data from bus space described by the tag, handle and ofs + * tuple. A unit of data can be 1 byte, 2 bytes, 4 bytes or 8 bytes. The + * data is returned. + */ +static __inline uint8_t +bus_space_read_1(bus_space_tag_t bst __unused, bus_space_handle_t bsh, bus_size_t ofs) +{ + uint8_t __volatile *bsp = (uint8_t __volatile *)(bsh + ofs); + return (*bsp); +} + +static __inline uint16_t +bus_space_read_2(bus_space_tag_t bst __unused, bus_space_handle_t bsh, bus_size_t ofs) +{ + uint16_t __volatile *bsp = (uint16_t __volatile *)(bsh + ofs); + return (*bsp); +} + +static __inline uint32_t +bus_space_read_4(bus_space_tag_t bst __unused, bus_space_handle_t bsh, bus_size_t ofs) +{ + uint32_t __volatile *bsp = (uint32_t __volatile *)(bsh + ofs); + return (*bsp); +} + +static __inline uint64_t +bus_space_read_8(bus_space_tag_t bst __unused, bus_space_handle_t bsh, bus_size_t ofs) +{ + uint64_t __volatile *bsp = (uint64_t __volatile *)(bsh + ofs); + return (*bsp); +} + + +/* + * Write 1 unit of data to bus space described by the tag, handle and ofs + * tuple. A unit of data can be 1 byte, 2 bytes, 4 bytes or 8 bytes. The + * data is passed by value. + */ +static __inline void +bus_space_write_1(bus_space_tag_t bst __unused, bus_space_handle_t bsh, bus_size_t ofs, + uint8_t val) +{ + uint8_t __volatile *bsp = (uint8_t __volatile *)(bsh + ofs); + *bsp = val; +} + +static __inline void +bus_space_write_2(bus_space_tag_t bst __unused, bus_space_handle_t bsh, bus_size_t ofs, + uint16_t val) +{ + uint16_t __volatile *bsp = (uint16_t __volatile *)(bsh + ofs); + *bsp = val; +} + +static __inline void +bus_space_write_4(bus_space_tag_t bst __unused, bus_space_handle_t bsh, bus_size_t ofs, + uint32_t val) +{ + uint32_t __volatile *bsp = (uint32_t __volatile *)(bsh + ofs); + *bsp = val; +} + +static __inline void +bus_space_write_8(bus_space_tag_t bst __unused, bus_space_handle_t bsh, bus_size_t ofs, + uint64_t val) +{ + uint64_t __volatile *bsp = (uint64_t __volatile *)(bsh + ofs); + *bsp = val; +} + + +/* + * Read count units of data from bus space described by the tag, handle and + * ofs tuple. A unit of data can be 1 byte, 2 bytes, 4 bytes or 8 bytes. The + * data is returned in the buffer passed by reference. + */ +static __inline void +bus_space_read_multi_1(bus_space_tag_t bst __unused, bus_space_handle_t bsh, + bus_size_t ofs, uint8_t *bufp, bus_size_t count) +{ + uint8_t __volatile *bsp = (uint8_t __volatile *)(bsh + ofs); + while (count-- > 0) { + *bufp++ = *bsp; + } +} + +static __inline void +bus_space_read_multi_2(bus_space_tag_t bst __unused, bus_space_handle_t bsh, + bus_size_t ofs, uint16_t *bufp, bus_size_t count) +{ + uint16_t __volatile *bsp = (uint16_t __volatile *)(bsh + ofs); + while (count-- > 0) { + *bufp++ = *bsp; + } +} + +static __inline void +bus_space_read_multi_4(bus_space_tag_t bst __unused, bus_space_handle_t bsh, + bus_size_t ofs, uint32_t *bufp, bus_size_t count) +{ + uint32_t __volatile *bsp = (uint32_t __volatile *)(bsh + ofs); + while (count-- > 0) { + *bufp++ = *bsp; + } +} + +static __inline void +bus_space_read_multi_8(bus_space_tag_t bst __unused, bus_space_handle_t bsh, + bus_size_t ofs, uint64_t *bufp, bus_size_t count) +{ + uint64_t __volatile *bsp = (uint64_t __volatile *)(bsh + ofs); + while (count-- > 0) { + *bufp++ = *bsp; + } +} + + +/* + * Write count units of data to bus space described by the tag, handle and + * ofs tuple. A unit of data can be 1 byte, 2 bytes, 4 bytes or 8 bytes. The + * data is read from the buffer passed by reference. + */ +static __inline void +bus_space_write_multi_1(bus_space_tag_t bst __unused, bus_space_handle_t bsh, + bus_size_t ofs, const uint8_t *bufp, bus_size_t count) +{ + uint8_t __volatile *bsp = (uint8_t __volatile *)(bsh + ofs); + while (count-- > 0) { + *bsp = *bufp++; + } +} + +static __inline void +bus_space_write_multi_2(bus_space_tag_t bst __unused, bus_space_handle_t bsh, + bus_size_t ofs, const uint16_t *bufp, bus_size_t count) +{ + uint16_t __volatile *bsp = (uint16_t __volatile *)(bsh + ofs); + while (count-- > 0) { + *bsp = *bufp++; + } +} + +static __inline void +bus_space_write_multi_4(bus_space_tag_t bst __unused, bus_space_handle_t bsh, + bus_size_t ofs, const uint32_t *bufp, bus_size_t count) +{ + uint32_t __volatile *bsp = (uint32_t __volatile *)(bsh + ofs); + while (count-- > 0) { + *bsp = *bufp++; + } +} + +static __inline void +bus_space_write_multi_8(bus_space_tag_t bst __unused, bus_space_handle_t bsh, + bus_size_t ofs, const uint64_t *bufp, bus_size_t count) +{ + uint64_t __volatile *bsp = (uint64_t __volatile *)(bsh + ofs); + while (count-- > 0) { + *bsp = *bufp++; + } +} + + +/* + * Read count units of data from bus space described by the tag, handle and + * ofs tuple. A unit of data can be 1 byte, 2 bytes, 4 bytes or 8 bytes. The + * data is written to the buffer passed by reference and read from successive + * bus space addresses. Access is unordered. + */ +static __inline void +bus_space_read_region_1(bus_space_tag_t bst __unused, bus_space_handle_t bsh, + bus_size_t ofs, uint8_t *bufp, bus_size_t count) +{ + while (count-- > 0) { + uint8_t __volatile *bsp = (uint8_t __volatile *)(bsh + ofs); + *bufp++ = *bsp; + ofs += 1; + } +} + +static __inline void +bus_space_read_region_2(bus_space_tag_t bst __unused, bus_space_handle_t bsh, + bus_size_t ofs, uint16_t *bufp, bus_size_t count) +{ + while (count-- > 0) { + uint16_t __volatile *bsp = (uint16_t __volatile *)(bsh + ofs); + *bufp++ = *bsp; + ofs += 2; + } +} + +static __inline void +bus_space_read_region_4(bus_space_tag_t bst __unused, bus_space_handle_t bsh, + bus_size_t ofs, uint32_t *bufp, bus_size_t count) +{ + while (count-- > 0) { + uint32_t __volatile *bsp = (uint32_t __volatile *)(bsh + ofs); + *bufp++ = *bsp; + ofs += 4; + } +} + +static __inline void +bus_space_read_region_8(bus_space_tag_t bst __unused, bus_space_handle_t bsh, + bus_size_t ofs, uint64_t *bufp, bus_size_t count) +{ + while (count-- > 0) { + uint64_t __volatile *bsp = (uint64_t __volatile *)(bsh + ofs); + *bufp++ = *bsp; + ofs += 8; + } +} + + +/* + * Write count units of data from bus space described by the tag, handle and + * ofs tuple. A unit of data can be 1 byte, 2 bytes, 4 bytes or 8 bytes. The + * data is read from the buffer passed by reference and written to successive + * bus space addresses. Access is unordered. + */ +static __inline void +bus_space_write_region_1(bus_space_tag_t bst __unused, bus_space_handle_t bsh, + bus_size_t ofs, const uint8_t *bufp, bus_size_t count) +{ + while (count-- > 0) { + uint8_t __volatile *bsp = (uint8_t __volatile *)(bsh + ofs); + *bsp = *bufp++; + ofs += 1; + } +} + +static __inline void +bus_space_write_region_2(bus_space_tag_t bst __unused, bus_space_handle_t bsh, + bus_size_t ofs, const uint16_t *bufp, bus_size_t count) +{ + while (count-- > 0) { + uint16_t __volatile *bsp = (uint16_t __volatile *)(bsh + ofs); + *bsp = *bufp++; + ofs += 2; + } +} + +static __inline void +bus_space_write_region_4(bus_space_tag_t bst __unused, bus_space_handle_t bsh, + bus_size_t ofs, const uint32_t *bufp, bus_size_t count) +{ + while (count-- > 0) { + uint32_t __volatile *bsp = (uint32_t __volatile *)(bsh + ofs); + *bsp = *bufp++; + ofs += 4; + } +} + +static __inline void +bus_space_write_region_8(bus_space_tag_t bst __unused, bus_space_handle_t bsh, + bus_size_t ofs, const uint64_t *bufp, bus_size_t count) +{ + while (count-- > 0) { + uint64_t __volatile *bsp = (uint64_t __volatile *)(bsh + ofs); + *bsp = *bufp++; + ofs += 8; + } +} + + +/* + * Write count units of data from bus space described by the tag, handle and + * ofs tuple. A unit of data can be 1 byte, 2 bytes, 4 bytes or 8 bytes. The + * data is passed by value. Writes are unordered. + */ +static __inline void +bus_space_set_multi_1(bus_space_tag_t bst __unused, bus_space_handle_t bsh, + bus_size_t ofs, uint8_t val, bus_size_t count) +{ + uint8_t __volatile *bsp = (uint8_t __volatile *)(bsh + ofs); + while (count-- > 0) { + *bsp = val; + } +} + +static __inline void +bus_space_set_multi_2(bus_space_tag_t bst __unused, bus_space_handle_t bsh, + bus_size_t ofs, uint16_t val, bus_size_t count) +{ + uint16_t __volatile *bsp = (uint16_t __volatile *)(bsh + ofs); + while (count-- > 0) { + *bsp = val; + } +} + +static __inline void +bus_space_set_multi_4(bus_space_tag_t bst __unused, bus_space_handle_t bsh, + bus_size_t ofs, uint32_t val, bus_size_t count) +{ + uint32_t __volatile *bsp = (uint32_t __volatile *)(bsh + ofs); + while (count-- > 0) { + *bsp = val; + } +} + +static __inline void +bus_space_set_multi_8(bus_space_tag_t bst __unused, bus_space_handle_t bsh, + bus_size_t ofs, uint64_t val, bus_size_t count) +{ + uint64_t __volatile *bsp = (uint64_t __volatile *)(bsh + ofs); + while (count-- > 0) { + *bsp = val; + } +} + + +/* + * Write count units of data from bus space described by the tag, handle and + * ofs tuple. A unit of data can be 1 byte, 2 bytes, 4 bytes or 8 bytes. The + * data is passed by value and written to successive bus space addresses. + * Writes are unordered. + */ +static __inline void +bus_space_set_region_1(bus_space_tag_t bst __unused, bus_space_handle_t bsh, + bus_size_t ofs, uint8_t val, bus_size_t count) +{ + while (count-- > 0) { + uint8_t __volatile *bsp = (uint8_t __volatile *)(bsh + ofs); + *bsp = val; + ofs += 1; + } +} + +static __inline void +bus_space_set_region_2(bus_space_tag_t bst __unused, bus_space_handle_t bsh, + bus_size_t ofs, uint16_t val, bus_size_t count) +{ + while (count-- > 0) { + uint16_t __volatile *bsp = (uint16_t __volatile *)(bsh + ofs); + *bsp = val; + ofs += 2; + } +} + +static __inline void +bus_space_set_region_4(bus_space_tag_t bst __unused, bus_space_handle_t bsh, + bus_size_t ofs, uint32_t val, bus_size_t count) +{ + while (count-- > 0) { + uint32_t __volatile *bsp = (uint32_t __volatile *)(bsh + ofs); + *bsp = val; + ofs += 4; + } +} + +static __inline void +bus_space_set_region_8(bus_space_tag_t bst __unused, bus_space_handle_t bsh, + bus_size_t ofs, uint64_t val, bus_size_t count) +{ + while (count-- > 0) { + uint64_t __volatile *bsp = (uint64_t __volatile *)(bsh + ofs); + *bsp = val; + ofs += 8; + } +} + + +/* + * Copy count units of data from bus space described by the tag and the first + * handle and ofs pair to bus space described by the tag and the second handle + * and ofs pair. A unit of data can be 1 byte, 2 bytes, 4 bytes or 8 bytes. + * The data is read from successive bus space addresses and also written to + * successive bus space addresses. Both reads and writes are unordered. + */ +static __inline void +bus_space_copy_region_1(bus_space_tag_t bst __unused, bus_space_handle_t bsh1, + bus_size_t ofs1, bus_space_handle_t bsh2, bus_size_t ofs2, bus_size_t count) +{ + bus_addr_t dst = bsh1 + ofs1; + bus_addr_t src = bsh2 + ofs2; + uint8_t __volatile *dstp = (uint8_t __volatile *) dst; + uint8_t __volatile *srcp = (uint8_t __volatile *) src; + if (dst > src) { + src += count - 1; + dst += count - 1; + while (count-- > 0) { + *dstp = *srcp; + src -= 1; + dst -= 1; + } + } else { + while (count-- > 0) { + *dstp = *srcp; + src += 1; + dst += 1; + } + } +} + +static __inline void +bus_space_copy_region_2(bus_space_tag_t bst __unused, bus_space_handle_t bsh1, + bus_size_t ofs1, bus_space_handle_t bsh2, bus_size_t ofs2, bus_size_t count) +{ + bus_addr_t dst = bsh1 + ofs1; + bus_addr_t src = bsh2 + ofs2; + uint16_t __volatile *dstp = (uint16_t __volatile *) dst; + uint16_t __volatile *srcp = (uint16_t __volatile *) src; + if (dst > src) { + src += (count - 1) << 1; + dst += (count - 1) << 1; + while (count-- > 0) { + *dstp = *srcp; + src -= 2; + dst -= 2; + } + } else { + while (count-- > 0) { + *dstp = *srcp; + src += 2; + dst += 2; + } + } +} + +static __inline void +bus_space_copy_region_4(bus_space_tag_t bst __unused, bus_space_handle_t bsh1, + bus_size_t ofs1, bus_space_handle_t bsh2, bus_size_t ofs2, bus_size_t count) +{ + bus_addr_t dst = bsh1 + ofs1; + bus_addr_t src = bsh2 + ofs2; + uint32_t __volatile *dstp = (uint32_t __volatile *) dst; + uint32_t __volatile *srcp = (uint32_t __volatile *) src; + if (dst > src) { + src += (count - 1) << 2; + dst += (count - 1) << 2; + while (count-- > 0) { + *dstp = *srcp; + src -= 4; + dst -= 4; + } + } else { + while (count-- > 0) { + *dstp = *srcp; + src += 4; + dst += 4; + } + } +} + +static __inline void +bus_space_copy_region_8(bus_space_tag_t bst __unused, bus_space_handle_t bsh1, + bus_size_t ofs1, bus_space_handle_t bsh2, bus_size_t ofs2, bus_size_t count) +{ + bus_addr_t dst = bsh1 + ofs1; + bus_addr_t src = bsh2 + ofs2; + uint64_t __volatile *dstp = (uint64_t __volatile *) dst; + uint64_t __volatile *srcp = (uint64_t __volatile *) src; + if (dst > src) { + src += (count - 1) << 3; + dst += (count - 1) << 3; + while (count-- > 0) { + *dstp = *srcp; + src -= 8; + dst -= 8; + } + } else { + while (count-- > 0) { + *dstp = *srcp; + src += 8; + dst += 8; + } + } +} + + +/* + * Stream accesses are the same as normal accesses on RTEMS; there are no + * supported bus systems with an endianess different from the host one. + */ +#define bus_space_read_stream_1(t, h, o) \ + bus_space_read_1(t, h, o) +#define bus_space_read_stream_2(t, h, o) \ + bus_space_read_2(t, h, o) +#define bus_space_read_stream_4(t, h, o) \ + bus_space_read_4(t, h, o) +#define bus_space_read_stream_8(t, h, o) \ + bus_space_read_8(t, h, o) + +#define bus_space_read_multi_stream_1(t, h, o, a, c) \ + bus_space_read_multi_1(t, h, o, a, c) +#define bus_space_read_multi_stream_2(t, h, o, a, c) \ + bus_space_read_multi_2(t, h, o, a, c) +#define bus_space_read_multi_stream_4(t, h, o, a, c) \ + bus_space_read_multi_4(t, h, o, a, c) +#define bus_space_read_multi_stream_8(t, h, o, a, c) \ + bus_space_read_multi_8(t, h, o, a, c) + +#define bus_space_write_stream_1(t, h, o, v) \ + bus_space_write_1(t, h, o, v) +#define bus_space_write_stream_2(t, h, o, v) \ + bus_space_write_2(t, h, o, v) +#define bus_space_write_stream_4(t, h, o, v) \ + bus_space_write_4(t, h, o, v) +#define bus_space_write_stream_8(t, h, o, v) \ + bus_space_write_8(t, h, o, v) + +#define bus_space_write_multi_stream_1(t, h, o, a, c) \ + bus_space_write_multi_1(t, h, o, a, c) +#define bus_space_write_multi_stream_2(t, h, o, a, c) \ + bus_space_write_multi_2(t, h, o, a, c) +#define bus_space_write_multi_stream_4(t, h, o, a, c) \ + bus_space_write_multi_4(t, h, o, a, c) +#define bus_space_write_multi_stream_8(t, h, o, a, c) \ + bus_space_write_multi_8(t, h, o, a, c) + +#define bus_space_set_multi_stream_1(t, h, o, v, c) \ + bus_space_set_multi_1(t, h, o, v, c) +#define bus_space_set_multi_stream_2(t, h, o, v, c) \ + bus_space_set_multi_2(t, h, o, v, c) +#define bus_space_set_multi_stream_4(t, h, o, v, c) \ + bus_space_set_multi_4(t, h, o, v, c) +#define bus_space_set_multi_stream_8(t, h, o, v, c) \ + bus_space_set_multi_8(t, h, o, v, c) + +#define bus_space_read_region_stream_1(t, h, o, a, c) \ + bus_space_read_region_1(t, h, o, a, c) +#define bus_space_read_region_stream_2(t, h, o, a, c) \ + bus_space_read_region_2(t, h, o, a, c) +#define bus_space_read_region_stream_4(t, h, o, a, c) \ + bus_space_read_region_4(t, h, o, a, c) +#define bus_space_read_region_stream_8(t, h, o, a, c) \ + bus_space_read_region_8(t, h, o, a, c) + +#define bus_space_write_region_stream_1(t, h, o, a, c) \ + bus_space_write_region_1(t, h, o, a, c) +#define bus_space_write_region_stream_2(t, h, o, a, c) \ + bus_space_write_region_2(t, h, o, a, c) +#define bus_space_write_region_stream_4(t, h, o, a, c) \ + bus_space_write_region_4(t, h, o, a, c) +#define bus_space_write_region_stream_8(t, h, o, a, c) \ + bus_space_write_region_8(t, h, o, a, c) + +#define bus_space_set_region_stream_1(t, h, o, v, c) \ + bus_space_set_region_1(t, h, o, v, c) +#define bus_space_set_region_stream_2(t, h, o, v, c) \ + bus_space_set_region_2(t, h, o, v, c) +#define bus_space_set_region_stream_4(t, h, o, v, c) \ + bus_space_set_region_4(t, h, o, v, c) +#define bus_space_set_region_stream_8(t, h, o, v, c) \ + bus_space_set_region_8(t, h, o, v, c) + +#define bus_space_copy_region_stream_1(t, h1, o1, h2, o2, c) \ + bus_space_copy_region_1(t, h1, o1, h2, o2, c) +#define bus_space_copy_region_stream_2(t, h1, o1, h2, o2, c) \ + bus_space_copy_region_2(t, h1, o1, h2, o2, c) +#define bus_space_copy_region_stream_4(t, h1, o1, h2, o2, c) \ + bus_space_copy_region_4(t, h1, o1, h2, o2, c) +#define bus_space_copy_region_stream_8(t, h1, o1, h2, o2, c) \ + bus_space_copy_region_8(t, h1, o1, h2, o2, c) + +#include <rtems/freebsd/machine/bus_dma.h> + +#endif /* _RTEMS_BSD_MACHINE_BUS_H_ */ diff --git a/rtems/freebsd/machine/bus_dma.h b/rtems/freebsd/machine/bus_dma.h new file mode 100644 index 00000000..b2629b5a --- /dev/null +++ b/rtems/freebsd/machine/bus_dma.h @@ -0,0 +1,32 @@ +/** + * @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_BUS_DMA_H_ +#define _RTEMS_BSD_MACHINE_BUS_DMA_H_ + +#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_CONFIG_H_ +#error "the header file <rtems/freebsd/machine/rtems-bsd-config.h> must be included first" +#endif + +#include <rtems/freebsd/sys/bus_dma.h> + +#endif /* _RTEMS_BSD_MACHINE_BUS_DMA_H_ */ diff --git a/rtems/freebsd/machine/clock.h b/rtems/freebsd/machine/clock.h new file mode 100644 index 00000000..4b12f3b7 --- /dev/null +++ b/rtems/freebsd/machine/clock.h @@ -0,0 +1,35 @@ +/** + * @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_CLOCK_H_ +#define _RTEMS_BSD_MACHINE_CLOCK_H_ + +#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_CONFIG_H_ +#error "the header file <rtems/freebsd/machine/rtems-bsd-config.h> must be included first" +#endif + +#ifdef _KERNEL + + +#endif /* _KERNEL */ + +#endif diff --git a/rtems/freebsd/machine/cpu.h b/rtems/freebsd/machine/cpu.h new file mode 100644 index 00000000..936ffd88 --- /dev/null +++ b/rtems/freebsd/machine/cpu.h @@ -0,0 +1 @@ +/* EMPTY */ diff --git a/rtems/freebsd/machine/cpufunc.h b/rtems/freebsd/machine/cpufunc.h new file mode 100644 index 00000000..087a9404 --- /dev/null +++ b/rtems/freebsd/machine/cpufunc.h @@ -0,0 +1,30 @@ +/** + * @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_CPUFUNC_H_ +#define _RTEMS_BSD_MACHINE_CPUFUNC_H_ + +#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_CONFIG_H_ +#error "the header file <rtems/freebsd/machine/rtems-bsd-config.h> must be included first" +#endif + +#endif /* _RTEMS_BSD_MACHINE_CPUFUNC_H_ */ diff --git a/rtems/freebsd/machine/elf.h b/rtems/freebsd/machine/elf.h new file mode 100644 index 00000000..936ffd88 --- /dev/null +++ b/rtems/freebsd/machine/elf.h @@ -0,0 +1 @@ +/* EMPTY */ diff --git a/rtems/freebsd/machine/endian.h b/rtems/freebsd/machine/endian.h new file mode 100644 index 00000000..89cc9930 --- /dev/null +++ b/rtems/freebsd/machine/endian.h @@ -0,0 +1,48 @@ +/** + * @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_ENDIAN_H +#define _RTEMS_BSD_MACHINE_ENDIAN_H + +#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_CONFIG_H_ +#error "the header file <rtems/freebsd/machine/rtems-bsd-config.h> must be included first" +#endif + +#include <rtems/endian.h> + +#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) + +#endif /* _RTEMS_BSD_MACHINE_ENDIAN_H */ diff --git a/rtems/freebsd/machine/in_cksum.h b/rtems/freebsd/machine/in_cksum.h new file mode 100644 index 00000000..37d88e2e --- /dev/null +++ b/rtems/freebsd/machine/in_cksum.h @@ -0,0 +1,77 @@ +/*- + * Copyright (c) 1990 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. + * + * from tahoe: in_cksum.c 1.2 86/01/05 + * from: @(#)in_cksum.c 1.3 (Berkeley) 1/19/91 + * from: Id: in_cksum.c,v 1.8 1995/12/03 18:35:19 bde Exp + * from: src/sys/alpha/include/in_cksum.h,v 1.7 2005/03/02 21:33:20 joerg + * $FreeBSD$ + */ + +#ifndef _MACHINE_IN_CKSUM_H_ +#define _MACHINE_IN_CKSUM_H_ 1 + +#include <sys/cdefs.h> + +#define in_cksum(m, len) in_cksum_skip(m, len, 0) + +/* + * It it useful to have an Internet checksum routine which is inlineable + * and optimized specifically for the task of computing IP header checksums + * in the normal case (where there are no options and the header length is + * therefore always exactly five 32-bit words. + */ +#ifdef __CC_SUPPORTS___INLINE + +static __inline void +in_cksum_update(struct ip *ip) +{ + int __tmpsum; + __tmpsum = (int)ntohs(ip->ip_sum) + 256; + ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16)); +} + +#else + +#define in_cksum_update(ip) \ + do { \ + int __tmpsum; \ + __tmpsum = (int)ntohs(ip->ip_sum) + 256; \ + ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16)); \ + } while(0) + +#endif + +#ifdef _KERNEL +u_int in_cksum_hdr(const struct ip *ip); +u_short in_addword(u_short sum, u_short b); +u_short in_pseudo(u_int sum, u_int b, u_int c); +u_short in_cksum_skip(struct mbuf *m, int len, int skip); +#endif + +#endif /* _MACHINE_IN_CKSUM_H_ */ diff --git a/rtems/freebsd/machine/mutex.h b/rtems/freebsd/machine/mutex.h new file mode 100644 index 00000000..45d2fc47 --- /dev/null +++ b/rtems/freebsd/machine/mutex.h @@ -0,0 +1,30 @@ +/** + * @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_MUTEX_H_ +#define _RTEMS_BSD_MACHINE_MUTEX_H_ + +#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_CONFIG_H_ +#error "the header file <rtems/freebsd/machine/rtems-bsd-config.h> must be included first" +#endif + +#endif /* _RTEMS_BSD_MACHINE_MUTEX_H_ */ diff --git a/rtems/freebsd/machine/param.h b/rtems/freebsd/machine/param.h new file mode 100644 index 00000000..cf621e6d --- /dev/null +++ b/rtems/freebsd/machine/param.h @@ -0,0 +1,42 @@ +/** + * @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 <rtems/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/rtems/freebsd/machine/pcpu.h b/rtems/freebsd/machine/pcpu.h new file mode 100644 index 00000000..42c9de84 --- /dev/null +++ b/rtems/freebsd/machine/pcpu.h @@ -0,0 +1,41 @@ +/** + * @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_PCPU_H_ +#define _RTEMS_BSD_MACHINE_PCPU_H_ + +#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_CONFIG_H_ +#error "the header file <rtems/freebsd/machine/rtems-bsd-config.h> must be included first" +#endif + +#define curthread (( struct thread * )(( RTEMS_API_Control * )_Thread_Executing->API_Extensions[THREAD_API_RTEMS] )->Notepads[RTEMS_NOTEPAD_0] ) + +extern struct pcpu *pcpup; + +#define PCPU_MD_FIELDS +#define PCPU_GET(member) (0) +#define PCPU_SET(member, val) + +//#define PCPU_GET(member) (pcpup->pc_ ## member) +//#define PCPU_SET(member, val) (pcpup->pc_ ## member = (val)) + +#endif /* _RTEMS_BSD_MACHINE_PCPU_H_ */ diff --git a/rtems/freebsd/machine/proc.h b/rtems/freebsd/machine/proc.h new file mode 100644 index 00000000..d1332ac6 --- /dev/null +++ b/rtems/freebsd/machine/proc.h @@ -0,0 +1,38 @@ +/** + * @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_PROC_H_ +#define _RTEMS_BSD_MACHINE_PROC_H_ + +#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_CONFIG_H_ +#error "the header file <rtems/freebsd/machine/rtems-bsd-config.h> must be included first" +#endif + +struct mdthread { + int dummy; +}; + +struct mdproc { + int dummy; +}; + +#endif /* _RTEMS_BSD_MACHINE_PROC_H_ */ diff --git a/rtems/freebsd/machine/resource.h b/rtems/freebsd/machine/resource.h new file mode 100644 index 00000000..93220dcf --- /dev/null +++ b/rtems/freebsd/machine/resource.h @@ -0,0 +1,30 @@ +/** + * @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 <rtems/freebsd/machine/rtems-bsd-config.h> must be included first" +#endif + +#endif /* _RTEMS_BSD_MACHINE_RESOURCE_H_ */ diff --git a/rtems/freebsd/machine/rtems-bsd-cache.h b/rtems/freebsd/machine/rtems-bsd-cache.h new file mode 100644 index 00000000..77cc0794 --- /dev/null +++ b/rtems/freebsd/machine/rtems-bsd-cache.h @@ -0,0 +1,37 @@ +/** + * @file + * + * @ingroup rtems_bsd_machine + * + * @brief TODO. + */ + +/* + * Copyright (c) 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_RTEMS_BSD_CACHE_H_ +#define _RTEMS_BSD_MACHINE_RTEMS_BSD_CACHE_H_ + +#include <bsp.h> + +#if defined(LIBBSP_ARM_LPC24XX_BSP_H) + /* No cache */ +#elif defined(LIBBSP_ARM_LPC32XX_BSP_H) + /* With cache, no coherency support in hardware */ + #include <libcpu/cache.h> +#elif defined(__GEN83xx_BSP_h) + /* With cache, coherency support in hardware */ +#endif + +#endif /* _RTEMS_BSD_MACHINE_RTEMS_BSD_CACHE_H_ */ diff --git a/rtems/freebsd/machine/rtems-bsd-config.h b/rtems/freebsd/machine/rtems-bsd-config.h new file mode 100644 index 00000000..34562b11 --- /dev/null +++ b/rtems/freebsd/machine/rtems-bsd-config.h @@ -0,0 +1,255 @@ +/** + * @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_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 + +/* Disable procedure call definitions */ +#undef __P +#undef __strong_reference + +#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_FEATURES_H +#define _SYS_FEATURES_H 1 +#undef _SYS_TTYCOM_H_ +#define _SYS_TTYCOM_H_ 1 + +/* Disable procedure call definitions */ +#undef __P +#undef __strong_reference + +/* Disable some quirks in the standard headers */ +#define _POSIX_SOURCE 1 + +/* We need POSIX threads */ +#define _POSIX_THREADS 1 + +#endif /* !_RTEMS_BSD_BSD_HH_ */ + +/* Type set from the C standard */ +#include <stdarg.h> +#include <stddef.h> +#include <stdint.h> +#include <limits.h> +#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> +#include <rtems/error.h> +#include <rtems/chain.h> +#include <rtems/libio.h> + +#ifndef _RTEMS_BSD_BSD_HH_ +/* Ensure that we can use POSIX threads */ +#include <pthread.h> + +/* The BSD kernel is not a POSIX source */ +#undef _POSIX_SOURCE + +/* Symbol undefines */ +#undef MAXPATHLEN + +#endif /* !_RTEMS_BSD_BSD_HH_ */ + +/* Networking */ +#define IPSEC 1 +#define INET 1 +#define INET6 1 +#define TCP_SIGNATURE 1 + +/* 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 + +#ifndef _RTEMS_BSD_BSD_HH_ +/* Symbol rename */ + +#include <rtems/freebsd/machine/rtems-bsd-symbols.h> + +#define gets _bsd_gets +#define realloc _bsd_realloc +#define reallocf _bsd_reallocf +#define setenv _bsd_setenv +#define abs _bsd_abs +#define labs _bsd_labs + +#define ticks _Watchdog_Ticks_since_boot + +/* Debug */ + +void rtems_bsd_assert_func(const char *file, int line, const char *func, const char *expr); + +#define BSD_PRINTF(fmt, ...) printf("%s: " fmt, __func__, ##__VA_ARGS__) + +#define BSD_PANIC(fmt, ...) panic("%s: " fmt "\n", __func__, ##__VA_ARGS__) + +#ifdef NDEBUG +# define BSD_ASSERT(expr) ((void) 0) +#else +# define BSD_ASSERT(expr) ((expr) ? (void) 0 : rtems_bsd_assert_func(__FILE__, __LINE__, __func__, #expr)) +#endif + +#define BSD_ASSERT_SC(sc) BSD_ASSERT((sc) == RTEMS_SUCCESSFUL) + +#define BSD_ASSERT_RV(rv) BSD_ASSERT((rv) == 0) + +/* General definitions */ + +#define BSD_TASK_PRIORITY_NORMAL 120 + +#define BSD_TASK_PRIORITY_TIMER 110 + +#define BSD_TASK_PRIORITY_INTERRUPT 100 + +#define BSD_TASK_PRIORITY_RESOURCE_OWNER 100 + +/* FIXME */ +#define BSD_MINIMUM_TASK_STACK_SIZE ((size_t) 32 * 1024) + +#define M_RTEMS_HEAP 0 + +#define BSD_MAXIMUM_SLEEP_QUEUES 32 + +extern rtems_chain_control rtems_bsd_lock_chain; + +extern rtems_chain_control rtems_bsd_mtx_chain; + +extern rtems_chain_control rtems_bsd_sx_chain; + +extern rtems_chain_control rtems_bsd_condvar_chain; + +extern rtems_chain_control rtems_bsd_callout_chain; + +extern rtems_chain_control rtems_bsd_thread_chain; + +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/rtems/freebsd/machine/rtems-bsd-select.h b/rtems/freebsd/machine/rtems-bsd-select.h new file mode 100644 index 00000000..368c285b --- /dev/null +++ b/rtems/freebsd/machine/rtems-bsd-select.h @@ -0,0 +1,76 @@ +/*- + * 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/rtems/freebsd/machine/rtems-bsd-symbols.h b/rtems/freebsd/machine/rtems-bsd-symbols.h new file mode 100644 index 00000000..9cf8da52 --- /dev/null +++ b/rtems/freebsd/machine/rtems-bsd-symbols.h @@ -0,0 +1,561 @@ +/** + * @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_RTEMS_BSD_SYMBOLS_H_ +#define _RTEMS_BSD_MACHINE_RTEMS_BSD_SYMBOLS_H_ + +#define bus_activate_resource _bsd_bus_activate_resource +#define bus_activate_resource_desc _bsd_bus_activate_resource_desc +#define bus_activate_resource_method_default _bsd_bus_activate_resource_method_default +#define bus_add_child_desc _bsd_bus_add_child_desc +#define bus_add_child_method_default _bsd_bus_add_child_method_default +#define bus_alloc_resource _bsd_bus_alloc_resource +#define bus_alloc_resource_desc _bsd_bus_alloc_resource_desc +#define bus_alloc_resource_method_default _bsd_bus_alloc_resource_method_default +#define bus_alloc_resources _bsd_bus_alloc_resources +#define bus_bind_intr _bsd_bus_bind_intr +#define bus_bind_intr_desc _bsd_bus_bind_intr_desc +#define bus_bind_intr_method_default _bsd_bus_bind_intr_method_default +#define bus_child_detached_desc _bsd_bus_child_detached_desc +#define bus_child_detached_method_default _bsd_bus_child_detached_method_default +#define bus_child_location_str _bsd_bus_child_location_str +#define bus_child_location_str_desc _bsd_bus_child_location_str_desc +#define bus_child_location_str_method_default _bsd_bus_child_location_str_method_default +#define bus_child_pnpinfo_str _bsd_bus_child_pnpinfo_str +#define bus_child_pnpinfo_str_desc _bsd_bus_child_pnpinfo_str_desc +#define bus_child_pnpinfo_str_method_default _bsd_bus_child_pnpinfo_str_method_default +#define bus_child_present _bsd_bus_child_present +#define bus_child_present_desc _bsd_bus_child_present_desc +#define bus_child_present_method_default _bsd_bus_child_present_method_default +#define bus_config_intr_desc _bsd_bus_config_intr_desc +#define bus_config_intr_method_default _bsd_bus_config_intr_method_default +#define bus_current_pass _bsd_bus_current_pass +#define bus_data_generation_check _bsd_bus_data_generation_check +#define bus_data_generation_update _bsd_bus_data_generation_update +#define bus_deactivate_resource _bsd_bus_deactivate_resource +#define bus_deactivate_resource_desc _bsd_bus_deactivate_resource_desc +#define bus_deactivate_resource_method_default _bsd_bus_deactivate_resource_method_default +#define bus_delete_resource _bsd_bus_delete_resource +#define bus_delete_resource_desc _bsd_bus_delete_resource_desc +#define bus_delete_resource_method_default _bsd_bus_delete_resource_method_default +#define bus_describe_intr _bsd_bus_describe_intr +#define bus_describe_intr_desc _bsd_bus_describe_intr_desc +#define bus_describe_intr_method_default _bsd_bus_describe_intr_method_default +#define busdma_lock_mutex _bsd_busdma_lock_mutex +#define bus_dmamap_create _bsd_bus_dmamap_create +#define bus_dmamap_destroy _bsd_bus_dmamap_destroy +#define bus_dmamap_load _bsd_bus_dmamap_load +#define _bus_dmamap_sync _bsd__bus_dmamap_sync +#define _bus_dmamap_unload _bsd__bus_dmamap_unload +#define bus_dmamem_alloc _bsd_bus_dmamem_alloc +#define bus_dmamem_free _bsd_bus_dmamem_free +#define bus_dma_tag_create _bsd_bus_dma_tag_create +#define bus_dma_tag_destroy _bsd_bus_dma_tag_destroy +#define bus_driver_added_desc _bsd_bus_driver_added_desc +#define bus_driver_added_method_default _bsd_bus_driver_added_method_default +#define bus_generic_add_child _bsd_bus_generic_add_child +#define bus_generic_attach _bsd_bus_generic_attach +#define bus_generic_bind_intr _bsd_bus_generic_bind_intr +#define bus_generic_child_present _bsd_bus_generic_child_present +#define bus_generic_config_intr _bsd_bus_generic_config_intr +#define bus_generic_describe_intr _bsd_bus_generic_describe_intr +#define bus_generic_detach _bsd_bus_generic_detach +#define bus_generic_driver_added _bsd_bus_generic_driver_added +#define bus_generic_get_dma_tag _bsd_bus_generic_get_dma_tag +#define bus_generic_get_resource_list _bsd_bus_generic_get_resource_list +#define bus_generic_new_pass _bsd_bus_generic_new_pass +#define bus_generic_print_child _bsd_bus_generic_print_child +#define bus_generic_probe _bsd_bus_generic_probe +#define bus_generic_read_ivar _bsd_bus_generic_read_ivar +#define bus_generic_resume _bsd_bus_generic_resume +#define bus_generic_setup_intr _bsd_bus_generic_setup_intr +#define bus_generic_shutdown _bsd_bus_generic_shutdown +#define bus_generic_suspend _bsd_bus_generic_suspend +#define bus_generic_teardown_intr _bsd_bus_generic_teardown_intr +#define bus_generic_write_ivar _bsd_bus_generic_write_ivar +#define bus_get_dma_tag _bsd_bus_get_dma_tag +#define bus_get_dma_tag_desc _bsd_bus_get_dma_tag_desc +#define bus_get_dma_tag_method_default _bsd_bus_get_dma_tag_method_default +#define bus_get_resource _bsd_bus_get_resource +#define bus_get_resource_count _bsd_bus_get_resource_count +#define bus_get_resource_desc _bsd_bus_get_resource_desc +#define bus_get_resource_list_desc _bsd_bus_get_resource_list_desc +#define bus_get_resource_list_method_default _bsd_bus_get_resource_list_method_default +#define bus_get_resource_method_default _bsd_bus_get_resource_method_default +#define bus_get_resource_start _bsd_bus_get_resource_start +#define bus_hint_device_unit_desc _bsd_bus_hint_device_unit_desc +#define bus_hint_device_unit_method_default _bsd_bus_hint_device_unit_method_default +#define bus_hinted_child_desc _bsd_bus_hinted_child_desc +#define bus_hinted_child_method_default _bsd_bus_hinted_child_method_default +#define bus_new_pass_desc _bsd_bus_new_pass_desc +#define bus_new_pass_method_default _bsd_bus_new_pass_method_default +#define bus_print_child_desc _bsd_bus_print_child_desc +#define bus_print_child_footer _bsd_bus_print_child_footer +#define bus_print_child_header _bsd_bus_print_child_header +#define bus_print_child_method_default _bsd_bus_print_child_method_default +#define bus_probe_nomatch_desc _bsd_bus_probe_nomatch_desc +#define bus_probe_nomatch_method_default _bsd_bus_probe_nomatch_method_default +#define bus_read_ivar_desc _bsd_bus_read_ivar_desc +#define bus_read_ivar_method_default _bsd_bus_read_ivar_method_default +#define bus_release_resource _bsd_bus_release_resource +#define bus_release_resource_desc _bsd_bus_release_resource_desc +#define bus_release_resource_method_default _bsd_bus_release_resource_method_default +#define bus_release_resources _bsd_bus_release_resources +#define bus_remap_intr_desc _bsd_bus_remap_intr_desc +#define bus_remap_intr_method_default _bsd_bus_remap_intr_method_default +#define bus_set_pass _bsd_bus_set_pass +#define bus_set_resource _bsd_bus_set_resource +#define bus_set_resource_desc _bsd_bus_set_resource_desc +#define bus_set_resource_method_default _bsd_bus_set_resource_method_default +#define bus_setup_intr _bsd_bus_setup_intr +#define bus_setup_intr_desc _bsd_bus_setup_intr_desc +#define bus_setup_intr_method_default _bsd_bus_setup_intr_method_default +#define bus_teardown_intr _bsd_bus_teardown_intr +#define bus_teardown_intr_desc _bsd_bus_teardown_intr_desc +#define bus_teardown_intr_method_default _bsd_bus_teardown_intr_method_default +#define bus_write_ivar_desc _bsd_bus_write_ivar_desc +#define bus_write_ivar_method_default _bsd_bus_write_ivar_method_default +#define callout_init _bsd_callout_init +#define _callout_init_lock _bsd__callout_init_lock +#define callout_reset _bsd_callout_reset +#define callout_schedule _bsd_callout_schedule +#define _callout_stop_safe _bsd__callout_stop_safe +#define cam_fetch_status_entry _bsd_cam_fetch_status_entry +#define cam_quirkmatch _bsd_cam_quirkmatch +#define cam_sim_alloc _bsd_cam_sim_alloc +#define cam_sim_free _bsd_cam_sim_free +#define cam_simq_alloc _bsd_cam_simq_alloc +#define cam_simq_free _bsd_cam_simq_free +#define cam_status_table _bsd_cam_status_table +#define cam_strmatch _bsd_cam_strmatch +#define cam_strvis _bsd_cam_strvis +#define cv_broadcastpri _bsd_cv_broadcastpri +#define cv_destroy _bsd_cv_destroy +#define cv_init _bsd_cv_init +#define cv_signal _bsd_cv_signal +#define _cv_timedwait _bsd__cv_timedwait +#define _cv_wait _bsd__cv_wait +#define _cv_wait_unlock _bsd__cv_wait_unlock +#define DELAY _bsd_DELAY +#define devclass_create _bsd_devclass_create +#define devclass_find _bsd_devclass_find +#define devclass_find_free_unit _bsd_devclass_find_free_unit +#define devclass_get_count _bsd_devclass_get_count +#define devclass_get_device _bsd_devclass_get_device +#define devclass_get_devices _bsd_devclass_get_devices +#define devclass_get_drivers _bsd_devclass_get_drivers +#define devclass_get_maxunit _bsd_devclass_get_maxunit +#define devclass_get_name _bsd_devclass_get_name +#define devclass_get_parent _bsd_devclass_get_parent +#define devclass_get_softc _bsd_devclass_get_softc +#define devclass_set_parent _bsd_devclass_set_parent +#define devctl_notify _bsd_devctl_notify +#define devctl_notify_f _bsd_devctl_notify_f +#define devctl_queue_data _bsd_devctl_queue_data +#define devctl_queue_data_f _bsd_devctl_queue_data_f +#define device_add_child _bsd_device_add_child +#define device_add_child_ordered _bsd_device_add_child_ordered +#define device_attach _bsd_device_attach +#define device_attach_desc _bsd_device_attach_desc +#define device_attach_method_default _bsd_device_attach_method_default +#define device_busy _bsd_device_busy +#define device_delete_all_children _bsd_device_delete_all_children +#define device_delete_child _bsd_device_delete_child +#define device_detach _bsd_device_detach +#define device_detach_desc _bsd_device_detach_desc +#define device_detach_method_default _bsd_device_detach_method_default +#define device_disable _bsd_device_disable +#define device_enable _bsd_device_enable +#define device_find_child _bsd_device_find_child +#define device_get_children _bsd_device_get_children +#define device_get_desc _bsd_device_get_desc +#define device_get_devclass _bsd_device_get_devclass +#define device_get_driver _bsd_device_get_driver +#define device_get_flags _bsd_device_get_flags +#define device_get_ivars _bsd_device_get_ivars +#define device_get_name _bsd_device_get_name +#define device_get_nameunit _bsd_device_get_nameunit +#define device_get_parent _bsd_device_get_parent +#define device_get_softc _bsd_device_get_softc +#define device_get_state _bsd_device_get_state +#define device_get_unit _bsd_device_get_unit +#define device_identify_desc _bsd_device_identify_desc +#define device_identify_method_default _bsd_device_identify_method_default +#define device_is_alive _bsd_device_is_alive +#define device_is_attached _bsd_device_is_attached +#define device_is_enabled _bsd_device_is_enabled +#define device_is_quiet _bsd_device_is_quiet +#define device_printf _bsd_device_printf +#define device_print_prettyname _bsd_device_print_prettyname +#define device_probe _bsd_device_probe +#define device_probe_and_attach _bsd_device_probe_and_attach +#define device_probe_child _bsd_device_probe_child +#define device_probe_desc _bsd_device_probe_desc +#define device_probe_method_default _bsd_device_probe_method_default +#define device_quiesce _bsd_device_quiesce +#define device_quiesce_desc _bsd_device_quiesce_desc +#define device_quiesce_method_default _bsd_device_quiesce_method_default +#define device_quiet _bsd_device_quiet +#define device_resume_desc _bsd_device_resume_desc +#define device_resume_method_default _bsd_device_resume_method_default +#define device_set_desc _bsd_device_set_desc +#define device_set_desc_copy _bsd_device_set_desc_copy +#define device_set_devclass _bsd_device_set_devclass +#define device_set_driver _bsd_device_set_driver +#define device_set_flags _bsd_device_set_flags +#define device_set_ivars _bsd_device_set_ivars +#define device_set_softc _bsd_device_set_softc +#define device_set_unit _bsd_device_set_unit +#define device_set_usb_desc _bsd_device_set_usb_desc +#define device_shutdown _bsd_device_shutdown +#define device_shutdown_desc _bsd_device_shutdown_desc +#define device_shutdown_method_default _bsd_device_shutdown_method_default +#define device_suspend_desc _bsd_device_suspend_desc +#define device_suspend_method_default _bsd_device_suspend_method_default +#define device_unbusy _bsd_device_unbusy +#define device_verbose _bsd_device_verbose +#define driver_module_handler _bsd_driver_module_handler +#define ehci_bus_methods _bsd_ehci_bus_methods +#define ehci_detach _bsd_ehci_detach +#define ehci_device_bulk_methods _bsd_ehci_device_bulk_methods +#define ehci_device_ctrl_methods _bsd_ehci_device_ctrl_methods +#define ehci_device_intr_methods _bsd_ehci_device_intr_methods +#define ehci_device_isoc_fs_methods _bsd_ehci_device_isoc_fs_methods +#define ehci_device_isoc_hs_methods _bsd_ehci_device_isoc_hs_methods +#define ehci_init _bsd_ehci_init +#define ehci_interrupt _bsd_ehci_interrupt +#define ehci_iterate_hw_softc _bsd_ehci_iterate_hw_softc +#define ehci_reset _bsd_ehci_reset +#define ehci_resume _bsd_ehci_resume +#define ehci_shutdown _bsd_ehci_shutdown +#define ehci_suspend _bsd_ehci_suspend +#define free _bsd_free +#define hid_end_parse _bsd_hid_end_parse +#define hid_get_data _bsd_hid_get_data +#define hid_get_data_unsigned _bsd_hid_get_data_unsigned +#define hid_get_descriptor_from_usb _bsd_hid_get_descriptor_from_usb +#define hid_get_item _bsd_hid_get_item +#define hid_is_collection _bsd_hid_is_collection +#define hid_locate _bsd_hid_locate +#define hid_report_size _bsd_hid_report_size +#define hid_start_parse _bsd_hid_start_parse +#define kernel_sysctl _bsd_kernel_sysctl +#define kobj_class_compile _bsd_kobj_class_compile +#define kobj_class_compile_static _bsd_kobj_class_compile_static +#define kobj_class_free _bsd_kobj_class_free +#define kobj_create _bsd_kobj_create +#define kobj_delete _bsd_kobj_delete +#define kobj_error_method _bsd_kobj_error_method +#define kobj_init _bsd_kobj_init +#define kobj_lookup_method _bsd_kobj_lookup_method +#define kproc_create _bsd_kproc_create +#define kproc_exit _bsd_kproc_exit +#define kproc_kthread_add _bsd_kproc_kthread_add +#define kproc_start _bsd_kproc_start +#define kthread_add _bsd_kthread_add +#define kthread_exit _bsd_kthread_exit +#define kthread_start _bsd_kthread_start +#define malloc _bsd_malloc +#define malloc_init _bsd_malloc_init +#define malloc_uninit _bsd_malloc_uninit +#define M_CAMSIM _bsd_M_CAMSIM +#define M_DEVBUF _bsd_M_DEVBUF +#define M_SOCKET _bsd_M_SOCKET +#define mi_startup _bsd_mi_startup +#define module_lookupbyname _bsd_module_lookupbyname +#define module_register _bsd_module_register +#define module_register_init _bsd_module_register_init +#define module_release _bsd_module_release +#define M_TEMP _bsd_M_TEMP +#define mtx_destroy _bsd_mtx_destroy +#define mtx_init _bsd_mtx_init +#define _mtx_lock_flags _bsd__mtx_lock_flags +#define mtx_owned _bsd_mtx_owned +#define mtx_recursed _bsd_mtx_recursed +#define mtx_sysinit _bsd_mtx_sysinit +#define _mtx_trylock _bsd__mtx_trylock +#define _mtx_unlock_flags _bsd__mtx_unlock_flags +#define M_USB _bsd_M_USB +#define M_USBDEV _bsd_M_USBDEV +#define M_USBHC _bsd_M_USBHC +#define mutex_init _bsd_mutex_init +#define null_class _bsd_null_class +#define num_cam_status_entries _bsd_num_cam_status_entries +#define ohci_bus_methods _bsd_ohci_bus_methods +#define ohci_detach _bsd_ohci_detach +#define ohci_device_bulk_methods _bsd_ohci_device_bulk_methods +#define ohci_device_ctrl_methods _bsd_ohci_device_ctrl_methods +#define ohci_device_intr_methods _bsd_ohci_device_intr_methods +#define ohci_device_isoc_methods _bsd_ohci_device_isoc_methods +#define ohci_init _bsd_ohci_init +#define ohci_interrupt _bsd_ohci_interrupt +#define ohci_iterate_hw_softc _bsd_ohci_iterate_hw_softc +#define ohci_resume _bsd_ohci_resume +#define ohci_suspend _bsd_ohci_suspend +#define panic _bsd_panic +#define pause _bsd_pause +#define psignal _bsd_psignal +#define root_bus_configure _bsd_root_bus_configure +#define scsi_inquiry _bsd_scsi_inquiry +#define scsi_print_inquiry _bsd_scsi_print_inquiry +#define scsi_read_capacity _bsd_scsi_read_capacity +#define scsi_read_write _bsd_scsi_read_write +#define scsi_test_unit_ready _bsd_scsi_test_unit_ready +#define selrecord _bsd_selrecord +#define seltdfini _bsd_seltdfini +#define selwakeup _bsd_selwakeup +#define selwakeuppri _bsd_selwakeuppri +#define strdup _bsd_strdup +#define sx_destroy _bsd_sx_destroy +#define _sx_downgrade _bsd__sx_downgrade +#define sx_init_flags _bsd_sx_init_flags +#define sx_sysinit _bsd_sx_sysinit +#define _sx_try_upgrade _bsd__sx_try_upgrade +#define _sx_try_xlock _bsd__sx_try_xlock +#define _sx_xlock _bsd__sx_xlock +#define sx_xlocked _bsd_sx_xlocked +#define _sx_xunlock _bsd__sx_xunlock +#define sysctl _bsd_sysctl +#define sysctl_add_oid _bsd_sysctl_add_oid +#define sysctlbyname _bsd_sysctlbyname +#define sysctl_ctx_entry_add _bsd_sysctl_ctx_entry_add +#define sysctl_ctx_entry_del _bsd_sysctl_ctx_entry_del +#define sysctl_ctx_entry_find _bsd_sysctl_ctx_entry_find +#define sysctl_ctx_free _bsd_sysctl_ctx_free +#define sysctl_ctx_init _bsd_sysctl_ctx_init +#define sysctl_find_oid _bsd_sysctl_find_oid +#define sysctl_handle_int _bsd_sysctl_handle_int +#define sysctl_handle_long _bsd_sysctl_handle_long +#define sysctl_handle_opaque _bsd_sysctl_handle_opaque +#define sysctl_handle_quad _bsd_sysctl_handle_quad +#define sysctl_handle_string _bsd_sysctl_handle_string +#define sysctl_lock _bsd_sysctl_lock +#define sysctl_move_oid _bsd_sysctl_move_oid +#define sysctl_msec_to_ticks _bsd_sysctl_msec_to_ticks +#define sysctlnametomib _bsd_sysctlnametomib +#define sysctl_register_oid _bsd_sysctl_register_oid +#define sysctl_remove_oid _bsd_sysctl_remove_oid +#define sysctl_rename_oid _bsd_sysctl_rename_oid +#define sysctl_unlock _bsd_sysctl_unlock +#define sysctl_unregister_oid _bsd_sysctl_unregister_oid +#define uhub_root_intr _bsd_uhub_root_intr +#define usb_alloc_device _bsd_usb_alloc_device +#define usb_alloc_mbufs _bsd_usb_alloc_mbufs +#define usb_bdma_done_event _bsd_usb_bdma_done_event +#define usb_bdma_post_sync _bsd_usb_bdma_post_sync +#define usb_bdma_pre_sync _bsd_usb_bdma_pre_sync +#define usb_bdma_work_loop _bsd_usb_bdma_work_loop +#define usb_bus_mem_alloc_all _bsd_usb_bus_mem_alloc_all +#define usb_bus_mem_flush_all _bsd_usb_bus_mem_flush_all +#define usb_bus_mem_free_all _bsd_usb_bus_mem_free_all +#define usb_bus_port_get_device _bsd_usb_bus_port_get_device +#define usb_bus_port_set_device _bsd_usb_bus_port_set_device +#define usb_bus_powerd _bsd_usb_bus_powerd +#define usb_bus_power_update _bsd_usb_bus_power_update +#define usb_bus_unload _bsd_usb_bus_unload +#define usb_command_wrapper _bsd_usb_command_wrapper +#define usb_config_parse _bsd_usb_config_parse +#define usbd_clear_data_toggle _bsd_usbd_clear_data_toggle +#define usbd_clear_stall_callback _bsd_usbd_clear_stall_callback +#define usbd_copy_in _bsd_usbd_copy_in +#define usbd_copy_out _bsd_usbd_copy_out +#define usbd_ctrl_transfer_setup _bsd_usbd_ctrl_transfer_setup +#define usbd_device_attached _bsd_usbd_device_attached +#define usbd_do_request_callback _bsd_usbd_do_request_callback +#define usbd_do_request_flags _bsd_usbd_do_request_flags +#define usbd_do_request_proc _bsd_usbd_do_request_proc +#define usb_debug _bsd_usb_debug +#define usbd_enum_is_locked _bsd_usbd_enum_is_locked +#define usbd_enum_lock _bsd_usbd_enum_lock +#define usbd_enum_unlock _bsd_usbd_enum_unlock +#define usbd_errstr _bsd_usbd_errstr +#define usb_desc_foreach _bsd_usb_desc_foreach +#define usb_detach_device _bsd_usb_detach_device +#define usb_devclass_ptr _bsd_usb_devclass_ptr +#define usb_devinfo _bsd_usb_devinfo +#define usbd_filter_power_mode _bsd_usbd_filter_power_mode +#define usbd_find_descriptor _bsd_usbd_find_descriptor +#define usbd_frame_zero _bsd_usbd_frame_zero +#define usbd_fs_isoc_schedule_alloc _bsd_usbd_fs_isoc_schedule_alloc +#define usbd_fs_isoc_schedule_init_all _bsd_usbd_fs_isoc_schedule_init_all +#define usbd_fs_isoc_schedule_isoc_time_expand _bsd_usbd_fs_isoc_schedule_isoc_time_expand +#define usbd_get_bus_index _bsd_usbd_get_bus_index +#define usbd_get_config_descriptor _bsd_usbd_get_config_descriptor +#define usbd_get_device_descriptor _bsd_usbd_get_device_descriptor +#define usbd_get_device_index _bsd_usbd_get_device_index +#define usbd_get_dma_delay _bsd_usbd_get_dma_delay +#define usbd_get_endpoint _bsd_usbd_get_endpoint +#define usbd_get_ep_by_addr _bsd_usbd_get_ep_by_addr +#define usbd_get_iface _bsd_usbd_get_iface +#define usbd_get_interface_altindex _bsd_usbd_get_interface_altindex +#define usbd_get_interface_descriptor _bsd_usbd_get_interface_descriptor +#define usbd_get_isoc_fps _bsd_usbd_get_isoc_fps +#define usbd_get_mode _bsd_usbd_get_mode +#define usbd_get_no_alts _bsd_usbd_get_no_alts +#define usbd_get_no_descriptors _bsd_usbd_get_no_descriptors +#define usbd_get_page _bsd_usbd_get_page +#define usbd_get_speed _bsd_usbd_get_speed +#define usbd_interface_count _bsd_usbd_interface_count +#define usbd_lookup_id_by_info _bsd_usbd_lookup_id_by_info +#define usbd_lookup_id_by_uaa _bsd_usbd_lookup_id_by_uaa +#define usb_dma_tag_find _bsd_usb_dma_tag_find +#define usb_dma_tag_setup _bsd_usb_dma_tag_setup +#define usb_dma_tag_unsetup _bsd_usb_dma_tag_unsetup +#define usb_do_clear_stall_callback _bsd_usb_do_clear_stall_callback +#define usbd_pipe_enter _bsd_usbd_pipe_enter +#define usbd_pipe_start _bsd_usbd_pipe_start +#define usbd_req_clear_device_feature _bsd_usbd_req_clear_device_feature +#define usbd_req_clear_hub_feature _bsd_usbd_req_clear_hub_feature +#define usbd_req_clear_port_feature _bsd_usbd_req_clear_port_feature +#define usbd_req_get_alt_interface_no _bsd_usbd_req_get_alt_interface_no +#define usbd_req_get_config _bsd_usbd_req_get_config +#define usbd_req_get_config_desc _bsd_usbd_req_get_config_desc +#define usbd_req_get_config_desc_full _bsd_usbd_req_get_config_desc_full +#define usbd_req_get_desc _bsd_usbd_req_get_desc +#define usbd_req_get_descriptor_ptr _bsd_usbd_req_get_descriptor_ptr +#define usbd_req_get_device_desc _bsd_usbd_req_get_device_desc +#define usbd_req_get_device_status _bsd_usbd_req_get_device_status +#define usbd_req_get_hid_desc _bsd_usbd_req_get_hid_desc +#define usbd_req_get_hub_descriptor _bsd_usbd_req_get_hub_descriptor +#define usbd_req_get_hub_status _bsd_usbd_req_get_hub_status +#define usbd_req_get_port_status _bsd_usbd_req_get_port_status +#define usbd_req_get_report _bsd_usbd_req_get_report +#define usbd_req_get_report_descriptor _bsd_usbd_req_get_report_descriptor +#define usbd_req_get_string_any _bsd_usbd_req_get_string_any +#define usbd_req_get_string_desc _bsd_usbd_req_get_string_desc +#define usbd_req_re_enumerate _bsd_usbd_req_re_enumerate +#define usbd_req_reset_port _bsd_usbd_req_reset_port +#define usbd_req_set_address _bsd_usbd_req_set_address +#define usbd_req_set_alt_interface_no _bsd_usbd_req_set_alt_interface_no +#define usbd_req_set_config _bsd_usbd_req_set_config +#define usbd_req_set_device_feature _bsd_usbd_req_set_device_feature +#define usbd_req_set_hub_feature _bsd_usbd_req_set_hub_feature +#define usbd_req_set_idle _bsd_usbd_req_set_idle +#define usbd_req_set_port_feature _bsd_usbd_req_set_port_feature +#define usbd_req_set_protocol _bsd_usbd_req_set_protocol +#define usbd_req_set_report _bsd_usbd_req_set_report +#define usbd_set_alt_interface_index _bsd_usbd_set_alt_interface_index +#define usbd_set_config_index _bsd_usbd_set_config_index +#define usbd_set_endpoint_stall _bsd_usbd_set_endpoint_stall +#define usbd_set_parent_iface _bsd_usbd_set_parent_iface +#define usbd_set_power_mode _bsd_usbd_set_power_mode +#define usbd_sr_lock _bsd_usbd_sr_lock +#define usbd_sr_unlock _bsd_usbd_sr_unlock +#define usbd_transfer_clear_stall _bsd_usbd_transfer_clear_stall +#define usbd_transfer_dequeue _bsd_usbd_transfer_dequeue +#define usbd_transfer_done _bsd_usbd_transfer_done +#define usbd_transfer_drain _bsd_usbd_transfer_drain +#define usbd_transfer_enqueue _bsd_usbd_transfer_enqueue +#define usbd_transfer_pending _bsd_usbd_transfer_pending +#define usbd_transfer_poll _bsd_usbd_transfer_poll +#define usbd_transfer_power_ref _bsd_usbd_transfer_power_ref +#define usbd_transfer_setup _bsd_usbd_transfer_setup +#define usbd_transfer_setup_sub _bsd_usbd_transfer_setup_sub +#define usbd_transfer_setup_sub_malloc _bsd_usbd_transfer_setup_sub_malloc +#define usbd_transfer_start _bsd_usbd_transfer_start +#define usbd_transfer_stop _bsd_usbd_transfer_stop +#define usbd_transfer_submit _bsd_usbd_transfer_submit +#define usbd_transfer_timeout_ms _bsd_usbd_transfer_timeout_ms +#define usbd_transfer_unsetup _bsd_usbd_transfer_unsetup +#define usb_dump_device _bsd_usb_dump_device +#define usb_dump_endpoint _bsd_usb_dump_endpoint +#define usb_dump_iface _bsd_usb_dump_iface +#define usb_dump_queue _bsd_usb_dump_queue +#define usb_dump_xfer _bsd_usb_dump_xfer +#define usbd_xfer_clr_flag _bsd_usbd_xfer_clr_flag +#define usbd_xfer_frame_data _bsd_usbd_xfer_frame_data +#define usbd_xfer_frame_len _bsd_usbd_xfer_frame_len +#define usbd_xfer_get_fps_shift _bsd_usbd_xfer_get_fps_shift +#define usbd_xfer_get_frame _bsd_usbd_xfer_get_frame +#define usbd_xfer_get_priv _bsd_usbd_xfer_get_priv +#define usbd_xfer_get_timestamp _bsd_usbd_xfer_get_timestamp +#define usbd_xfer_is_stalled _bsd_usbd_xfer_is_stalled +#define usbd_xfer_max_framelen _bsd_usbd_xfer_max_framelen +#define usbd_xfer_max_frames _bsd_usbd_xfer_max_frames +#define usbd_xfer_max_len _bsd_usbd_xfer_max_len +#define usbd_xfer_set_flag _bsd_usbd_xfer_set_flag +#define usbd_xfer_set_frame_data _bsd_usbd_xfer_set_frame_data +#define usbd_xfer_set_frame_len _bsd_usbd_xfer_set_frame_len +#define usbd_xfer_set_frame_offset _bsd_usbd_xfer_set_frame_offset +#define usbd_xfer_set_frames _bsd_usbd_xfer_set_frames +#define usbd_xfer_set_interval _bsd_usbd_xfer_set_interval +#define usbd_xfer_set_priv _bsd_usbd_xfer_set_priv +#define usbd_xfer_set_stall _bsd_usbd_xfer_set_stall +#define usbd_xfer_set_timeout _bsd_usbd_xfer_set_timeout +#define usbd_xfer_softc _bsd_usbd_xfer_softc +#define usbd_xfer_state _bsd_usbd_xfer_state +#define usbd_xfer_status _bsd_usbd_xfer_status +#define usb_edesc_foreach _bsd_usb_edesc_foreach +#define usb_endpoint_foreach _bsd_usb_endpoint_foreach +#define usb_free_device _bsd_usb_free_device +#define usb_get_manufacturer _bsd_usb_get_manufacturer +#define usb_get_product _bsd_usb_get_product +#define usb_get_serial _bsd_usb_get_serial +#define usb_handle_request_callback _bsd_usb_handle_request_callback +#define usb_handle_request_desc _bsd_usb_handle_request_desc +#define usb_handle_request_method_default _bsd_usb_handle_request_method_default +#define usb_hs_bandwidth_alloc _bsd_usb_hs_bandwidth_alloc +#define usb_hs_bandwidth_free _bsd_usb_hs_bandwidth_free +#define usb_idesc_foreach _bsd_usb_idesc_foreach +#define usb_iface_is_cdrom _bsd_usb_iface_is_cdrom +#define usb_isoc_time_expand _bsd_usb_isoc_time_expand +#define usb_make_str_desc _bsd_usb_make_str_desc +#define usb_msc_eject _bsd_usb_msc_eject +#define usb_needs_explore _bsd_usb_needs_explore +#define usb_needs_explore_all _bsd_usb_needs_explore_all +#define usb_pause_mtx _bsd_usb_pause_mtx +#define usb_pc_alloc_mem _bsd_usb_pc_alloc_mem +#define usb_pc_cpu_flush _bsd_usb_pc_cpu_flush +#define usb_pc_cpu_invalidate _bsd_usb_pc_cpu_invalidate +#define usb_pc_dmamap_create _bsd_usb_pc_dmamap_create +#define usb_pc_dmamap_destroy _bsd_usb_pc_dmamap_destroy +#define usb_pc_free_mem _bsd_usb_pc_free_mem +#define usb_pc_load_mem _bsd_usb_pc_load_mem +#define usb_peer_can_wakeup _bsd_usb_peer_can_wakeup +#define usb_printbcd _bsd_usb_printbcd +#define usb_probe_and_attach _bsd_usb_probe_and_attach +#define usb_proc_create _bsd_usb_proc_create +#define usb_proc_drain _bsd_usb_proc_drain +#define usb_proc_free _bsd_usb_proc_free +#define usb_proc_is_gone _bsd_usb_proc_is_gone +#define usb_proc_msignal _bsd_usb_proc_msignal +#define usb_proc_mwait _bsd_usb_proc_mwait +#define usb_proc_rewakeup _bsd_usb_proc_rewakeup +#define usb_quirk_ioctl_p _bsd_usb_quirk_ioctl_p +#define usb_quirk_unload _bsd_usb_quirk_unload +#define usb_reset_iface_endpoints _bsd_usb_reset_iface_endpoints +#define usb_set_device_state _bsd_usb_set_device_state +#define usb_statestr _bsd_usb_statestr +#define usb_suspend_resume _bsd_usb_suspend_resume +#define usb_temp_get_desc_p _bsd_usb_temp_get_desc_p +#define usb_template _bsd_usb_template +#define usb_temp_setup_by_index_p _bsd_usb_temp_setup_by_index_p +#define usb_temp_unload _bsd_usb_temp_unload +#define usb_temp_unsetup_p _bsd_usb_temp_unsetup_p +#define usb_test_quirk _bsd_usb_test_quirk +#define usb_test_quirk_p _bsd_usb_test_quirk_p +#define usb_trim_spaces _bsd_usb_trim_spaces +#define xpt_bus_deregister _bsd_xpt_bus_deregister +#define xpt_bus_register _bsd_xpt_bus_register +#define xpt_done _bsd_xpt_done + +#endif /* _RTEMS_BSD_MACHINE_RTEMS_BSD_SYMBOLS_H_ */ diff --git a/rtems/freebsd/machine/rtems-bsd-sysinit.h b/rtems/freebsd/machine/rtems-bsd-sysinit.h new file mode 100644 index 00000000..98de2b80 --- /dev/null +++ b/rtems/freebsd/machine/rtems-bsd-sysinit.h @@ -0,0 +1,67 @@ +/** + * @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_RTEMS_BSD_SYSINIT_H_ +#define _RTEMS_BSD_MACHINE_RTEMS_BSD_SYSINIT_H_ + +#include <rtems/freebsd/sys/cdefs.h> +#include <rtems/freebsd/sys/queue.h> +#include <rtems/freebsd/sys/kernel.h> + +#define SYSINIT_NEED_FREEBSD_CORE \ + SYSINIT_REFERENCE(configure1); \ + SYSINIT_REFERENCE(module); \ + SYSINIT_REFERENCE(kobj); \ + SYSINIT_REFERENCE(linker_kernel); \ + SYSINIT_MODULE_REFERENCE(rootbus); \ + SYSINIT_DRIVER_REFERENCE(nexus, root) + +#define SYSINIT_NEED_USB_CORE \ + SYSINIT_REFERENCE(usb_quirk_init); \ + SYSINIT_DRIVER_REFERENCE(uhub, usbus) + +#define SYSINIT_NEED_USB_OHCI \ + SYSINIT_DRIVER_REFERENCE(ohci, nexus); \ + SYSINIT_DRIVER_REFERENCE(usbus, ohci) + +#define SYSINIT_NEED_USB_EHCI \ + SYSINIT_DRIVER_REFERENCE(ehci, nexus); \ + SYSINIT_DRIVER_REFERENCE(usbus, ehci) + +#define SYSINIT_NEED_USB_MASS_STORAGE \ + SYSINIT_DRIVER_REFERENCE(umass, uhub) + +#define SYSINIT_NEED_USB_MOUSE \ + SYSINIT_DRIVER_REFERENCE(umass, uhub) + +#define SYSINIT_NEED_SDHC \ + SYSINIT_DRIVER_REFERENCE(sdhci, nexus); \ + SYSINIT_DRIVER_REFERENCE(mmc, sdhci); \ + SYSINIT_DRIVER_REFERENCE(mmcsd, mmc) + +#define SYSINIT_NEED_NET_MII \ + SYSINIT_DRIVER_REFERENCE(icsphy, miibus); + +/* FIXME */ +extern const char *const _bsd_nexus_devices []; + +#endif /* _RTEMS_BSD_MACHINE_RTEMS_BSD_SYSINIT_H_ */ diff --git a/rtems/freebsd/machine/runq.h b/rtems/freebsd/machine/runq.h new file mode 100644 index 00000000..c03945a2 --- /dev/null +++ b/rtems/freebsd/machine/runq.h @@ -0,0 +1,41 @@ +/** + * @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_RUNQ_H_ +#define _RTEMS_BSD_MACHINE_RUNQ_H_ + +#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_CONFIG_H_ +#error "the header file <rtems/freebsd/machine/rtems-bsd-config.h> must be included first" +#endif + +#define RQB_LEN 0 +#define RQB_L2BPW 0 +#define RQB_BPW 0 + +#define RQB_BIT(pri) 0 +#define RQB_WORD(pri) 0 + +#define RQB_FFS(word) 0 + +typedef uintptr_t rqb_word_t; + +#endif /* _RTEMS_BSD_MACHINE_RUNQ_H_ */ diff --git a/rtems/freebsd/machine/sf_buf.h b/rtems/freebsd/machine/sf_buf.h new file mode 100644 index 00000000..936ffd88 --- /dev/null +++ b/rtems/freebsd/machine/sf_buf.h @@ -0,0 +1 @@ +/* EMPTY */ diff --git a/rtems/freebsd/machine/signal.h b/rtems/freebsd/machine/signal.h new file mode 100644 index 00000000..72aebe22 --- /dev/null +++ b/rtems/freebsd/machine/signal.h @@ -0,0 +1,30 @@ +/** + * @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_SIGNAL_H_ +#define _RTEMS_BSD_MACHINE_SIGNAL_H_ + +#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_CONFIG_H_ +#error "the header file <rtems/freebsd/machine/rtems-bsd-config.h> must be included first" +#endif + +#endif /* _RTEMS_BSD_MACHINE_SIGNAL_H_ */ diff --git a/rtems/freebsd/machine/stdarg.h b/rtems/freebsd/machine/stdarg.h new file mode 100644 index 00000000..08fc1fb7 --- /dev/null +++ b/rtems/freebsd/machine/stdarg.h @@ -0,0 +1,30 @@ +/** + * @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_STDARG_H_ +#define _RTEMS_BSD_MACHINE_STDARG_H_ + +#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_CONFIG_H_ +#error "the header file <rtems/freebsd/machine/rtems-bsd-config.h> must be included first" +#endif + +#endif /* _RTEMS_BSD_MACHINE_STDARG_H_ */ diff --git a/rtems/freebsd/machine/ucontext.h b/rtems/freebsd/machine/ucontext.h new file mode 100644 index 00000000..9a46840c --- /dev/null +++ b/rtems/freebsd/machine/ucontext.h @@ -0,0 +1,32 @@ +/** + * @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_UCONTEXT_H_ +#define _RTEMS_BSD_MACHINE_UCONTEXT_H_ + +#ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_CONFIG_H_ +#error "the header file <rtems/freebsd/machine/rtems-bsd-config.h> must be included first" +#endif + +typedef int mcontext_t; + +#endif /* _RTEMS_BSD_MACHINE_UCONTEXT_H_ */ |