diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2011-08-18 15:10:49 -0400 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2011-11-02 09:15:21 -0400 |
commit | b3ee571e58120de30c3d15657022bf2c72477e02 (patch) | |
tree | 502d0b09799fb32d4ebd39abda15c48e697367d0 /arch/x86/um/asm | |
parent | f67aa2ffb7ce2f6d88e2e7a8069309dc2627932e (diff) |
um: take ldt.h to arch/x86/um/asm/mm_context.h
it's x86-only and we have no business playing with it in asm/mmu.h; make
the latter have
struct uml_arch_mm_context arch;
instead of
struct uml_ldt ldt;
and let arch/<subarch>/um/asm/mm_context.h decide what'll be in there.
While we are at it, kill host_ldt.h - it's not needed in part of places
that include it (we want asm/ldt.h in those) and it can be trivially
expanded into the single remaining one.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/x86/um/asm')
-rw-r--r-- | arch/x86/um/asm/mm_context.h | 72 | ||||
-rw-r--r-- | arch/x86/um/asm/processor_32.h | 2 |
2 files changed, 73 insertions, 1 deletions
diff --git a/arch/x86/um/asm/mm_context.h b/arch/x86/um/asm/mm_context.h new file mode 100644 index 000000000000..4a73d63e4760 --- /dev/null +++ b/arch/x86/um/asm/mm_context.h | |||
@@ -0,0 +1,72 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2004 Fujitsu Siemens Computers GmbH | ||
3 | * Licensed under the GPL | ||
4 | * | ||
5 | * Author: Bodo Stroesser <bstroesser@fujitsu-siemens.com> | ||
6 | */ | ||
7 | |||
8 | #ifndef __ASM_LDT_H | ||
9 | #define __ASM_LDT_H | ||
10 | |||
11 | #include <linux/mutex.h> | ||
12 | #include <asm/ldt.h> | ||
13 | |||
14 | extern void ldt_host_info(void); | ||
15 | |||
16 | #define LDT_PAGES_MAX \ | ||
17 | ((LDT_ENTRIES * LDT_ENTRY_SIZE)/PAGE_SIZE) | ||
18 | #define LDT_ENTRIES_PER_PAGE \ | ||
19 | (PAGE_SIZE/LDT_ENTRY_SIZE) | ||
20 | #define LDT_DIRECT_ENTRIES \ | ||
21 | ((LDT_PAGES_MAX*sizeof(void *))/LDT_ENTRY_SIZE) | ||
22 | |||
23 | struct ldt_entry { | ||
24 | __u32 a; | ||
25 | __u32 b; | ||
26 | }; | ||
27 | |||
28 | typedef struct uml_ldt { | ||
29 | int entry_count; | ||
30 | struct mutex lock; | ||
31 | union { | ||
32 | struct ldt_entry * pages[LDT_PAGES_MAX]; | ||
33 | struct ldt_entry entries[LDT_DIRECT_ENTRIES]; | ||
34 | } u; | ||
35 | } uml_ldt_t; | ||
36 | |||
37 | #define LDT_entry_a(info) \ | ||
38 | ((((info)->base_addr & 0x0000ffff) << 16) | ((info)->limit & 0x0ffff)) | ||
39 | |||
40 | #define LDT_entry_b(info) \ | ||
41 | (((info)->base_addr & 0xff000000) | \ | ||
42 | (((info)->base_addr & 0x00ff0000) >> 16) | \ | ||
43 | ((info)->limit & 0xf0000) | \ | ||
44 | (((info)->read_exec_only ^ 1) << 9) | \ | ||
45 | ((info)->contents << 10) | \ | ||
46 | (((info)->seg_not_present ^ 1) << 15) | \ | ||
47 | ((info)->seg_32bit << 22) | \ | ||
48 | ((info)->limit_in_pages << 23) | \ | ||
49 | ((info)->useable << 20) | \ | ||
50 | 0x7000) | ||
51 | |||
52 | #define _LDT_empty(info) (\ | ||
53 | (info)->base_addr == 0 && \ | ||
54 | (info)->limit == 0 && \ | ||
55 | (info)->contents == 0 && \ | ||
56 | (info)->read_exec_only == 1 && \ | ||
57 | (info)->seg_32bit == 0 && \ | ||
58 | (info)->limit_in_pages == 0 && \ | ||
59 | (info)->seg_not_present == 1 && \ | ||
60 | (info)->useable == 0 ) | ||
61 | |||
62 | #ifdef CONFIG_X86_64 | ||
63 | #define LDT_empty(info) (_LDT_empty(info) && ((info)->lm == 0)) | ||
64 | #else | ||
65 | #define LDT_empty(info) (_LDT_empty(info)) | ||
66 | #endif | ||
67 | |||
68 | struct uml_arch_mm_context { | ||
69 | uml_ldt_t ldt; | ||
70 | }; | ||
71 | |||
72 | #endif | ||
diff --git a/arch/x86/um/asm/processor_32.h b/arch/x86/um/asm/processor_32.h index e5b72faea0f6..c4078b581df1 100644 --- a/arch/x86/um/asm/processor_32.h +++ b/arch/x86/um/asm/processor_32.h | |||
@@ -7,8 +7,8 @@ | |||
7 | #define __UM_PROCESSOR_I386_H | 7 | #define __UM_PROCESSOR_I386_H |
8 | 8 | ||
9 | #include <linux/string.h> | 9 | #include <linux/string.h> |
10 | #include <sysdep/host_ldt.h> | ||
11 | #include <asm/segment.h> | 10 | #include <asm/segment.h> |
11 | #include <asm/ldt.h> | ||
12 | 12 | ||
13 | extern int host_has_cmov; | 13 | extern int host_has_cmov; |
14 | 14 | ||