18ab2f5ecSMark Murray /*-
24d846d26SWarner Losh * SPDX-License-Identifier: BSD-2-Clause
383ef78beSPedro F. Giffuni *
48ab2f5ecSMark Murray * Copyright (c) 2004 Mark R V Murray
58ab2f5ecSMark Murray * All rights reserved.
68ab2f5ecSMark Murray *
78ab2f5ecSMark Murray * Redistribution and use in source and binary forms, with or without
88ab2f5ecSMark Murray * modification, are permitted provided that the following conditions
98ab2f5ecSMark Murray * are met:
108ab2f5ecSMark Murray * 1. Redistributions of source code must retain the above copyright
118ab2f5ecSMark Murray * notice, this list of conditions and the following disclaimer
128ab2f5ecSMark Murray * in this position and unchanged.
138ab2f5ecSMark Murray * 2. Redistributions in binary form must reproduce the above copyright
148ab2f5ecSMark Murray * notice, this list of conditions and the following disclaimer in the
158ab2f5ecSMark Murray * documentation and/or other materials provided with the distribution.
168ab2f5ecSMark Murray *
178ab2f5ecSMark Murray * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
188ab2f5ecSMark Murray * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
198ab2f5ecSMark Murray * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
208ab2f5ecSMark Murray * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
218ab2f5ecSMark Murray * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
228ab2f5ecSMark Murray * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
238ab2f5ecSMark Murray * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
248ab2f5ecSMark Murray * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
258ab2f5ecSMark Murray * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
268ab2f5ecSMark Murray * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
278ab2f5ecSMark Murray */
288ab2f5ecSMark Murray
298ab2f5ecSMark Murray #include <sys/param.h>
308ab2f5ecSMark Murray #include <sys/proc.h>
318ab2f5ecSMark Murray
328ab2f5ecSMark Murray #include <machine/frame.h>
338ab2f5ecSMark Murray #include <machine/iodev.h>
34d8b87887SAttilio Rao #include <machine/psl.h>
358ab2f5ecSMark Murray
368ab2f5ecSMark Murray int
iodev_open(struct thread * td)37d8b87887SAttilio Rao iodev_open(struct thread *td)
388ab2f5ecSMark Murray {
398ab2f5ecSMark Murray
408ab2f5ecSMark Murray td->td_frame->tf_eflags |= PSL_IOPL;
418ab2f5ecSMark Murray return (0);
428ab2f5ecSMark Murray }
438ab2f5ecSMark Murray
448ab2f5ecSMark Murray int
iodev_close(struct thread * td)45d8b87887SAttilio Rao iodev_close(struct thread *td)
468ab2f5ecSMark Murray {
47d8b87887SAttilio Rao
488ab2f5ecSMark Murray td->td_frame->tf_eflags &= ~PSL_IOPL;
498ab2f5ecSMark Murray return (0);
508ab2f5ecSMark Murray }
51409a390cSMarcel Moolenaar
52409a390cSMarcel Moolenaar /* ARGSUSED */
53409a390cSMarcel Moolenaar int
iodev_ioctl(u_long cmd __unused,caddr_t data __unused)54d8b87887SAttilio Rao iodev_ioctl(u_long cmd __unused, caddr_t data __unused)
55409a390cSMarcel Moolenaar {
56409a390cSMarcel Moolenaar
57d8b87887SAttilio Rao return (ENOIOCTL);
58409a390cSMarcel Moolenaar }
59