Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5af725026fe902bf81f1b90b1b9d9ee4b9e1eb6a
Commit:     5af725026fe902bf81f1b90b1b9d9ee4b9e1eb6a
Parent:     25deca53e9b74a899efd3ae1f4493f4f2ce36846
Author:     Glauber de Oliveira Costa <[EMAIL PROTECTED]>
AuthorDate: Wed Jan 30 13:31:13 2008 +0100
Committer:  Ingo Molnar <[EMAIL PROTECTED]>
CommitDate: Wed Jan 30 13:31:13 2008 +0100

    x86: modify write_ldt function
    
    This patch modifies the write_ldt() function to make use
    of the new struct desc_struct instead of entry_1 and entry_2
    entries
    
    Signed-off-by: Glauber de Oliveira Costa <[EMAIL PROTECTED]>
    Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
    Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>
---
 arch/x86/kernel/ldt.c |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/arch/x86/kernel/ldt.c b/arch/x86/kernel/ldt.c
index a8cdca3..7eb0c8a 100644
--- a/arch/x86/kernel/ldt.c
+++ b/arch/x86/kernel/ldt.c
@@ -186,7 +186,7 @@ static int read_default_ldt(void __user *ptr, unsigned long 
bytecount)
 static int write_ldt(void __user *ptr, unsigned long bytecount, int oldmode)
 {
        struct mm_struct *mm = current->mm;
-       __u32 entry_1, entry_2;
+       struct desc_struct ldt;
        int error;
        struct user_desc ldt_info;
 
@@ -218,21 +218,20 @@ static int write_ldt(void __user *ptr, unsigned long 
bytecount, int oldmode)
        /* Allow LDTs to be cleared by the user. */
        if (ldt_info.base_addr == 0 && ldt_info.limit == 0) {
                if (oldmode || LDT_empty(&ldt_info)) {
-                       entry_1 = 0;
-                       entry_2 = 0;
+                       memset(&ldt, 0, sizeof(ldt));
                        goto install;
                }
        }
 
-       entry_1 = LDT_entry_a(&ldt_info);
-       entry_2 = LDT_entry_b(&ldt_info);
+       ldt.a = LDT_entry_a(&ldt_info);
+       ldt.b = LDT_entry_b(&ldt_info);
        if (oldmode)
-               entry_2 &= ~(1 << 20);
+               ldt.avl = 0;
 
        /* Install the new entry ...  */
 install:
-       write_ldt_entry(mm->context.ldt, ldt_info.entry_number, entry_1,
-                       entry_2);
+       write_ldt_entry(mm->context.ldt, ldt_info.entry_number,
+                       ldt.a, ldt.b);
        error = 0;
 
 out_unlock:
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to