xref: /openbsd-src/lib/libarch/i386/i386_set_fsbase.c (revision 4a39ccd02c887d988c1a5398dd2142879056da5f)
1*4a39ccd0Sderaadt /*	$OpenBSD: i386_set_fsbase.c,v 1.2 2012/12/05 23:19:58 deraadt Exp $	*/
2ea2c4681Sguenther /*	$NetBSD: i386_set_ioperm.c,v 1.2 1996/02/27 22:57:31 jtc Exp $	*/
3ea2c4681Sguenther 
4ea2c4681Sguenther /*-
5ea2c4681Sguenther  * Copyright (c) 1996 The NetBSD Foundation, Inc.
6ea2c4681Sguenther  * All rights reserved.
7ea2c4681Sguenther  *
8ea2c4681Sguenther  * This code is derived from software contributed to The NetBSD Foundation
9ea2c4681Sguenther  * by John T. Kohl and Charles M. Hannum.
10ea2c4681Sguenther  *
11ea2c4681Sguenther  * Redistribution and use in source and binary forms, with or without
12ea2c4681Sguenther  * modification, are permitted provided that the following conditions
13ea2c4681Sguenther  * are met:
14ea2c4681Sguenther  * 1. Redistributions of source code must retain the above copyright
15ea2c4681Sguenther  *    notice, this list of conditions and the following disclaimer.
16ea2c4681Sguenther  * 2. Redistributions in binary form must reproduce the above copyright
17ea2c4681Sguenther  *    notice, this list of conditions and the following disclaimer in the
18ea2c4681Sguenther  *    documentation and/or other materials provided with the distribution.
19ea2c4681Sguenther  *
20ea2c4681Sguenther  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
21ea2c4681Sguenther  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22ea2c4681Sguenther  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23ea2c4681Sguenther  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
24ea2c4681Sguenther  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25ea2c4681Sguenther  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26ea2c4681Sguenther  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27ea2c4681Sguenther  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28ea2c4681Sguenther  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29ea2c4681Sguenther  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30ea2c4681Sguenther  * POSSIBILITY OF SUCH DAMAGE.
31ea2c4681Sguenther  */
32ea2c4681Sguenther 
33ea2c4681Sguenther #include <sys/types.h>
34ea2c4681Sguenther 
35ea2c4681Sguenther #include <machine/segments.h>
36ea2c4681Sguenther #include <machine/sysarch.h>
37ea2c4681Sguenther 
38ea2c4681Sguenther int
i386_set_fsbase(void * base)39ea2c4681Sguenther i386_set_fsbase(void *base)
40ea2c4681Sguenther {
41ea2c4681Sguenther 	return sysarch(I386_SET_FSBASE, &base);
42ea2c4681Sguenther }
43