Skip to content

Commit

Permalink
kernel: Fix cmp in shutdown.S for modern binutils
Browse files Browse the repository at this point in the history
This is a further fix that was missed in 10983d3 ("Convert cmpi to
cmpwi to fix build for modern binutils").

In the past binutils would assume 'cmp' meant 'cmpw'. Modern binutils
require the explict use of cmpw or cmpd.

The first two instances are dealing with SPRs, which are 32-bit, so cmpw
is correct.

It is not clear what to do in the third use of cmp, but given old toolchains
have generated cmpw lets assume that we should maintain the behaviour.

Change-Id: Iee5dd5903dcd7ac4028bab0176e08ce3db23b2d5
Signed-off-by: Joel Stanley <joel.stanley@au1.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/42476
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
Joel Stanley authored and dcrowell77 committed Jun 28, 2017
1 parent 0ffbb55 commit f2250d8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/kernel/shutdown.S
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
# OpenPOWER HostBoot Project
#
# Contributors Listed Below - COPYRIGHT 2012,2016
# Contributors Listed Below - COPYRIGHT 2012,2017
# [+] International Business Machines Corp.
#
#
Expand Down Expand Up @@ -94,7 +94,7 @@ kernel_shutdown_ea0_1_mode:
;// as it was the one that updated the cpu_count & lowest_pir
;// barrier - 1 wait for all nodes to report
mfspr r10, PIR
cmp cr0, r10, r7
cmpw cr0, r10, r7
bne+ 2f ;// inside KERNEL_BARRIER below

;// Perform barrier - 1
Expand Down Expand Up @@ -132,7 +132,7 @@ kernel_shutdown_ea0_1_mode:
addi r8, r8, 8
;// Check for PIR == r7.
mfspr r10, PIR
cmp cr0, r10, r7
cmpw cr0, r10, r7
beq 3f
;// Increment thread count.
1:
Expand Down Expand Up @@ -165,7 +165,7 @@ kernel_shutdown_ea0_1_mode:
1:
or 1,1,1
ld r11, 0(r8)
cmp cr0, r3, r11
cmpw cr0, r3, r11
bne+ 1b
isync
;// All other threads have left, so wait a little bit...
Expand Down

0 comments on commit f2250d8

Please sign in to comment.