diff --git a/Makefile b/Makefile index d82f0e25..89fbd162 100644 --- a/Makefile +++ b/Makefile @@ -55,6 +55,7 @@ C_FILES += rtemsbsd/src/rtems-bsd-taskqueue.c C_FILES += rtemsbsd/src/rtems-bsd-timesupport.c C_FILES += rtemsbsd/src/rtems-bsd-newproc.c C_FILES += rtemsbsd/src/rtems-bsd-vm_glue.c +C_FILES += rtemsbsd/src/rtems-bsd-subr.c C_FILES += freebsd/kern/subr_eventhandler.c C_FILES += freebsd/kern/kern_subr.c C_FILES += freebsd/kern/kern_tc.c diff --git a/freebsd-to-rtems.py b/freebsd-to-rtems.py index ec63e829..a4032f88 100755 --- a/freebsd-to-rtems.py +++ b/freebsd-to-rtems.py @@ -548,6 +548,7 @@ rtems.addRTEMSSourceFiles( 'src/rtems-bsd-timesupport.c', 'src/rtems-bsd-newproc.c', 'src/rtems-bsd-vm_glue.c', + 'src/rtems-bsd-subr.c', ] ) rtems.addEmptyHeaderFiles( diff --git a/rtemsbsd/src/rtems-bsd-subr.c b/rtemsbsd/src/rtems-bsd-subr.c new file mode 100644 index 00000000..0a7c4296 --- /dev/null +++ b/rtemsbsd/src/rtems-bsd-subr.c @@ -0,0 +1,79 @@ +/** + * @file + * + * @ingroup rtems_bsd_rtems + * + * @brief TODO. + */ + +/* + * This file contains rtems versions of methods defined in kern_subr.c + * Methods that do not require modification will remain in the original + * file. + * + * Copyright (c) 1982, 1986, 1991, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * 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. + * + * @(#)kern_subr.c 8.3 (Berkeley) 1/21/94 + * + * + * COPYRIGHT (c) 2012. + * On-Line Applications Research Corporation (OAR). + * + * 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. + */ + +#include + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +void +uio_yield(void) +{ + DROP_GIANT(); + rtems_task_wake_after( RTEMS_YIELD_PROCESSOR ); + PICKUP_GIANT(); +}