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