changeset e5b6f1157be3 in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=e5b6f1157be3
description:
        GetArgument: Rework getArgument so that X86_FS compiles again.

        When no size is specified for an argument, push the decision about what 
size
        to use into the ISA by passing a size of -1.

diffstat:

 src/arch/alpha/utility.cc |  2 +-
 src/arch/alpha/utility.hh |  2 +-
 src/arch/arm/utility.cc   |  7 ++++++-
 src/arch/arm/utility.hh   |  2 +-
 src/arch/mips/utility.cc  |  2 +-
 src/arch/mips/utility.hh  |  2 +-
 src/arch/sparc/utility.cc |  4 +++-
 src/arch/sparc/utility.hh |  3 ++-
 src/arch/x86/utility.cc   |  4 +++-
 src/arch/x86/utility.hh   |  3 ++-
 src/sim/arguments.cc      |  2 +-
 src/sim/arguments.hh      |  6 +++---
 12 files changed, 25 insertions(+), 14 deletions(-)

diffs (181 lines):

diff -r a7cb52c76262 -r e5b6f1157be3 src/arch/alpha/utility.cc
--- a/src/arch/alpha/utility.cc Thu Oct 14 14:02:23 2010 -0700
+++ b/src/arch/alpha/utility.cc Fri Oct 15 23:57:06 2010 -0700
@@ -40,7 +40,7 @@
 namespace AlphaISA {
 
 uint64_t
-getArgument(ThreadContext *tc, int &number, uint8_t size, bool fp)
+getArgument(ThreadContext *tc, int &number, uint16_t size, bool fp)
 {
 #if FULL_SYSTEM
     const int NumArgumentRegs = 6;
diff -r a7cb52c76262 -r e5b6f1157be3 src/arch/alpha/utility.hh
--- a/src/arch/alpha/utility.hh Thu Oct 14 14:02:23 2010 -0700
+++ b/src/arch/alpha/utility.hh Fri Oct 15 23:57:06 2010 -0700
@@ -41,7 +41,7 @@
 
 namespace AlphaISA {
 
-uint64_t getArgument(ThreadContext *tc, int &number, uint8_t size,  bool fp);
+uint64_t getArgument(ThreadContext *tc, int &number, uint16_t size, bool fp);
 
 inline bool
 inUserMode(ThreadContext *tc)
diff -r a7cb52c76262 -r e5b6f1157be3 src/arch/arm/utility.cc
--- a/src/arch/arm/utility.cc   Thu Oct 14 14:02:23 2010 -0700
+++ b/src/arch/arm/utility.cc   Fri Oct 15 23:57:06 2010 -0700
@@ -39,6 +39,7 @@
 
 
 #include "arch/arm/faults.hh"
+#include "arch/arm/isa_traits.hh"
 #include "arch/arm/utility.hh"
 #include "cpu/thread_context.hh"
 
@@ -61,8 +62,12 @@
         reset->invoke(tc);
 }
 
-uint64_t getArgument(ThreadContext *tc, int &number, uint8_t size, bool fp) {
+uint64_t
+getArgument(ThreadContext *tc, int &number, uint16_t size, bool fp)
+{
 #if FULL_SYSTEM
+    if (size == (uint16_t)(-1))
+        size = ArmISA::MachineBytes;
     if (fp)
         panic("getArgument(): Floating point arguments not implemented\n");
 
diff -r a7cb52c76262 -r e5b6f1157be3 src/arch/arm/utility.hh
--- a/src/arch/arm/utility.hh   Thu Oct 14 14:02:23 2010 -0700
+++ b/src/arch/arm/utility.hh   Fri Oct 15 23:57:06 2010 -0700
@@ -156,7 +156,7 @@
         return !cpacr.asedis && vfpEnabled(cpacr, cpsr, fpexc);
     }
 
-uint64_t getArgument(ThreadContext *tc, int &number, uint8_t size, bool fp);
+uint64_t getArgument(ThreadContext *tc, int &number, uint16_t size, bool fp);
     
 Fault setCp15Register(uint32_t &Rd, int CRn, int opc1, int CRm, int opc2);
 Fault readCp15Register(uint32_t &Rd, int CRn, int opc1, int CRm, int opc2);
diff -r a7cb52c76262 -r e5b6f1157be3 src/arch/mips/utility.cc
--- a/src/arch/mips/utility.cc  Thu Oct 14 14:02:23 2010 -0700
+++ b/src/arch/mips/utility.cc  Fri Oct 15 23:57:06 2010 -0700
@@ -52,7 +52,7 @@
 namespace MipsISA {
 
 uint64_t
-getArgument(ThreadContext *tc, int &number, uint8_t size, bool fp)
+getArgument(ThreadContext *tc, int &number, uint16_t size, bool fp)
 {
 #if FULL_SYSTEM
     if (number < 4) {
diff -r a7cb52c76262 -r e5b6f1157be3 src/arch/mips/utility.hh
--- a/src/arch/mips/utility.hh  Thu Oct 14 14:02:23 2010 -0700
+++ b/src/arch/mips/utility.hh  Fri Oct 15 23:57:06 2010 -0700
@@ -45,7 +45,7 @@
 
 namespace MipsISA {
 
-uint64_t getArgument(ThreadContext *tc, int &number, uint8_t size, bool fp);
+uint64_t getArgument(ThreadContext *tc, int &number, uint16_t size, bool fp);
 
 ////////////////////////////////////////////////////////////////////////
 //
diff -r a7cb52c76262 -r e5b6f1157be3 src/arch/sparc/utility.cc
--- a/src/arch/sparc/utility.cc Thu Oct 14 14:02:23 2010 -0700
+++ b/src/arch/sparc/utility.cc Fri Oct 15 23:57:06 2010 -0700
@@ -45,7 +45,9 @@
 //the sixth are passed on the stack past the 16 word window save area,
 //space for the struct/union return pointer, and space reserved for the
 //first 6 arguments which the caller may use but doesn't have to.
-uint64_t getArgument(ThreadContext *tc, int &number, uint8_t size, bool fp) {
+uint64_t
+getArgument(ThreadContext *tc, int &number, uint16_t size, bool fp)
+{
 #if FULL_SYSTEM
     const int NumArgumentRegs = 6;
     if (number < NumArgumentRegs) {
diff -r a7cb52c76262 -r e5b6f1157be3 src/arch/sparc/utility.hh
--- a/src/arch/sparc/utility.hh Thu Oct 14 14:02:23 2010 -0700
+++ b/src/arch/sparc/utility.hh Fri Oct 15 23:57:06 2010 -0700
@@ -41,7 +41,8 @@
 
 namespace SparcISA
 {
-    uint64_t getArgument(ThreadContext *tc, int &number, uint8_t size, bool 
fp);
+    uint64_t
+    getArgument(ThreadContext *tc, int &number, uint16_t size, bool fp);
 
     static inline bool
     inUserMode(ThreadContext *tc)
diff -r a7cb52c76262 -r e5b6f1157be3 src/arch/x86/utility.cc
--- a/src/arch/x86/utility.cc   Thu Oct 14 14:02:23 2010 -0700
+++ b/src/arch/x86/utility.cc   Fri Oct 15 23:57:06 2010 -0700
@@ -52,7 +52,9 @@
 
 namespace X86ISA {
 
-uint64_t getArgument(ThreadContext *tc, int &number, uint8_t size, bool fp) {
+uint64_t
+getArgument(ThreadContext *tc, int &number, uint16_t size, bool fp)
+{
 #if FULL_SYSTEM
     panic("getArgument() not implemented for x86!\n");
 #else
diff -r a7cb52c76262 -r e5b6f1157be3 src/arch/x86/utility.hh
--- a/src/arch/x86/utility.hh   Thu Oct 14 14:02:23 2010 -0700
+++ b/src/arch/x86/utility.hh   Fri Oct 15 23:57:06 2010 -0700
@@ -52,7 +52,8 @@
 
 namespace X86ISA
 {
-    uint64_t getArgument(ThreadContext *tc, int &number, uint8_t size, bool 
fp);
+    uint64_t
+    getArgument(ThreadContext *tc, int &number, uint16_t size, bool fp);
 
     static inline bool
     inUserMode(ThreadContext *tc)
diff -r a7cb52c76262 -r e5b6f1157be3 src/sim/arguments.cc
--- a/src/sim/arguments.cc      Thu Oct 14 14:02:23 2010 -0700
+++ b/src/sim/arguments.cc      Fri Oct 15 23:57:06 2010 -0700
@@ -50,7 +50,7 @@
 }
 
 uint64_t
-Arguments::getArg(uint8_t size, bool fp)
+Arguments::getArg(uint16_t size, bool fp)
 {
     return TheISA::getArgument(tc, number, size, fp);
 }
diff -r a7cb52c76262 -r e5b6f1157be3 src/sim/arguments.hh
--- a/src/sim/arguments.hh      Thu Oct 14 14:02:23 2010 -0700
+++ b/src/sim/arguments.hh      Fri Oct 15 23:57:06 2010 -0700
@@ -45,7 +45,7 @@
   protected:
     ThreadContext *tc;
     int number;
-    uint64_t getArg(uint8_t size, bool fp = false);
+    uint64_t getArg(uint16_t size = (uint16_t)(-1), bool fp = false);
 
   protected:
     class Data : public RefCounted
@@ -82,7 +82,7 @@
 
     // for checking if an argument is NULL
     bool operator!() {
-        return getArg(TheISA::MachineBytes) == 0;
+        return getArg() == 0;
     }
 
     Arguments &operator++() {
@@ -143,7 +143,7 @@
 
     operator char *() {
         char *buf = data->alloc(2048);
-        CopyStringOut(tc, buf, getArg(TheISA::MachineBytes), 2048);
+        CopyStringOut(tc, buf, getArg(), 2048);
         return buf;
     }
 };
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to