summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/arch/alpha/tlb.cc8
-rw-r--r--src/kern/linux/events.cc11
-rw-r--r--src/kern/linux/events.hh8
-rw-r--r--src/kern/linux/printk.cc13
-rw-r--r--src/kern/linux/printk.hh4
5 files changed, 17 insertions, 27 deletions
diff --git a/src/arch/alpha/tlb.cc b/src/arch/alpha/tlb.cc
index 3ab65e664..2dfff8c5f 100644
--- a/src/arch/alpha/tlb.cc
+++ b/src/arch/alpha/tlb.cc
@@ -213,7 +213,7 @@ TLB::flushAddr(Addr addr, uint8_t asn)
if (i == lookupTable.end())
return;
- while (i->first == vaddr.vpn()) {
+ while (i != lookupTable.end() && i->first == vaddr.vpn()) {
int index = i->second;
PTE *pte = &table[index];
assert(pte->valid);
@@ -225,10 +225,10 @@ TLB::flushAddr(Addr addr, uint8_t asn)
// invalidate this entry
pte->valid = false;
- lookupTable.erase(i);
+ lookupTable.erase(i++);
+ } else {
+ ++i;
}
-
- ++i;
}
}
diff --git a/src/kern/linux/events.cc b/src/kern/linux/events.cc
index 4a3fd9f47..42fa63a27 100644
--- a/src/kern/linux/events.cc
+++ b/src/kern/linux/events.cc
@@ -37,6 +37,7 @@
#include "kern/system_events.hh"
#include "sim/system.hh"
+#include <sstream>
namespace Linux {
@@ -44,13 +45,11 @@ void
DebugPrintkEvent::process(ThreadContext *tc)
{
if (DTRACE(DebugPrintf)) {
- if (!raw) {
- StringWrap name(tc->getSystemPtr()->name() + ".dprintk");
- DPRINTFN("");
- }
-
+ std::stringstream ss;
TheISA::Arguments args(tc);
- Printk(args);
+ Printk(ss, args);
+ StringWrap name(tc->getSystemPtr()->name() + ".dprintk");
+ DPRINTFN("%s", ss.str());
}
SkipFuncEvent::process(tc);
}
diff --git a/src/kern/linux/events.hh b/src/kern/linux/events.hh
index b0510c18f..e36a72dde 100644
--- a/src/kern/linux/events.hh
+++ b/src/kern/linux/events.hh
@@ -38,13 +38,9 @@ namespace Linux {
class DebugPrintkEvent : public SkipFuncEvent
{
- private:
- bool raw;
-
public:
- DebugPrintkEvent(PCEventQueue *q, const std::string &desc, Addr addr,
- bool r = false)
- : SkipFuncEvent(q, desc, addr), raw(r) {}
+ DebugPrintkEvent(PCEventQueue *q, const std::string &desc, Addr addr)
+ : SkipFuncEvent(q, desc, addr) {}
virtual void process(ThreadContext *xc);
};
diff --git a/src/kern/linux/printk.cc b/src/kern/linux/printk.cc
index 0e9fd6620..866353e31 100644
--- a/src/kern/linux/printk.cc
+++ b/src/kern/linux/printk.cc
@@ -32,22 +32,18 @@
#include <sys/types.h>
#include <algorithm>
-#include "base/trace.hh"
#include "arch/arguments.hh"
+#include "base/trace.hh"
+#include "kern/linux/printk.hh"
using namespace std;
void
-Printk(TheISA::Arguments args)
+Printk(stringstream &out, TheISA::Arguments args)
{
- std::ostream &out = Trace::output();
char *p = (char *)args++;
- ios::fmtflags saved_flags = out.flags();
- char old_fill = out.fill();
- int old_precision = out.precision();
-
while (*p) {
switch (*p) {
case '%': {
@@ -258,8 +254,5 @@ Printk(TheISA::Arguments args)
}
}
- out.flags(saved_flags);
- out.fill(old_fill);
- out.precision(old_precision);
}
diff --git a/src/kern/linux/printk.hh b/src/kern/linux/printk.hh
index 17d59b765..20dfb430f 100644
--- a/src/kern/linux/printk.hh
+++ b/src/kern/linux/printk.hh
@@ -34,8 +34,10 @@
#include "arch/isa_specific.hh"
+#include <sstream>
+
class TheISA::Arguments;
-void Printk(TheISA::Arguments args);
+void Printk(std::stringstream &out, TheISA::Arguments args);
#endif // __PRINTK_HH__