1*4bc66c0fSBrooks Davis /*-
2*4bc66c0fSBrooks Davis * SPDX-License-Identifier: BSD-2-Clause
3*4bc66c0fSBrooks Davis *
4*4bc66c0fSBrooks Davis * Copyright (c) 2005 Peter Wemm
5*4bc66c0fSBrooks Davis * All rights reserved.
6*4bc66c0fSBrooks Davis *
7*4bc66c0fSBrooks Davis * Redistribution and use in source and binary forms, with or without
8*4bc66c0fSBrooks Davis * modification, are permitted provided that the following conditions
9*4bc66c0fSBrooks Davis * are met:
10*4bc66c0fSBrooks Davis * 1. Redistributions of source code must retain the above copyright
11*4bc66c0fSBrooks Davis * notice, this list of conditions and the following disclaimer.
12*4bc66c0fSBrooks Davis * 2. Redistributions in binary form must reproduce the above copyright
13*4bc66c0fSBrooks Davis * notice, this list of conditions and the following disclaimer in the
14*4bc66c0fSBrooks Davis * documentation and/or other materials provided with the distribution.
15*4bc66c0fSBrooks Davis *
16*4bc66c0fSBrooks Davis * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17*4bc66c0fSBrooks Davis * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18*4bc66c0fSBrooks Davis * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19*4bc66c0fSBrooks Davis * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20*4bc66c0fSBrooks Davis * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21*4bc66c0fSBrooks Davis * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22*4bc66c0fSBrooks Davis * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23*4bc66c0fSBrooks Davis * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24*4bc66c0fSBrooks Davis * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25*4bc66c0fSBrooks Davis * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26*4bc66c0fSBrooks Davis * SUCH DAMAGE.
27*4bc66c0fSBrooks Davis */
28*4bc66c0fSBrooks Davis
29*4bc66c0fSBrooks Davis #include <machine/sysarch.h>
30*4bc66c0fSBrooks Davis
31*4bc66c0fSBrooks Davis int
i386_get_gsbase(void ** addr)32*4bc66c0fSBrooks Davis i386_get_gsbase(void **addr)
33*4bc66c0fSBrooks Davis {
34*4bc66c0fSBrooks Davis
35*4bc66c0fSBrooks Davis return (sysarch(I386_GET_GSBASE, addr));
36*4bc66c0fSBrooks Davis }
37