Add a flag to indicate an instruction triggers a syscall in SE mode.
authorGabe Black <gblack@eecs.umich.edu>
Wed, 1 Aug 2007 00:34:08 +0000 (17:34 -0700)
committerGabe Black <gblack@eecs.umich.edu>
Wed, 1 Aug 2007 00:34:08 +0000 (17:34 -0700)
--HG--
extra : convert_revision : 1d0b3afdd8254f5b2fb4bbff1fa4a0536f78bb06

src/arch/alpha/isa/decoder.isa
src/arch/mips/isa/decoder.isa
src/arch/sparc/isa/decoder.isa
src/arch/x86/isa/decoder/two_byte_opcodes.isa
src/cpu/base_dyn_inst.hh
src/cpu/static_inst.hh

index af1a91a6293898e36281e49bea0be792370c9fe3..2177e8c4f8e62949580dcaa613e1f7163e7177e9 100644 (file)
@@ -714,7 +714,7 @@ decode OPCODE default Unknown::unknown() {
             }}, IsNonSpeculative);
             0x83: callsys({{
                 xc->syscall(R0);
-            }}, IsSerializeAfter, IsNonSpeculative);
+            }}, IsSerializeAfter, IsNonSpeculative, IsSyscall);
             // Read uniq reg into ABI return value register (r0)
             0x9e: rduniq({{ R0 = Runiq; }}, IsIprAccess);
             // Write uniq reg with value from ABI arg register (r16)
index e55d2e0705d7a608c54e5fa93e9edf631399b2b8..40ea223f6aa4008b16057c86e1b0f4678e993add 100644 (file)
@@ -134,7 +134,8 @@ decode OPCODE_HI default Unknown::unknown() {
                     0x2: movz({{ Rd = (Rt == 0) ? Rs : Rd; }});
                     0x3: movn({{ Rd = (Rt != 0) ? Rs : Rd; }});
                     0x4: syscall({{ xc->syscall(R2); }},
-                                 IsSerializeAfter, IsNonSpeculative);
+                                 IsSerializeAfter, IsNonSpeculative,
+                                 IsSyscall);
                     0x7: sync({{ ; }}, IsMemBarrier);
                 }
 
index 68b2183adcddcf3a099571aad0b1757a33edc878..14c652606bc6fe48228f7409b92e7195ea4dada0 100644 (file)
@@ -1230,7 +1230,7 @@ decode OP default Unknown::unknown()
                         DPRINTF(Sparc, "The trap number is %d\n", lTrapNum);
                         fault = new TrapInstruction(lTrapNum);
                     }
-                }}, IsSerializeAfter, IsNonSpeculative);
+                }}, IsSerializeAfter, IsNonSpeculative, IsSyscall);
                 0x2: Trap::tccx({{
                     if(passesCondition(Ccr<7:4>, COND2))
                     {
@@ -1238,7 +1238,7 @@ decode OP default Unknown::unknown()
                         DPRINTF(Sparc, "The trap number is %d\n", lTrapNum);
                         fault = new TrapInstruction(lTrapNum);
                     }
-                }}, IsSerializeAfter, IsNonSpeculative);
+                }}, IsSerializeAfter, IsNonSpeculative, IsSyscall);
             }
             0x3B: Nop::flush({{/*Instruction memory flush*/}}, IsWriteBarrier,
                           MemWriteOp);
index a8c4e706266cf43a23070d6ef3851b446b6b9599..e8307c6e6af8722cb07f05a028b5bbdb674d06d5 100644 (file)
@@ -70,7 +70,7 @@
 #if FULL_SYSTEM
                 0x05: syscall();
 #else
-                0x05: SyscallInst::syscall('xc->syscall(rax)');
+                0x05: SyscallInst::syscall('xc->syscall(rax)', IsSyscall);
 #endif
                 0x06: clts();
                 //sandpile.org says (AMD) after sysret, so I might want to check
index a55c1e3c0bf6505280f22875f9d01eb2ed94eb34..362babeff80baf40cff5ed0b8d0cc6381af463f1 100644 (file)
@@ -498,6 +498,7 @@ class BaseDynInst : public FastAlloc, public RefCounted
     bool isQuiesce() const { return staticInst->isQuiesce(); }
     bool isIprAccess() const { return staticInst->isIprAccess(); }
     bool isUnverifiable() const { return staticInst->isUnverifiable(); }
+    bool isSyscall() const { return staticInst->isSyscall(); }
     bool isMacroop() const { return staticInst->isMacroop(); }
     bool isMicroop() const { return staticInst->isMicroop(); }
     bool isDelayedCommit() const { return staticInst->isDelayedCommit(); }
index b0a19c151fe8a85442ff6c3fc7ad71eb71220eb2..f32b61ee5b3e2c470ec0bf00173d5202499daa23 100644 (file)
@@ -143,6 +143,9 @@ class StaticInstBase : public RefCounted
         IsIprAccess,    ///< Accesses IPRs
         IsUnverifiable, ///< Can't be verified by a checker
 
+        IsSyscall,      ///< Causes a system call to be emulated in syscall
+                        /// emulation mode.
+
         //Flags for microcode
         IsMacroop,      ///< Is a macroop containing microops
         IsMicroop,     ///< Is a microop
@@ -243,6 +246,7 @@ class StaticInstBase : public RefCounted
     bool isQuiesce() const { return flags[IsQuiesce]; }
     bool isIprAccess() const { return flags[IsIprAccess]; }
     bool isUnverifiable() const { return flags[IsUnverifiable]; }
+    bool isSyscall() const { return flags[IsSyscall]; }
     bool isMacroop() const { return flags[IsMacroop]; }
     bool isMicroop() const { return flags[IsMicroop]; }
     bool isDelayedCommit() const { return flags[IsDelayedCommit]; }