Commit 5acf5ff0 authored by Paul Mackerras's avatar Paul Mackerras

PPC32: Fix preempt bugs identified by Milton Miller.

parent 8a865f4a
...@@ -507,7 +507,7 @@ ret_from_except: ...@@ -507,7 +507,7 @@ ret_from_except:
MTMSRD(r10) /* disable interrupts */ MTMSRD(r10) /* disable interrupts */
lwz r3,_MSR(r1) /* Returning to user mode? */ lwz r3,_MSR(r1) /* Returning to user mode? */
andi. r3,r3,MSR_PR andi. r0,r3,MSR_PR
beq resume_kernel beq resume_kernel
user_exc_return: /* r10 contains MSR_KERNEL here */ user_exc_return: /* r10 contains MSR_KERNEL here */
...@@ -528,6 +528,7 @@ restore_user: ...@@ -528,6 +528,7 @@ restore_user:
#ifdef CONFIG_PREEMPT #ifdef CONFIG_PREEMPT
b restore b restore
/* N.B. the only way to get here is from the beq following ret_from_except. */
resume_kernel: resume_kernel:
/* check current_thread_info->preempt_count */ /* check current_thread_info->preempt_count */
rlwinm r9,r1,0,0,18 rlwinm r9,r1,0,0,18
...@@ -549,8 +550,10 @@ resume_kernel: ...@@ -549,8 +550,10 @@ resume_kernel:
SYNC SYNC
MTMSRD(r10) /* disable interrupts */ MTMSRD(r10) /* disable interrupts */
rlwinm r9,r1,0,0,18 rlwinm r9,r1,0,0,18
lwz r0,TI_FLAGS(r9) li r0,0
andi. r0,r0,_TIF_NEED_RESCHED stw r0,TI_PREEMPT(r9)
lwz r3,TI_FLAGS(r9)
andi. r0,r3,_TIF_NEED_RESCHED
bne- 1b bne- 1b
#else #else
resume_kernel: resume_kernel:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment