summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog10
-rw-r--r--i386/i386/gdt.c4
-rw-r--r--i386/i386/gdt.h2
-rw-r--r--i386/i386/proc_reg.h6
-rw-r--r--i386/intel/pmap.c2
5 files changed, 19 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index b49b4c9..cf4cb4b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2009-01-05 Samuel Thibault <samuel.thibault@ens-lyon.org>
+
+ * i386/i386/gdt.h (LINEAR_DS): New macro.
+ * i386/i386/gdt.c (gdt_init): Initialize LINEAR_DS descriptor.
+ * i386/i386/proc_reg.h (invlpg_user): Rename macro into...
+ (invlpg_linear): ... this. Use movw instead of movl to set KERNEL_DS
+ selector. Use LINEAR_DS selector instead of USER_DS selector.
+ * i386/intel/pmap.c (INVALIDATE_TLB): Call invlpg_linear instead of
+ invlpg_user.
+
2008-12-30 Samuel Thibault <samuel.thibault@ens-lyon.org>
* i386/i386/proc_reg.h [__ASSEMBLER__ && __GNUC__]: Include
diff --git a/i386/i386/gdt.c b/i386/i386/gdt.c
index 9438ee1..8484073 100644
--- a/i386/i386/gdt.c
+++ b/i386/i386/gdt.c
@@ -50,6 +50,10 @@ gdt_init()
LINEAR_MIN_KERNEL_ADDRESS,
LINEAR_MAX_KERNEL_ADDRESS - LINEAR_MIN_KERNEL_ADDRESS - 1,
ACC_PL_K|ACC_DATA_W, SZ_32);
+ fill_gdt_descriptor(LINEAR_DS,
+ 0,
+ 0xffffffff,
+ ACC_PL_K|ACC_DATA_W, SZ_32);
/* Load the new GDT. */
{
diff --git a/i386/i386/gdt.h b/i386/i386/gdt.h
index 6513eda..9b58427 100644
--- a/i386/i386/gdt.h
+++ b/i386/i386/gdt.h
@@ -45,7 +45,7 @@
#define USER_LDT 0x28 /* place for per-thread LDT */
#define USER_TSS 0x30 /* place for per-thread TSS
that holds IO bitmap */
-/* 0x38 was FPE_CS, now free */
+#define LINEAR_DS 0x38 /* linear mapping */
/* 0x40 was USER_FPREGS, now free */
#define USER_GDT 0x48 /* user-defined GDT entries */
diff --git a/i386/i386/proc_reg.h b/i386/i386/proc_reg.h
index f6c2e8f..11a21cf 100644
--- a/i386/i386/proc_reg.h
+++ b/i386/i386/proc_reg.h
@@ -142,7 +142,7 @@ set_eflags(unsigned eflags)
asm volatile("invlpg (%0)" : : "r" (addr)); \
})
-#define invlpg_user(start, end) \
+#define invlpg_linear(start, end) \
({ \
register unsigned long var = trunc_page(start); \
asm volatile( \
@@ -151,9 +151,9 @@ set_eflags(unsigned eflags)
"\taddl %c4,%0\n" \
"\tcmpl %0,%1\n" \
"\tjb 1b\n" \
- "\tmovl %w3,%%es" \
+ "\tmovw %w3,%%es" \
: "+r" (var) : "r" (end), \
- "q" (USER_DS), "q" (KERNEL_DS), "i" (PAGE_SIZE)); \
+ "q" (LINEAR_DS), "q" (KERNEL_DS), "i" (PAGE_SIZE)); \
})
#define get_cr4() \
diff --git a/i386/intel/pmap.c b/i386/intel/pmap.c
index f1813b0..7ce3fb3 100644
--- a/i386/intel/pmap.c
+++ b/i386/intel/pmap.c
@@ -335,7 +335,7 @@ lock_data_t pmap_system_lock;
if (((e) - (s)) > 32 * PAGE_SIZE) \
flush_tlb(); \
else \
- invlpg_user(s, e); \
+ invlpg_linear(s, e); \
}