mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-15 06:26:46 +08:00
Moved uio_yield implementation into bsd file.
This commit is contained in:
@@ -70,6 +70,11 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <freebsd/vm/vm_object.h>
|
#include <freebsd/vm/vm_object.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __rtems__
|
||||||
|
#include <rtems.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef __rtems__
|
#ifndef __rtems__
|
||||||
SYSCTL_INT(_kern, KERN_IOV_MAX, iov_max, CTLFLAG_RD, NULL, UIO_MAXIOV,
|
SYSCTL_INT(_kern, KERN_IOV_MAX, iov_max, CTLFLAG_RD, NULL, UIO_MAXIOV,
|
||||||
"Maximum number of elements in an I/O vector; sysconf(_SC_IOV_MAX)");
|
"Maximum number of elements in an I/O vector; sysconf(_SC_IOV_MAX)");
|
||||||
@@ -468,7 +473,6 @@ phashinit(int elements, struct malloc_type *type, u_long *nentries)
|
|||||||
return (hashtbl);
|
return (hashtbl);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef __rtems__
|
|
||||||
void
|
void
|
||||||
uio_yield(void)
|
uio_yield(void)
|
||||||
{
|
{
|
||||||
@@ -476,15 +480,18 @@ uio_yield(void)
|
|||||||
|
|
||||||
td = curthread;
|
td = curthread;
|
||||||
DROP_GIANT();
|
DROP_GIANT();
|
||||||
thread_lock(td);
|
|
||||||
#ifndef __rtems__
|
#ifndef __rtems__
|
||||||
|
thread_lock(td);
|
||||||
sched_prio(td, td->td_user_pri);
|
sched_prio(td, td->td_user_pri);
|
||||||
#endif
|
|
||||||
mi_switch(SW_INVOL | SWT_RELINQUISH, NULL);
|
mi_switch(SW_INVOL | SWT_RELINQUISH, NULL);
|
||||||
thread_unlock(td);
|
thread_unlock(td);
|
||||||
|
#else
|
||||||
|
rtems_task_wake_after( RTEMS_YIELD_PROCESSOR );
|
||||||
|
#endif
|
||||||
PICKUP_GIANT();
|
PICKUP_GIANT();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef __rtems__
|
||||||
int
|
int
|
||||||
copyinfrom(const void * __restrict src, void * __restrict dst, size_t len,
|
copyinfrom(const void * __restrict src, void * __restrict dst, size_t len,
|
||||||
int seg)
|
int seg)
|
||||||
|
@@ -1,79 +0,0 @@
|
|||||||
/**
|
|
||||||
* @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 <freebsd/machine/rtems-bsd-config.h>
|
|
||||||
|
|
||||||
#include <freebsd/sys/cdefs.h>
|
|
||||||
__FBSDID("$FreeBSD$");
|
|
||||||
|
|
||||||
#include <freebsd/local/opt_zero.h>
|
|
||||||
|
|
||||||
#include <freebsd/sys/param.h>
|
|
||||||
#include <freebsd/sys/systm.h>
|
|
||||||
#include <freebsd/sys/kernel.h>
|
|
||||||
#include <freebsd/sys/ktr.h>
|
|
||||||
#include <freebsd/sys/limits.h>
|
|
||||||
#include <freebsd/sys/lock.h>
|
|
||||||
#include <freebsd/sys/mutex.h>
|
|
||||||
#include <rtems.h>
|
|
||||||
|
|
||||||
void
|
|
||||||
uio_yield(void)
|
|
||||||
{
|
|
||||||
DROP_GIANT();
|
|
||||||
rtems_task_wake_after( RTEMS_YIELD_PROCESSOR );
|
|
||||||
PICKUP_GIANT();
|
|
||||||
}
|
|
Reference in New Issue
Block a user