Gabe Black has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/34167 )

Change subject: sparc,sim: Remove special handling of SPARC in the clone system call.
......................................................................

sparc,sim: Remove special handling of SPARC in the clone system call.

We can set the extra syscall return values in the ISA specific archClone
function. We don't need a special #ifdef to handle them.

Change-Id: I82904b3d4bdf211c89d271d7277a60151191cdfc
---
M src/arch/sparc/linux/linux.hh
M src/sim/syscall_emul.hh
2 files changed, 5 insertions(+), 5 deletions(-)



diff --git a/src/arch/sparc/linux/linux.hh b/src/arch/sparc/linux/linux.hh
index 89cd207..3b5aea8 100644
--- a/src/arch/sparc/linux/linux.hh
+++ b/src/arch/sparc/linux/linux.hh
@@ -230,6 +230,11 @@

         if (stack)
             ctc->setIntReg(SparcISA::StackPointerReg, stack);
+
+        // Set these extra values. Since "clone" doesn't return two values,
+        // we can set these and they won't be clobbered by the syscall ABI.
+        ptc->setIntReg(SparcISA::SyscallPseudoReturnReg, 0);
+        ctc->setIntReg(SparcISA::SyscallPseudoReturnReg, 1);
     }
 };

diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh
index 05a29f9..9d1f6e2 100644
--- a/src/sim/syscall_emul.hh
+++ b/src/sim/syscall_emul.hh
@@ -1506,11 +1506,6 @@

     desc->returnInto(ctc, 0);

-#if THE_ISA == SPARC_ISA
-    tc->setIntReg(TheISA::SyscallPseudoReturnReg, 0);
-    ctc->setIntReg(TheISA::SyscallPseudoReturnReg, 1);
-#endif
-
     TheISA::PCState cpc = tc->pcState();
     if (!p->kvmInSE)
         cpc.advance();

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/34167
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I82904b3d4bdf211c89d271d7277a60151191cdfc
Gerrit-Change-Number: 34167
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <gabebl...@google.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to