00001
00002
00008
00009 #ifndef __L4_SYS__ARCH_X86__SEGMENT_H__
00010 #define __L4_SYS__ARCH_X86__SEGMENT_H__
00011
00012 #ifndef L4API_l4v2
00013 #error This header file can only be used with a L4API version!
00014 #endif
00015
00016 #include <l4/sys/types.h>
00017
00028 L4_INLINE void
00029 fiasco_ldt_set(void *ldt, unsigned int size,
00030 unsigned int entry_number_start, unsigned int task_nr);
00031
00043 L4_INLINE void
00044 fiasco_gdt_set(void *desc, unsigned int size,
00045 unsigned int entry_number_start, l4_threadid_t tid);
00046
00051 L4_INLINE unsigned
00052 fiasco_gdt_get_entry_offset(void);
00053
00054
00055
00056
00057
00058 L4_INLINE void
00059 fiasco_ldt_set(void *ldt, unsigned int size,
00060 unsigned int entry_number_start, unsigned int task_nr)
00061 {
00062 asm("lldt %%ax \n\t"
00063 :
00064 : "a" (ldt),
00065 "b" (size),
00066 "c" (entry_number_start),
00067 "d" (task_nr)
00068 );
00069 }
00070
00071 L4_INLINE unsigned
00072 fiasco_gdt_get_entry_offset(void)
00073 {
00074 unsigned offset;
00075
00076 asm volatile("lldt %%ax \n\t"
00077 : "=b" (offset)
00078 : "b" (0));
00079
00080 return offset;
00081 }
00082
00083 #endif