Calling syscalls from within the trap instruction's invoke method won't work because apparently you need an xc for that and not a tc. Cleaned up the TrapInstruction fault in light of this.
--HG-- extra : convert_revision : 1805c9244cfd62d0ee7862d8fd7c9983e00c5747
This commit is contained in:
parent
4a5cb3f425
commit
6ad386f1a8
|
@ -399,11 +399,6 @@ void PowerOnReset::invoke(ThreadContext * tc)
|
||||||
|
|
||||||
#if !FULL_SYSTEM
|
#if !FULL_SYSTEM
|
||||||
|
|
||||||
void TrapInstruction::invoke(ThreadContext * tc)
|
|
||||||
{
|
|
||||||
// Should be handled in ISA.
|
|
||||||
}
|
|
||||||
|
|
||||||
void SpillNNormal::invoke(ThreadContext *tc)
|
void SpillNNormal::invoke(ThreadContext *tc)
|
||||||
{
|
{
|
||||||
doNormalFault(tc, trapType());
|
doNormalFault(tc, trapType());
|
||||||
|
|
|
@ -604,17 +604,12 @@ class TrapInstruction : public EnumeratedFault
|
||||||
static TrapType _baseTrapType;
|
static TrapType _baseTrapType;
|
||||||
static FaultPriority _priority;
|
static FaultPriority _priority;
|
||||||
static FaultStat _count;
|
static FaultStat _count;
|
||||||
uint64_t syscall_num;
|
|
||||||
TrapType baseTrapType() {return _baseTrapType;}
|
TrapType baseTrapType() {return _baseTrapType;}
|
||||||
public:
|
public:
|
||||||
TrapInstruction(uint32_t n, uint64_t syscall) :
|
TrapInstruction(int32_t n) : EnumeratedFault(n) {;}
|
||||||
EnumeratedFault(n), syscall_num(syscall) {;}
|
|
||||||
FaultName name() {return _name;}
|
FaultName name() {return _name;}
|
||||||
FaultPriority priority() {return _priority;}
|
FaultPriority priority() {return _priority;}
|
||||||
FaultStat & countStat() {return _count;}
|
FaultStat & countStat() {return _count;}
|
||||||
#if !FULL_SYSTEM
|
|
||||||
void invoke(ThreadContext * tc);
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -726,7 +726,7 @@ decode OP default Unknown::unknown()
|
||||||
#if FULL_SYSTEM
|
#if FULL_SYSTEM
|
||||||
int lTrapNum = I ? (Rs1 + SW_TRAP) : (Rs1 + Rs2);
|
int lTrapNum = I ? (Rs1 + SW_TRAP) : (Rs1 + Rs2);
|
||||||
DPRINTF(Sparc, "The trap number is %d\n", lTrapNum);
|
DPRINTF(Sparc, "The trap number is %d\n", lTrapNum);
|
||||||
fault = new TrapInstruction(lTrapNum, R1);
|
fault = new TrapInstruction(lTrapNum);
|
||||||
#else
|
#else
|
||||||
DPRINTF(Sparc, "The syscall number is %d\n", R1);
|
DPRINTF(Sparc, "The syscall number is %d\n", R1);
|
||||||
xc->syscall(R1);
|
xc->syscall(R1);
|
||||||
|
@ -739,7 +739,7 @@ decode OP default Unknown::unknown()
|
||||||
#if FULL_SYSTEM
|
#if FULL_SYSTEM
|
||||||
int lTrapNum = I ? (Rs1 + SW_TRAP) : (Rs1 + Rs2);
|
int lTrapNum = I ? (Rs1 + SW_TRAP) : (Rs1 + Rs2);
|
||||||
DPRINTF(Sparc, "The trap number is %d\n", lTrapNum);
|
DPRINTF(Sparc, "The trap number is %d\n", lTrapNum);
|
||||||
fault = new TrapInstruction(lTrapNum, R1);
|
fault = new TrapInstruction(lTrapNum);
|
||||||
#else
|
#else
|
||||||
DPRINTF(Sparc, "The syscall number is %d\n", R1);
|
DPRINTF(Sparc, "The syscall number is %d\n", R1);
|
||||||
xc->syscall(R1);
|
xc->syscall(R1);
|
||||||
|
|
Loading…
Reference in a new issue