i386_get_ldt.c revision 1.4 1 1.4 perry /* $NetBSD: i386_get_ldt.c,v 1.4 1998/01/09 03:15:09 perry Exp $ */
2 1.4 perry
3 1.1 brezak /*
4 1.1 brezak * Copyright (c) 1993 John Brezak
5 1.1 brezak * All rights reserved.
6 1.1 brezak *
7 1.1 brezak * Redistribution and use in source and binary forms, with or without
8 1.1 brezak * modification, are permitted provided that the following conditions
9 1.1 brezak * are met:
10 1.1 brezak * 1. Redistributions of source code must retain the above copyright
11 1.1 brezak * notice, this list of conditions and the following disclaimer.
12 1.1 brezak * 2. Redistributions in binary form must reproduce the above copyright
13 1.1 brezak * notice, this list of conditions and the following disclaimer in the
14 1.1 brezak * documentation and/or other materials provided with the distribution.
15 1.1 brezak * 3. The name of the author may not be used to endorse or promote products
16 1.1 brezak * derived from this software without specific prior written permission.
17 1.1 brezak *
18 1.1 brezak * THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND ANY EXPRESS OR
19 1.1 brezak * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 1.1 brezak * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 1.1 brezak * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
22 1.1 brezak * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 1.1 brezak * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 1.1 brezak * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 1.1 brezak * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26 1.1 brezak * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
27 1.1 brezak * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 1.1 brezak * POSSIBILITY OF SUCH DAMAGE.
29 1.1 brezak *
30 1.1 brezak */
31 1.1 brezak
32 1.1 brezak #include <sys/cdefs.h>
33 1.3 mycroft #include <sys/types.h>
34 1.3 mycroft
35 1.1 brezak #include <machine/segments.h>
36 1.1 brezak #include <machine/sysarch.h>
37 1.1 brezak
38 1.1 brezak int
39 1.2 mycroft i386_get_ldt(start, desc, num)
40 1.2 mycroft int start;
41 1.2 mycroft union descriptor *desc;
42 1.2 mycroft int num;
43 1.1 brezak {
44 1.2 mycroft struct i386_get_ldt_args p;
45 1.2 mycroft
46 1.2 mycroft p.start = start;
47 1.2 mycroft p.desc = desc;
48 1.2 mycroft p.num = num;
49 1.1 brezak
50 1.1 brezak return sysarch(I386_GET_LDT, (char *)&p);
51 1.1 brezak }
52