xref: /openbsd-src/lib/libarch/i386/i386_iopl.c (revision 6aaa4f18e583bc51885090ea9aaf4e5ba719ba6b)
1*6aaa4f18Sjca /*	$OpenBSD: i386_iopl.c,v 1.8 2016/02/01 19:58:44 jca Exp $	*/
23fbbad10Sniklas /*	$NetBSD: i386_iopl.c,v 1.2 1996/02/27 22:57:29 jtc Exp $	*/
3df930be7Sderaadt 
43fbbad10Sniklas /*-
53fbbad10Sniklas  * Copyright (c) 1996 The NetBSD Foundation, Inc.
63fbbad10Sniklas  * All rights reserved.
73fbbad10Sniklas  *
83fbbad10Sniklas  * This code is derived from software contributed to The NetBSD Foundation
93fbbad10Sniklas  * by John T. Kohl and Charles M. Hannum.
10df930be7Sderaadt  *
11df930be7Sderaadt  * Redistribution and use in source and binary forms, with or without
12df930be7Sderaadt  * modification, are permitted provided that the following conditions
13df930be7Sderaadt  * are met:
14df930be7Sderaadt  * 1. Redistributions of source code must retain the above copyright
15df930be7Sderaadt  *    notice, this list of conditions and the following disclaimer.
16df930be7Sderaadt  * 2. Redistributions in binary form must reproduce the above copyright
17df930be7Sderaadt  *    notice, this list of conditions and the following disclaimer in the
18df930be7Sderaadt  *    documentation and/or other materials provided with the distribution.
19df930be7Sderaadt  *
203fbbad10Sniklas  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
213fbbad10Sniklas  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
223fbbad10Sniklas  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
233fbbad10Sniklas  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
243fbbad10Sniklas  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
253fbbad10Sniklas  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
263fbbad10Sniklas  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
273fbbad10Sniklas  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
283fbbad10Sniklas  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
293fbbad10Sniklas  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
303fbbad10Sniklas  * POSSIBILITY OF SUCH DAMAGE.
31df930be7Sderaadt  */
32df930be7Sderaadt 
33df930be7Sderaadt #include <sys/types.h>
34df930be7Sderaadt 
358c673d26Stholo #include <machine/segments.h>
36df930be7Sderaadt #include <machine/sysarch.h>
37df930be7Sderaadt 
38df930be7Sderaadt int
i386_iopl(int iopl)39*6aaa4f18Sjca i386_iopl(int iopl)
40df930be7Sderaadt {
41df930be7Sderaadt 	struct i386_iopl_args p;
42df930be7Sderaadt 
43df930be7Sderaadt 	p.iopl = iopl;
44df930be7Sderaadt 
455d4a7384Stedu 	return sysarch(I386_IOPL, &p);
46df930be7Sderaadt }
47