2 * Copyright (C) 2004 Fujitsu Siemens Computers GmbH
3 * Licensed under the GPL
11 #include <linux/mutex.h>
14 #define LDT_PAGES_MAX \
15 ((LDT_ENTRIES * LDT_ENTRY_SIZE)/PAGE_SIZE)
16 #define LDT_ENTRIES_PER_PAGE \
17 (PAGE_SIZE/LDT_ENTRY_SIZE)
18 #define LDT_DIRECT_ENTRIES \
19 ((LDT_PAGES_MAX*sizeof(void *))/LDT_ENTRY_SIZE)
26 typedef struct uml_ldt {
30 struct ldt_entry * pages[LDT_PAGES_MAX];
31 struct ldt_entry entries[LDT_DIRECT_ENTRIES];
35 #define LDT_entry_a(info) \
36 ((((info)->base_addr & 0x0000ffff) << 16) | ((info)->limit & 0x0ffff))
38 #define LDT_entry_b(info) \
39 (((info)->base_addr & 0xff000000) | \
40 (((info)->base_addr & 0x00ff0000) >> 16) | \
41 ((info)->limit & 0xf0000) | \
42 (((info)->read_exec_only ^ 1) << 9) | \
43 ((info)->contents << 10) | \
44 (((info)->seg_not_present ^ 1) << 15) | \
45 ((info)->seg_32bit << 22) | \
46 ((info)->limit_in_pages << 23) | \
47 ((info)->useable << 20) | \
50 #define _LDT_empty(info) (\
51 (info)->base_addr == 0 && \
52 (info)->limit == 0 && \
53 (info)->contents == 0 && \
54 (info)->read_exec_only == 1 && \
55 (info)->seg_32bit == 0 && \
56 (info)->limit_in_pages == 0 && \
57 (info)->seg_not_present == 1 && \
58 (info)->useable == 0 )
61 #define LDT_empty(info) (_LDT_empty(info) && ((info)->lm == 0))
63 #define LDT_empty(info) (_LDT_empty(info))
66 struct uml_arch_mm_context {