From 8ea98ac6482a3c0fa2bee57b558fefe79b04db7e Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Mon, 5 Jan 2009 02:43:00 +0000 Subject: 2009-01-05 Samuel Thibault * 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. --- i386/i386/gdt.c | 4 ++++ i386/i386/gdt.h | 2 +- i386/i386/proc_reg.h | 6 +++--- i386/intel/pmap.c | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) (limited to 'i386') 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); \ } -- cgit v1.2.3