1 2 #ifndef __ARCH_LDT_H 3 #define __ARCH_LDT_H 4 5 #ifndef __ASSEMBLY__ 6 load_LDT(struct vcpu * v)7static inline void load_LDT(struct vcpu *v) 8 { 9 seg_desc_t *desc; 10 unsigned long ents; 11 12 if ( (ents = v->arch.pv.ldt_ents) == 0 ) 13 lldt(0); 14 else 15 { 16 desc = (!is_pv_32bit_vcpu(v) ? this_cpu(gdt) : this_cpu(compat_gdt)) 17 + LDT_ENTRY - FIRST_RESERVED_GDT_ENTRY; 18 _set_tssldt_desc(desc, LDT_VIRT_START(v), ents*8-1, SYS_DESC_ldt); 19 lldt(LDT_SELECTOR); 20 } 21 } 22 23 #endif /* !__ASSEMBLY__ */ 24 25 #endif 26 27 /* 28 * Local variables: 29 * mode: C 30 * c-file-style: "BSD" 31 * c-basic-offset: 4 32 * tab-width: 4 33 * indent-tabs-mode: nil 34 * End: 35 */ 36