X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/8f6c56a50524aa785f7e596d52dddfb331e18961..13f56ec4e58bf8687e2a68032c093c0213dd519b:/osfmk/i386/user_ldt.h diff --git a/osfmk/i386/user_ldt.h b/osfmk/i386/user_ldt.h index 4295d939e..8285cb4df 100644 --- a/osfmk/i386/user_ldt.h +++ b/osfmk/i386/user_ldt.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * Copyright (c) 2000-2008 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * @@ -63,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 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_ */