aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/desc.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-x86/desc.h')
-rw-r--r--include/asm-x86/desc.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/include/asm-x86/desc.h b/include/asm-x86/desc.h
index 6065c5092265..47086d2d9298 100644
--- a/include/asm-x86/desc.h
+++ b/include/asm-x86/desc.h
@@ -1,5 +1,34 @@
1#ifndef _ASM_DESC_H_
2#define _ASM_DESC_H_
3
4#ifndef __ASSEMBLY__
5#include <asm/desc_defs.h>
6#include <asm/ldt.h>
7
8static inline void fill_ldt(struct desc_struct *desc, struct user_desc *info)
9{
10 desc->limit0 = info->limit & 0x0ffff;
11 desc->base0 = info->base_addr & 0x0000ffff;
12
13 desc->base1 = (info->base_addr & 0x00ff0000) >> 16;
14 desc->type = (info->read_exec_only ^ 1) << 1;
15 desc->type |= info->contents << 2;
16 desc->s = 1;
17 desc->dpl = 0x3;
18 desc->p = info->seg_not_present ^ 1;
19 desc->limit = (info->limit & 0xf0000) >> 16;
20 desc->avl = info->useable;
21 desc->d = info->seg_32bit;
22 desc->g = info->limit_in_pages;
23 desc->base2 = (info->base_addr & 0xff000000) >> 24;
24}
25
26#endif
27
1#ifdef CONFIG_X86_32 28#ifdef CONFIG_X86_32
2# include "desc_32.h" 29# include "desc_32.h"
3#else 30#else
4# include "desc_64.h" 31# include "desc_64.h"
5#endif 32#endif
33
34#endif