]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Fix the replacement mistake of xxx_thread_flag
authorHirofumi Ogawa <hirofumi@mail.parknet.co.jp>
Fri, 8 Feb 2002 04:48:11 +0000 (20:48 -0800)
committerLinus Torvalds <torvalds@home.transmeta.com>
Fri, 8 Feb 2002 04:48:11 +0000 (20:48 -0800)
    - fix the replacement mistake of xxx_thread_flag
    - fix the miss test of PT_PTRACED flag

OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

arch/i386/kernel/i387.c
arch/i386/kernel/ptrace.c
include/asm-i386/i387.h
include/asm-i386/thread_info.h

index 0732feda4780411c59043f6417b22d0a782dcdb7..a87a362c4e6a272a27fb3c1536529dfc4d04de47 100644 (file)
@@ -52,7 +52,7 @@ static inline void __save_init_fpu( struct task_struct *tsk )
                asm volatile( "fnsave %0 ; fwait"
                              : "=m" (tsk->thread.i387.fsave) );
        }
-       clear_thread_flag(TIF_USEDFPU);
+       clear_tsk_thread_flag(tsk, TIF_USEDFPU);
 }
 
 void save_init_fpu( struct task_struct *tsk )
@@ -63,10 +63,8 @@ void save_init_fpu( struct task_struct *tsk )
 
 void kernel_fpu_begin(void)
 {
-       struct task_struct *tsk = current;
-
        if (test_thread_flag(TIF_USEDFPU)) {
-               __save_init_fpu(tsk);
+               __save_init_fpu(current);
                return;
        }
        clts();
index a6573e39dd66ca8a1255ea3e2f2b2f28ece13bb3..4afb2afc64d3f585c727aef15237a834f53f3c90 100644 (file)
@@ -278,10 +278,10 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
                if ((unsigned long) data > _NSIG)
                        break;
                if (request == PTRACE_SYSCALL) {
-                       set_thread_flag(TIF_SYSCALL_TRACE);
+                       set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
                }
                else {
-                       clear_thread_flag(TIF_SYSCALL_TRACE);
+                       clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
                }
                child->exit_code = data;
        /* make sure the single step bit is not set. */
@@ -317,7 +317,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
                ret = -EIO;
                if ((unsigned long) data > _NSIG)
                        break;
-               clear_thread_flag(TIF_SYSCALL_TRACE);
+               clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
                if ((child->ptrace & PT_DTRACE) == 0) {
                        /* Spurious delayed TF traps may occur */
                        child->ptrace |= PT_DTRACE;
@@ -449,7 +449,7 @@ void do_syscall_trace(struct pt_regs *regs, int entryexit)
 {
        if (!test_thread_flag(TIF_SYSCALL_TRACE))
                return;
-       if (current->ptrace & PT_PTRACED)
+       if (!(current->ptrace & PT_PTRACED))
                return;
        /* the 0x80 provides a way for the tracing parent to distinguish
           between a syscall stop and SIGTRAP delivery */
index 3463340e44c780e64b4cdf01efb1374d133e3cfe..462ec5a234c5855635a5a15dce7aa0b99a621e35 100644 (file)
@@ -28,17 +28,17 @@ extern void kernel_fpu_begin(void);
 
 
 #define unlazy_fpu( tsk ) do { \
-       if (test_thread_flag(TIF_USEDFPU)) \
+       if (test_tsk_thread_flag(tsk, TIF_USEDFPU)) \
                save_init_fpu( tsk ); \
 } while (0)
 
-#define clear_fpu( tsk )                       \
-do {                                           \
-       if (test_thread_flag(TIF_USEDFPU)) {    \
-               asm volatile("fwait");          \
-               clear_thread_flag(TIF_USEDFPU); \
-               stts();                         \
-       }                                       \
+#define clear_fpu( tsk )                                       \
+do {                                                           \
+       if (test_tsk_thread_flag(tsk, TIF_USEDFPU)) {           \
+               asm volatile("fwait");                          \
+               clear_tsk_thread_flag(tsk, TIF_USEDFPU);        \
+               stts();                                         \
+       }                                                       \
 } while (0)
 
 /*
index bf834a2012f5c753487a96f94f985a0e4539fba7..0ce93f99f90c2ff2cc5f75866f5dea4754e1ec72 100644 (file)
@@ -73,8 +73,8 @@ static inline struct thread_info *current_thread_info(void)
 #define THREAD_SIZE (2*PAGE_SIZE)
 #define alloc_thread_info() ((struct thread_info *) __get_free_pages(GFP_KERNEL,1))
 #define free_thread_info(ti) free_pages((unsigned long) (ti), 1)
-#define get_thread_info(ti) get_task_struct((ti)->l_task)
-#define put_thread_info(ti) put_task_struct((ti)->l_task)
+#define get_thread_info(ti) get_task_struct((ti)->task)
+#define put_thread_info(ti) put_task_struct((ti)->task)
 
 #else /* !__ASSEMBLY__ */