aboutsummaryrefslogtreecommitdiffstats
path: root/linux-2.4-xen-sparse/include/asm-xen/desc.h
blob: b59b998d951909b0cdd60bce2bbf3667c60f68b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#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)
{
    xen_set_ldt(0, 0);
}

static inline void load_LDT(mm_context_t *pc)
{
    void *segments = pc->ldt;
    int count = pc->size;
    
    if ( count == 0 )
        segments = NULL;
    
    xen_set_ldt((unsigned long)segments, count);               
}

#endif /* __ASSEMBLY__ */

#endif /* __ARCH_DESC_H__ */