diff options
Diffstat (limited to 'xenolinux-2.4.24-sparse/include/asm-xeno/desc.h')
-rw-r--r-- | xenolinux-2.4.24-sparse/include/asm-xeno/desc.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/xenolinux-2.4.24-sparse/include/asm-xeno/desc.h b/xenolinux-2.4.24-sparse/include/asm-xeno/desc.h new file mode 100644 index 0000000000..545b7f8256 --- /dev/null +++ b/xenolinux-2.4.24-sparse/include/asm-xeno/desc.h @@ -0,0 +1,41 @@ +#ifndef __ARCH_DESC_H +#define __ARCH_DESC_H + +#include <asm/ldt.h> + +#ifndef __ASSEMBLY__ + +struct desc_struct { + unsigned long a,b; +}; + +struct Xgt_desc_struct { + unsigned short size; + unsigned long address __attribute__((packed)); +}; + +extern struct desc_struct default_ldt[]; + +static inline void clear_LDT(void) +{ + /* + * NB. We load the default_ldt for lcall7/27 handling on demand, as + * it slows down context switching. Noone uses it anyway. + */ + queue_set_ldt(0, 0); +} + +static inline void load_LDT(struct mm_struct *mm) +{ + void *segments = mm->context.segments; + int count = 0; + + if ( unlikely(segments != NULL) ) + count = LDT_ENTRIES; + + queue_set_ldt((unsigned long)segments, count); +} + +#endif /* __ASSEMBLY__ */ + +#endif /* __ARCH_DESC_H__ */ |