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