From 851fdb496728e83cdb3f591a674d3425efc1f11c Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sun, 5 Nov 2006 20:39:25 +0000 Subject: 2006-11-05 Barry deFreese [task #5878 --- ``Backport code from GNU Mach's trunk to gnumach-1-branch: i386_set_gdt, i386_get_gdt''] * i386/include/mach/i386/mach_i386.defs (i386_set_gdt, i386_get_gdt): New routines. * i386/i386/user_ldt.c (i386_set_gdt, i386_get_gdt): New functions. * i386/i386/gdt.h (USER_GDT, USER_GDT_SLOTS): New macros. (GDTSZ): Compute it from USER_GDT and USER_GDT_SLOTS. * i386/i386/thread.h: Include `gdt.h'. (struct i386_machine_state): New member `user_gdt'. * i386/i386/pcb.c (switch_ktss): Copy those slots into the GDT. * linux/dev/include/linux/head.h: New file. --- i386/include/mach/i386/mach_i386.defs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'i386/include/mach') diff --git a/i386/include/mach/i386/mach_i386.defs b/i386/include/mach/i386/mach_i386.defs index 55121b6..1f98dc3 100644 --- a/i386/include/mach/i386/mach_i386.defs +++ b/i386/include/mach/i386/mach_i386.defs @@ -66,3 +66,19 @@ routine i386_get_ldt( first_selector : int; selector_count : int; out desc_list : descriptor_list_t); + +/* Modify one of a few available thread-specific segment descriptor slots. + The SELECTOR must be a value from a previous call (on any thread), + or -1 to allocate an available slot and return the segment selector for it. + These slots are copied into the CPU on each thread switch. + Returns KERN_NO_SPACE when there are no more slots available. */ +routine i386_set_gdt( + target_thread : thread_t; + inout selector : int; + desc : descriptor_t); + +/* Fetch a segment descriptor set with a prior i386_set_gdt call. */ +routine i386_get_gdt( + target_thread : thread_t; + selector : int; + out desc : descriptor_t); -- cgit v1.2.3