11052Sdg/* 21052Sdg * Copyright (c) 1993 John Brezak 31052Sdg * All rights reserved. 48870Srgrimes * 51052Sdg * Redistribution and use in source and binary forms, with or without 61052Sdg * modification, are permitted provided that the following conditions 71052Sdg * are met: 81052Sdg * 1. Redistributions of source code must retain the above copyright 91052Sdg * notice, this list of conditions and the following disclaimer. 101052Sdg * 2. Redistributions in binary form must reproduce the above copyright 111052Sdg * notice, this list of conditions and the following disclaimer in the 121052Sdg * documentation and/or other materials provided with the distribution. 131052Sdg * 3. The name of the author may not be used to endorse or promote products 141052Sdg * derived from this software without specific prior written permission. 158870Srgrimes * 161052Sdg * THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND ANY EXPRESS OR 171052Sdg * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 181052Sdg * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 191052Sdg * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 201052Sdg * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 211052Sdg * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 221052Sdg * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 231052Sdg * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 241052Sdg * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 251052Sdg * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 261052Sdg * POSSIBILITY OF SUCH DAMAGE. 271052Sdg */ 281052Sdg 2992986Sobrien#include <sys/cdefs.h> 3092986Sobrien__FBSDID("$FreeBSD: releng/11.0/lib/libc/i386/sys/i386_set_ldt.c 124296 2004-01-09 16:52:09Z nectar $"); 315790Sdg 321052Sdg#include <sys/cdefs.h> 331052Sdg#include <machine/segments.h> 341052Sdg#include <machine/sysarch.h> 351052Sdg 361052Sdgint 371052Sdgi386_set_ldt(int start, union descriptor *descs, int num) 381052Sdg{ 3950817Sluoqi struct i386_ldt_args p; 401052Sdg 4150817Sluoqi p.start = start; 4250817Sluoqi p.descs = descs; 4350817Sluoqi p.num = num; 448870Srgrimes 45124296Snectar return sysarch(I386_SET_LDT, &p); 461052Sdg} 47