summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux
diff options
context:
space:
mode:
authorkato <kato@FreeBSD.org>1997-10-29 08:17:14 +0000
committerkato <kato@FreeBSD.org>1997-10-29 08:17:14 +0000
commitcfc3d1cfdf8f470ceaa10cf99b2d0ed73ff1a9a9 (patch)
tree33b548f672d63de866a93eebc1f531fdd12cc947 /sys/compat/linux
parentdf76a9fc09877af643adca9756ab09318629f10e (diff)
downloadFreeBSD-src-cfc3d1cfdf8f470ceaa10cf99b2d0ed73ff1a9a9.zip
FreeBSD-src-cfc3d1cfdf8f470ceaa10cf99b2d0ed73ff1a9a9.tar.gz
Implement linux_iopl and linux_nice.
Diffstat (limited to 'sys/compat/linux')
-rw-r--r--sys/compat/linux/linux_misc.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c
index 723732b..cc55b1e 100644
--- a/sys/compat/linux/linux_misc.c
+++ b/sys/compat/linux/linux_misc.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: linux_misc.c,v 1.29 1997/07/20 16:06:01 bde Exp $
+ * $Id: linux_misc.c,v 1.30 1997/09/21 21:43:45 gibbs Exp $
*/
#include <sys/param.h>
@@ -52,6 +52,9 @@
#include <vm/vm_map.h>
#include <vm/vm_extern.h>
+#include <machine/cpu.h>
+#include <machine/psl.h>
+
#include <i386/linux/linux.h>
#include <i386/linux/linux_proto.h>
#include <i386/linux/linux_util.h>
@@ -931,3 +934,30 @@ linux_getitimer(struct proc *p, struct linux_getitimer_args *args, int *retval)
bsa.itv = args->itv;
return getitimer(p, &bsa, retval);
}
+
+int
+linux_iopl(struct proc *p, struct linux_iopl_args *args, int *retval)
+{
+ int error;
+ struct trapframe *fp;
+
+ error = suser(p->p_ucred, &p->p_acflag);
+ if (error)
+ return (error);
+ fp = (struct trapframe *)p->p_md.md_regs;
+ fp->tf_eflags |= PSL_IOPL;
+
+ return 0;
+}
+
+int
+linux_nice(struct proc *p, struct linux_nice_args *args, int *retval)
+{
+ struct setpriority_args bsd_args;
+
+ bsd_args.which = PRIO_PROCESS;
+ bsd_args.who = 0; /* current process */
+ bsd_args.prio = args->inc;
+ return setpriority(p, &bsd_args, retval);
+}
+
OpenPOWER on IntegriCloud