summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/alpha/isa_desc29
-rw-r--r--cpu/full_cpu/smt.hh7
-rw-r--r--cpu/simple_cpu/simple_cpu.cc7
-rw-r--r--sim/debug.cc2
-rw-r--r--sim/serialize.cc7
-rw-r--r--sim/serialize.hh4
6 files changed, 28 insertions, 28 deletions
diff --git a/arch/alpha/isa_desc b/arch/alpha/isa_desc
index e3b8cf01b..aef9135d3 100644
--- a/arch/alpha/isa_desc
+++ b/arch/alpha/isa_desc
@@ -1399,6 +1399,7 @@ declare {{
protected:
int palFunc; ///< Function code part of instruction
int palOffset; ///< Target PC, offset from IPR_PAL_BASE
+ bool palPriv; ///< is this call privileged?
/// Constructor.
CallPalBase(const char *mnem, MachInst _machInst,
@@ -1406,7 +1407,7 @@ declare {{
: AlphaStaticInst(mnem, _machInst, __opClass),
palFunc(PALFUNC)
{
- int palPriv = ((machInst & 0x80) != 0);
+ palPriv = ((machInst & 0x80) != 0);
int shortPalFunc = (machInst & 0x3f);
palOffset = 0x2001 + (palPriv << 12) + (shortPalFunc << 6);
}
@@ -2352,20 +2353,26 @@ decode OPCODE default Unknown::unknown() {
#ifdef FULL_SYSTEM
0x00: CallPal::call_pal({{
- // check to see if simulator wants to do something special
- // on this PAL call (including maybe suppress it)
- bool dopal = xc->simPalCheck(palFunc);
-
- if (!xc->misspeculating()) {
- Annotate::Callpal(xc, palFunc);
+ if (palPriv && !PC_PAL(xc->regs.pc)) {
+ // attempt to do privileged PAL call in non-PAL mode
+ fault = Unimplemented_Opcode_Fault;
}
+ else {
+ // check to see if simulator wants to do something special
+ // on this PAL call (including maybe suppress it)
+ bool dopal = xc->simPalCheck(palFunc);
- if (dopal) {
if (!xc->misspeculating()) {
- AlphaISA::swap_palshadow(&xc->regs, true);
+ Annotate::Callpal(xc, palFunc);
+ }
+
+ if (dopal) {
+ if (!xc->misspeculating()) {
+ AlphaISA::swap_palshadow(&xc->regs, true);
+ }
+ xc->setIpr(AlphaISA::IPR_EXC_ADDR, NPC);
+ NPC = xc->readIpr(AlphaISA::IPR_PAL_BASE, fault) + palOffset;
}
- xc->setIpr(AlphaISA::IPR_EXC_ADDR, NPC);
- NPC = xc->readIpr(AlphaISA::IPR_PAL_BASE, fault) + palOffset;
}
}});
#else
diff --git a/cpu/full_cpu/smt.hh b/cpu/full_cpu/smt.hh
index f9c1e4614..6a4151ffd 100644
--- a/cpu/full_cpu/smt.hh
+++ b/cpu/full_cpu/smt.hh
@@ -28,17 +28,12 @@
/**
* @file
- * Defines SMT_MAX_CPUS and SMT_MAX_THREADS.
+ * Defines SMT_MAX_THREADS.
*/
#ifndef __SMT_HH__
#define __SMT_HH__
-#ifndef SMT_MAX_CPUS
-/** The maximum number of cpus in any one system. */
-#define SMT_MAX_CPUS 4
-#endif
-
#ifndef SMT_MAX_THREADS
/** The number of TPUs in any processor. */
#define SMT_MAX_THREADS 4
diff --git a/cpu/simple_cpu/simple_cpu.cc b/cpu/simple_cpu/simple_cpu.cc
index aaf8a9dc5..77f0c41ed 100644
--- a/cpu/simple_cpu/simple_cpu.cc
+++ b/cpu/simple_cpu/simple_cpu.cc
@@ -193,7 +193,11 @@ SimpleCPU::takeOverFrom(BaseCPU *oldCPU)
ExecContext *xc = execContexts[i];
if (xc->status() == ExecContext::Active && _status != Running) {
_status = Running;
- tickEvent.schedule(curTick);
+ // the CpuSwitchEvent has a low priority, so it's
+ // scheduled *after* the current cycle's tick event. Thus
+ // the first tick event for the new context should take
+ // place on the *next* cycle.
+ tickEvent.schedule(curTick+1);
}
}
@@ -849,3 +853,4 @@ CREATE_SIM_OBJECT(SimpleCPU)
}
REGISTER_SIM_OBJECT("SimpleCPU", SimpleCPU)
+
diff --git a/sim/debug.cc b/sim/debug.cc
index 95187baff..6f3789c96 100644
--- a/sim/debug.cc
+++ b/sim/debug.cc
@@ -66,6 +66,7 @@ class DebugBreakEvent : public Event
DebugBreakEvent::DebugBreakEvent(EventQueue *q, Tick _when)
: Event(q)
{
+ setFlags(AutoDelete);
schedule(_when, -20000);
}
@@ -76,7 +77,6 @@ void
DebugBreakEvent::process()
{
debug_break();
- delete this;
}
diff --git a/sim/serialize.cc b/sim/serialize.cc
index 1fce6e7b1..9738029c2 100644
--- a/sim/serialize.cc
+++ b/sim/serialize.cc
@@ -50,13 +50,6 @@ using namespace std;
Serializer *Serializeable::serializer = NULL;
-Serializeable::Serializeable()
- : serialized(false)
-{ }
-
-Serializeable::~Serializeable()
-{ }
-
void
Serializeable::mark()
{
diff --git a/sim/serialize.hh b/sim/serialize.hh
index bc40d0ad2..077931d8c 100644
--- a/sim/serialize.hh
+++ b/sim/serialize.hh
@@ -115,8 +115,8 @@ class Serializeable
void nameOut(std::ostream& os, const std::string &_name);
public:
- Serializeable();
- virtual ~Serializeable();
+ Serializeable() : serialized(false) {}
+ virtual ~Serializeable() {}
// manditory virtual function, so objects must provide names
virtual std::string name() const = 0;