Skip to content

Commit

Permalink
parisc: fix preempt_count() check in entry.S
Browse files Browse the repository at this point in the history
preempt_count in struct thread_info is unsigned int,
but the entry.S code used LDREG, which generates a 64 bit
load when compiled for 64 bit. Fix this to use an ldw and
also change the condition in the compare one line below
to only compares 32 bits, although ldw zero extends, and
that should work with a 64 bit compare.

Signed-off-by: Sven Schnelle <svens@stackframe.org>
Signed-off-by: Helge Deller <deller@gmx.de>
  • Loading branch information
svenschnelle authored and hdeller committed Oct 30, 2021
1 parent 4f19386 commit 3fb28e1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/parisc/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -974,8 +974,8 @@ intr_do_preempt:

/* current_thread_info()->preempt_count */
mfctl %cr30, %r1
LDREG TI_PRE_COUNT(%r1), %r19
cmpib,COND(<>) 0, %r19, intr_restore /* if preempt_count > 0 */
ldw TI_PRE_COUNT(%r1), %r19
cmpib,<> 0, %r19, intr_restore /* if preempt_count > 0 */
nop /* prev insn branched backwards */

/* check if we interrupted a critical path */
Expand Down

0 comments on commit 3fb28e1

Please sign in to comment.