summaryrefslogtreecommitdiffstats
path: root/libpore
diff options
context:
space:
mode:
authorStewart Smith <stewart@linux.vnet.ibm.com>2018-01-24 17:19:43 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2018-01-24 17:19:52 +1100
commit28b94285ba3a8c905c00f8b2c73e150bb88399c0 (patch)
treecaae2623cd94ad969c1f061ee9000a8024d3d118 /libpore
parent43eb8bbcbaa5b4c01305b51b061ddd98e75efcae (diff)
downloadblackbird-skiboot-28b94285ba3a8c905c00f8b2c73e150bb88399c0.tar.gz
blackbird-skiboot-28b94285ba3a8c905c00f8b2c73e150bb88399c0.zip
Revert "libpore: Fix incorrect mtspr instruction generation"
This reverts commit 65f9abea8e8cfd7f711a5c54217b5505826ff497. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'libpore')
-rw-r--r--libpore/p9_stop_api.C10
1 files changed, 6 insertions, 4 deletions
diff --git a/libpore/p9_stop_api.C b/libpore/p9_stop_api.C
index cbbdfdd5..7242c423 100644
--- a/libpore/p9_stop_api.C
+++ b/libpore/p9_stop_api.C
@@ -255,10 +255,12 @@ static uint32_t getOrisInstruction( const uint16_t i_Rs, const uint16_t i_Ra,
*/
static uint32_t getMtsprInstruction( const uint16_t i_Rs, const uint16_t i_Spr )
{
- uint32_t mtsprInstOpcode = MTSPR_BASE_OPCODE;
- uint32_t temp = ((i_Spr & 0x1F) << 5) | ((i_Spr & 0x8F) >> 5);
-
- mtsprInstOpcode |= ((i_Rs & 0x1F) << 21) | ((temp & 0x03FF) << 11);
+ uint32_t mtsprInstOpcode = 0;
+ uint32_t temp = (( i_Spr & 0x03FF ) << 11);
+ mtsprInstOpcode = (uint8_t)i_Rs << 21;
+ mtsprInstOpcode = ( temp & 0x0000F800 ) << 5;
+ mtsprInstOpcode |= ( temp & 0x001F0000 ) >> 5;
+ mtsprInstOpcode |= MTSPR_BASE_OPCODE;
return SWIZZLE_4_BYTE(mtsprInstOpcode);
}
OpenPOWER on IntegriCloud