From ef27d8bc4244e3e08cddd324ac5d27c9837f01ff Mon Sep 17 00:00:00 2001 From: Douglas Gilbert Date: Wed, 15 Aug 2018 10:35:47 -0500 Subject: HCODE Make divide using DERP/DORP atomic Change-Id: Ib7e1c88f7ac934ba551082f27231fff1bb3961dc CQ: SW443103 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/64570 Reviewed-by: RANGANATHPRASAD G. BRAHMASAMUDRA Reviewed-by: RAHUL BATRA Tested-by: Jenkins Server Tested-by: PPE CI Reviewed-by: Gregory S. Still Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/64578 Tested-by: FSP CI Jenkins Reviewed-by: Sachin Gupta --- src/import/chips/p9/procedures/ppe/pk/ppe42/math.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/import/chips/p9/procedures/ppe/pk/ppe42/math.c b/src/import/chips/p9/procedures/ppe/pk/ppe42/math.c index ba3b9ae3..7324da7a 100644 --- a/src/import/chips/p9/procedures/ppe/pk/ppe42/math.c +++ b/src/import/chips/p9/procedures/ppe/pk/ppe42/math.c @@ -5,7 +5,7 @@ /* */ /* OpenPOWER sbe Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016,2017 */ +/* Contributors Listed Below - COPYRIGHT 2016,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -23,6 +23,8 @@ /* */ /* IBM_PROLOG_END_TAG */ #include "ppe42math.h" +#include "ppe42_msr.h" +#include #ifdef __cplusplus extern "C" @@ -71,6 +73,8 @@ unsigned long udivmodsi4(unsigned long long _a, unsigned long _mod) { + uint32_t ctx = mfmsr(); + wrteei(0); out64(OCB_DERP, _a); do @@ -79,6 +83,8 @@ unsigned long udivmodsi4(unsigned long long _a, } while((~_a) == 0); + mtmsr(ctx); + if(_mod) { return (unsigned long)_a; -- cgit v1.2.1