summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@us.ibm.com>2018-08-15 10:35:47 -0500
committerhostboot <hostboot@us.ibm.com>2018-08-24 10:38:53 -0500
commited9af7a1773372c55322c5fc39d7e12571aa9936 (patch)
tree782f8588ae41cbc4dbdbe51e3394415a70d4b07d
parent6e6e58f5455895fb97ffda55d4914c3a19c9c5ca (diff)
downloadtalos-hcode-ed9af7a1773372c55322c5fc39d7e12571aa9936.tar.gz
talos-hcode-ed9af7a1773372c55322c5fc39d7e12571aa9936.zip
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 <prasadbgr@in.ibm.com> Reviewed-by: RAHUL BATRA <rbatra@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com> Reviewed-by: Gregory S. Still <stillgs@us.ibm.com>
-rw-r--r--import/chips/p9/procedures/ppe/pk/ppe42/math.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/import/chips/p9/procedures/ppe/pk/ppe42/math.c b/import/chips/p9/procedures/ppe/pk/ppe42/math.c
index d6bd329c..b5d038b8 100644
--- a/import/chips/p9/procedures/ppe/pk/ppe42/math.c
+++ b/import/chips/p9/procedures/ppe/pk/ppe42/math.c
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HCODE Project */
/* */
-/* COPYRIGHT 2016,2017 */
+/* COPYRIGHT 2016,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -23,6 +23,8 @@
/* */
/* IBM_PROLOG_END_TAG */
#include "ppe42math.h"
+#include "ppe42_msr.h"
+#include <stdint.h>
#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;
OpenPOWER on IntegriCloud