X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/43866e378188c25dd1e2208016ab3cbeb086ae6c..e2d2fc5c71f7d145cba7267989251af45e3bb5ba:/osfmk/i386/user_ldt.h diff --git a/osfmk/i386/user_ldt.h b/osfmk/i386/user_ldt.h index 03e6882ac..8285cb4df 100644 --- a/osfmk/i386/user_ldt.h +++ b/osfmk/i386/user_ldt.h @@ -1,16 +1,19 @@ /* - * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * Copyright (c) 2000-2008 Apple Inc. All rights reserved. * - * @APPLE_LICENSE_HEADER_START@ - * - * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this - * file. + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER @@ -20,7 +23,7 @@ * Please see the License for the specific language governing rights and * limitations under the License. * - * @APPLE_LICENSE_HEADER_END@ + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * @OSF_COPYRIGHT@ @@ -60,29 +63,36 @@ /* * User LDT management. * - * Each thread in a task may have its own LDT. + * Each task may have its own LDT. */ +#define LDT_AUTO_ALLOC 0xffffffff + +#ifdef KERNEL #include struct user_ldt { - struct real_descriptor desc; /* descriptor for self */ - struct real_descriptor ldt[1]; /* descriptor table (variable) */ + unsigned int start; /* first descriptor in table */ + unsigned int count; /* how many descriptors in table */ + struct real_descriptor ldt[0]; /* descriptor table (variable) */ }; typedef struct user_ldt * user_ldt_t; -/* - * Check code/stack/data selector values against LDT if present. - */ -#define S_CODE 0 /* code segment */ -#define S_STACK 1 /* stack segment */ -#define S_DATA 2 /* data segment */ - -extern boolean_t selector_check( - thread_t thread, - int sel, - int type); +extern user_ldt_t user_ldt_copy( + user_ldt_t uldt); extern void user_ldt_free( - user_ldt_t ldt); + user_ldt_t uldt); +extern void user_ldt_set( + thread_t thread); +#else /* !KERNEL */ +#include + +union ldt_entry; + +__BEGIN_DECLS +int i386_get_ldt(int, union ldt_entry *, int); +int i386_set_ldt(int, const union ldt_entry *, int); +__END_DECLS +#endif /* KERNEL */ #endif /* _I386_USER_LDT_H_ */