summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--SConscript7
-rw-r--r--arch/alpha/freebsd/system.cc (renamed from kern/freebsd/freebsd_system.cc)28
-rw-r--r--arch/alpha/freebsd/system.hh (renamed from kern/freebsd/freebsd_system.hh)6
-rw-r--r--arch/alpha/linux/aligned.hh (renamed from kern/linux/aligned.hh)8
-rw-r--r--arch/alpha/linux/hwrpb.hh (renamed from kern/linux/hwrpb.hh)8
-rw-r--r--arch/alpha/linux/system.cc (renamed from kern/linux/linux_system.cc)56
-rw-r--r--arch/alpha/linux/system.hh (renamed from kern/linux/linux_system.hh)35
-rw-r--r--arch/alpha/linux/thread_info.hh (renamed from kern/linux/thread_info.hh)8
-rw-r--r--arch/alpha/linux/threadinfo.hh (renamed from kern/linux/linux_threadinfo.hh)9
-rw-r--r--arch/alpha/system.cc3
-rw-r--r--arch/alpha/tru64/system.cc (renamed from kern/tru64/tru64_system.cc)24
-rw-r--r--arch/alpha/tru64/system.hh (renamed from kern/tru64/tru64_system.hh)13
-rw-r--r--base/loader/elf_object.cc4
-rw-r--r--kern/linux/events.cc54
-rw-r--r--kern/linux/events.hh50
-rw-r--r--kern/tru64/tru64.hh5
-rw-r--r--python/m5/objects/System.py12
-rw-r--r--sim/syscall_emul.hh14
18 files changed, 220 insertions, 124 deletions
diff --git a/SConscript b/SConscript
index 1913e199c..efcb2baf6 100644
--- a/SConscript
+++ b/SConscript
@@ -212,7 +212,10 @@ mysql_sources = Split('''
# Full-system sources
full_system_sources = Split('''
+ arch/alpha/freebsd/system.cc
+ arch/alpha/linux/system.cc
arch/alpha/system.cc
+ arch/alpha/tru64/system.cc
base/crc.cc
base/inet.cc
@@ -253,15 +256,13 @@ full_system_sources = Split('''
kern/kernel_binning.cc
kern/kernel_stats.cc
kern/system_events.cc
- kern/freebsd/freebsd_system.cc
+ kern/linux/events.cc
kern/linux/linux_syscalls.cc
- kern/linux/linux_system.cc
kern/linux/printk.cc
kern/tru64/dump_mbuf.cc
kern/tru64/printf.cc
kern/tru64/tru64_events.cc
kern/tru64/tru64_syscalls.cc
- kern/tru64/tru64_system.cc
mem/functional/memory_control.cc
mem/functional/physical.cc
diff --git a/kern/freebsd/freebsd_system.cc b/arch/alpha/freebsd/system.cc
index 7ba385267..681d4ad46 100644
--- a/kern/freebsd/freebsd_system.cc
+++ b/arch/alpha/freebsd/system.cc
@@ -34,9 +34,9 @@
*/
#include "arch/alpha/system.hh"
+#include "arch/alpha/freebsd/system.hh"
#include "base/loader/symtab.hh"
#include "cpu/exec_context.hh"
-#include "kern/freebsd/freebsd_system.hh"
#include "mem/functional/memory_control.hh"
#include "mem/functional/physical.hh"
#include "sim/builder.hh"
@@ -47,9 +47,9 @@
#define TIMER_FREQUENCY 1193180
using namespace std;
-using namespace TheISA;
+using namespace AlphaISA;
-FreebsdSystem::FreebsdSystem(Params *p)
+FreebsdAlphaSystem::FreebsdAlphaSystem(Params *p)
: AlphaSystem(p)
{
/**
@@ -62,7 +62,7 @@ FreebsdSystem::FreebsdSystem(Params *p)
}
-FreebsdSystem::~FreebsdSystem()
+FreebsdAlphaSystem::~FreebsdAlphaSystem()
{
delete skipDelayEvent;
delete skipCalibrateClocks;
@@ -70,7 +70,7 @@ FreebsdSystem::~FreebsdSystem()
void
-FreebsdSystem::doCalibrateClocks(ExecContext *xc)
+FreebsdAlphaSystem::doCalibrateClocks(ExecContext *xc)
{
Addr ppc_vaddr = 0;
Addr timer_vaddr = 0;
@@ -92,14 +92,14 @@ FreebsdSystem::doCalibrateClocks(ExecContext *xc)
void
-FreebsdSystem::SkipCalibrateClocksEvent::process(ExecContext *xc)
+FreebsdAlphaSystem::SkipCalibrateClocksEvent::process(ExecContext *xc)
{
SkipFuncEvent::process(xc);
- ((FreebsdSystem *)xc->system)->doCalibrateClocks(xc);
+ ((FreebsdAlphaSystem *)xc->system)->doCalibrateClocks(xc);
}
-BEGIN_DECLARE_SIM_OBJECT_PARAMS(FreebsdSystem)
+BEGIN_DECLARE_SIM_OBJECT_PARAMS(FreebsdAlphaSystem)
Param<Tick> boot_cpu_frequency;
SimObjectParam<MemoryController *> memctrl;
@@ -120,9 +120,9 @@ BEGIN_DECLARE_SIM_OBJECT_PARAMS(FreebsdSystem)
VectorParam<string> binned_fns;
Param<bool> bin_int;
-END_DECLARE_SIM_OBJECT_PARAMS(FreebsdSystem)
+END_DECLARE_SIM_OBJECT_PARAMS(FreebsdAlphaSystem)
-BEGIN_INIT_SIM_OBJECT_PARAMS(FreebsdSystem)
+BEGIN_INIT_SIM_OBJECT_PARAMS(FreebsdAlphaSystem)
INIT_PARAM(boot_cpu_frequency, "Frequency of the boot CPU"),
INIT_PARAM(memctrl, "memory controller"),
@@ -140,9 +140,9 @@ BEGIN_INIT_SIM_OBJECT_PARAMS(FreebsdSystem)
INIT_PARAM(binned_fns, "functions to be broken down and binned"),
INIT_PARAM_DFLT(bin_int, "is interrupt code binned seperately?", true)
-END_INIT_SIM_OBJECT_PARAMS(FreebsdSystem)
+END_INIT_SIM_OBJECT_PARAMS(FreebsdAlphaSystem)
-CREATE_SIM_OBJECT(FreebsdSystem)
+CREATE_SIM_OBJECT(FreebsdAlphaSystem)
{
AlphaSystem::Params *p = new AlphaSystem::Params;
p->name = getInstanceName();
@@ -160,8 +160,8 @@ CREATE_SIM_OBJECT(FreebsdSystem)
p->bin = bin;
p->binned_fns = binned_fns;
p->bin_int = bin_int;
- return new FreebsdSystem(p);
+ return new FreebsdAlphaSystem(p);
}
-REGISTER_SIM_OBJECT("FreebsdSystem", FreebsdSystem)
+REGISTER_SIM_OBJECT("FreebsdAlphaSystem", FreebsdAlphaSystem)
diff --git a/kern/freebsd/freebsd_system.hh b/arch/alpha/freebsd/system.hh
index f87fb03ef..5d996955e 100644
--- a/kern/freebsd/freebsd_system.hh
+++ b/arch/alpha/freebsd/system.hh
@@ -31,7 +31,7 @@
#include "kern/system_events.hh"
-class FreebsdSystem : public AlphaSystem
+class FreebsdAlphaSystem : public AlphaSystem
{
private:
class SkipCalibrateClocksEvent : public SkipFuncEvent
@@ -47,8 +47,8 @@ class FreebsdSystem : public AlphaSystem
SkipCalibrateClocksEvent *skipCalibrateClocks;
public:
- FreebsdSystem(Params *p);
- ~FreebsdSystem();
+ FreebsdAlphaSystem(Params *p);
+ ~FreebsdAlphaSystem();
void doCalibrateClocks(ExecContext *xc);
};
diff --git a/kern/linux/aligned.hh b/arch/alpha/linux/aligned.hh
index 18d1b43c0..cabecb283 100644
--- a/kern/linux/aligned.hh
+++ b/arch/alpha/linux/aligned.hh
@@ -26,15 +26,15 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef __KERN_LINUX_ALIGNED_HH__
-#define __KERN_LINUX_ALIGNED_HH__
+#ifndef __ARCH_ALPHA_LINUX_ALIGNED_HH__
+#define __ARCH_ALPHA_LINUX_ALIGNED_HH__
/* GCC 3.3.X has a bug in which attributes+typedefs don't work. 3.2.X is fine
* as in 3.4.X, but the bug is marked will not fix in 3.3.X so here is
* the work around.
*/
-#if __GNUC__ == 3 && __GNUC_MINOR__ != 3
+#if (__GNUC__ == 3 && __GNUC_MINOR__ != 3) || __GNUC__ > 3
typedef uint64_t uint64_ta __attribute__ ((aligned (8))) ;
typedef int64_t int64_ta __attribute__ ((aligned (8))) ;
typedef Addr Addr_a __attribute__ ((aligned (8))) ;
@@ -44,4 +44,4 @@ typedef Addr Addr_a __attribute__ ((aligned (8))) ;
#define Addr_a Addr __attribute__ ((aligned (8)))
#endif /* __GNUC__ __GNUC_MINOR__ */
-#endif /* __KERN_LINUX_ALIGNED_HH__ */
+#endif /* __ARCH_ALPHA_LINUX_ALIGNED_HH__ */
diff --git a/kern/linux/hwrpb.hh b/arch/alpha/linux/hwrpb.hh
index 4c8ac32e8..869ce026b 100644
--- a/kern/linux/hwrpb.hh
+++ b/arch/alpha/linux/hwrpb.hh
@@ -22,10 +22,10 @@
* SOFTWARE.
*/
-#ifndef __KERN_LINUX_HWRPB_HH__
-#define __KERN_LINUX_HWRPB_HH__
+#ifndef __ARCH_ALPHA_LINUX_HWRPB_HH__
+#define __ARCH_ALPHA_LINUX_HWRPB_HH__
-#include "kern/linux/aligned.hh"
+#include "arch/alpha/linux/aligned.hh"
namespace Linux {
struct pcb_struct {
@@ -39,4 +39,4 @@ namespace Linux {
uint64_ta res1, res2;
};
}
-#endif // __KERN_LINUX_HWRPB_HH__
+#endif // __ARCH_ALPHA_LINUX_HWRPB_HH__
diff --git a/kern/linux/linux_system.cc b/arch/alpha/linux/system.cc
index d7ec8a327..6a820d14f 100644
--- a/kern/linux/linux_system.cc
+++ b/arch/alpha/linux/system.cc
@@ -35,25 +35,27 @@
* up boot time.
*/
+#include "arch/arguments.hh"
+#include "arch/vtophys.hh"
+#include "arch/alpha/linux/system.hh"
+#include "arch/alpha/linux/threadinfo.hh"
#include "arch/alpha/system.hh"
#include "base/loader/symtab.hh"
#include "cpu/exec_context.hh"
#include "cpu/base.hh"
-#include "kern/linux/linux_system.hh"
-#include "kern/linux/linux_threadinfo.hh"
+#include "dev/platform.hh"
#include "kern/linux/printk.hh"
+#include "kern/linux/events.hh"
#include "mem/functional/memory_control.hh"
#include "mem/functional/physical.hh"
#include "sim/builder.hh"
#include "sim/byteswap.hh"
-#include "dev/platform.hh"
-#include "arch/arguments.hh"
-#include "arch/vtophys.hh"
using namespace std;
-using namespace TheISA;
+using namespace AlphaISA;
+using namespace Linux;
-LinuxSystem::LinuxSystem(Params *p)
+LinuxAlphaSystem::LinuxAlphaSystem(Params *p)
: AlphaSystem(p)
{
Addr addr = 0;
@@ -166,7 +168,7 @@ LinuxSystem::LinuxSystem(Params *p)
}
}
-LinuxSystem::~LinuxSystem()
+LinuxAlphaSystem::~LinuxAlphaSystem()
{
#ifndef NDEBUG
delete kernelPanicEvent;
@@ -184,7 +186,7 @@ LinuxSystem::~LinuxSystem()
void
-LinuxSystem::setDelayLoop(ExecContext *xc)
+LinuxAlphaSystem::setDelayLoop(ExecContext *xc)
{
Addr addr = 0;
if (kernelSymtab->findAddress("loops_per_jiffy", addr)) {
@@ -200,31 +202,17 @@ LinuxSystem::setDelayLoop(ExecContext *xc)
}
}
+
void
-LinuxSystem::SkipDelayLoopEvent::process(ExecContext *xc)
+LinuxAlphaSystem::SkipDelayLoopEvent::process(ExecContext *xc)
{
SkipFuncEvent::process(xc);
// calculate and set loops_per_jiffy
- ((LinuxSystem *)xc->system)->setDelayLoop(xc);
-}
-
-void
-LinuxSystem::DebugPrintkEvent::process(ExecContext *xc)
-{
- if (DTRACE(DebugPrintf)) {
- if (!raw) {
- StringWrap name(xc->system->name() + ".dprintk");
- DPRINTFN("");
- }
-
- AlphaArguments args(xc);
- Printk(args);
- SkipFuncEvent::process(xc);
- }
+ ((LinuxAlphaSystem *)xc->system)->setDelayLoop(xc);
}
void
-LinuxSystem::PrintThreadInfo::process(ExecContext *xc)
+LinuxAlphaSystem::PrintThreadInfo::process(ExecContext *xc)
{
Linux::ThreadInfo ti(xc);
@@ -233,7 +221,7 @@ LinuxSystem::PrintThreadInfo::process(ExecContext *xc)
}
-BEGIN_DECLARE_SIM_OBJECT_PARAMS(LinuxSystem)
+BEGIN_DECLARE_SIM_OBJECT_PARAMS(LinuxAlphaSystem)
Param<Tick> boot_cpu_frequency;
SimObjectParam<MemoryController *> memctrl;
@@ -254,9 +242,9 @@ BEGIN_DECLARE_SIM_OBJECT_PARAMS(LinuxSystem)
VectorParam<string> binned_fns;
Param<bool> bin_int;
-END_DECLARE_SIM_OBJECT_PARAMS(LinuxSystem)
+END_DECLARE_SIM_OBJECT_PARAMS(LinuxAlphaSystem)
-BEGIN_INIT_SIM_OBJECT_PARAMS(LinuxSystem)
+BEGIN_INIT_SIM_OBJECT_PARAMS(LinuxAlphaSystem)
INIT_PARAM(boot_cpu_frequency, "Frequency of the boot CPU"),
INIT_PARAM(memctrl, "memory controller"),
@@ -274,9 +262,9 @@ BEGIN_INIT_SIM_OBJECT_PARAMS(LinuxSystem)
INIT_PARAM(binned_fns, "functions to be broken down and binned"),
INIT_PARAM_DFLT(bin_int, "is interrupt code binned seperately?", true)
-END_INIT_SIM_OBJECT_PARAMS(LinuxSystem)
+END_INIT_SIM_OBJECT_PARAMS(LinuxAlphaSystem)
-CREATE_SIM_OBJECT(LinuxSystem)
+CREATE_SIM_OBJECT(LinuxAlphaSystem)
{
AlphaSystem::Params *p = new AlphaSystem::Params;
p->name = getInstanceName();
@@ -294,8 +282,8 @@ CREATE_SIM_OBJECT(LinuxSystem)
p->bin = bin;
p->binned_fns = binned_fns;
p->bin_int = bin_int;
- return new LinuxSystem(p);
+ return new LinuxAlphaSystem(p);
}
-REGISTER_SIM_OBJECT("LinuxSystem", LinuxSystem)
+REGISTER_SIM_OBJECT("LinuxAlphaSystem", LinuxAlphaSystem)
diff --git a/kern/linux/linux_system.hh b/arch/alpha/linux/system.hh
index 9fecb7290..035e2a427 100644
--- a/kern/linux/linux_system.hh
+++ b/arch/alpha/linux/system.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004-2005 The Regents of The University of Michigan
+ * Copyright (c) 2004-2006 The Regents of The University of Michigan
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -26,21 +26,27 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef __KERN_LINUX_LINUX_SYSTEM_HH__
-#define __KERN_LINUX_LINUX_SYSTEM_HH__
+#ifndef __ARCH_ALPHA_LINUX_SYSTEM_HH__
+#define __ARCH_ALPHA_LINUX_SYSTEM_HH__
class ExecContext;
class BreakPCEvent;
class IdleStartEvent;
-class PrintThreadInfo;
+
+#include "arch/alpha/system.hh"
+#include "kern/linux/events.hh"
+
+using namespace AlphaISA;
+using namespace Linux;
+using namespace std;
/**
* This class contains linux specific system code (Loading, Events, Binning).
* It points to objects that are the system binaries to load and patches them
* appropriately to work in simulator.
*/
-class LinuxSystem : public AlphaSystem
+class LinuxAlphaSystem : public AlphaSystem
{
private:
class SkipDelayLoopEvent : public SkipFuncEvent
@@ -51,18 +57,6 @@ class LinuxSystem : public AlphaSystem
virtual void process(ExecContext *xc);
};
- 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) {}
- virtual void process(ExecContext *xc);
- };
-
class PrintThreadInfo : public PCEvent
{
public:
@@ -71,6 +65,7 @@ class LinuxSystem : public AlphaSystem
virtual void process(ExecContext *xc);
};
+
/**
* Addresses defining where the kernel bootloader places various
* elements. Details found in include/asm-alpha/system.h
@@ -142,10 +137,10 @@ class LinuxSystem : public AlphaSystem
IdleStartEvent *idleStartEvent;
public:
- LinuxSystem(Params *p);
- ~LinuxSystem();
+ LinuxAlphaSystem(Params *p);
+ ~LinuxAlphaSystem();
void setDelayLoop(ExecContext *xc);
};
-#endif // __KERN_LINUX_LINUX_SYSTEM_HH__
+#endif // __ARCH_ALPHA_LINUX_SYSTEM_HH__
diff --git a/kern/linux/thread_info.hh b/arch/alpha/linux/thread_info.hh
index cf24ef939..88791b00d 100644
--- a/kern/linux/thread_info.hh
+++ b/arch/alpha/linux/thread_info.hh
@@ -26,10 +26,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef __KERN_LINUX_THREAD_INFO_H__
-#define __KERN_LINUX_THREAD_INFO_H__
+#ifndef __ARCH_ALPHA_LINUX_THREAD_INFO_H__
+#define __ARCH_ALPHA_LINUX_THREAD_INFO_H__
-#include "kern/linux/hwrpb.hh"
+#include "arch/alpha/linux/hwrpb.hh"
namespace Linux {
struct thread_info {
@@ -38,4 +38,4 @@ namespace Linux {
};
}
-#endif // __KERN_LINUX_THREAD_INFO_H__
+#endif // __ARCH_ALPHA_LINUX_THREAD_INFO_H__
diff --git a/kern/linux/linux_threadinfo.hh b/arch/alpha/linux/threadinfo.hh
index a1c378d6a..bdb8e1e4c 100644
--- a/kern/linux/linux_threadinfo.hh
+++ b/arch/alpha/linux/threadinfo.hh
@@ -26,10 +26,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef __KERN_LINUX_LINUX_TREADNIFO_HH__
-#define __KERN_LINUX_LINUX_TREADNIFO_HH__
+#ifndef __ARCH_ALPHA_LINUX_LINUX_TREADNIFO_HH__
+#define __ARCH_ALPHA_LINUX_LINUX_TREADNIFO_HH__
-#include "kern/linux/thread_info.hh"
+#include "arch/alpha/linux/thread_info.hh"
+#include "cpu/exec_context.hh"
#include "kern/linux/sched.hh"
#include "sim/vptr.hh"
@@ -85,4 +86,4 @@ class ThreadInfo
/* namespace Linux */ }
-#endif // __KERN_LINUX_LINUX_THREADINFO_HH__
+#endif // __ARCH_ALPHA_LINUX_LINUX_THREADINFO_HH__
diff --git a/arch/alpha/system.cc b/arch/alpha/system.cc
index 460131d43..25543da57 100644
--- a/arch/alpha/system.cc
+++ b/arch/alpha/system.cc
@@ -27,6 +27,7 @@
*/
#include "arch/alpha/system.hh"
+#include "arch/vtophys.hh"
#include "base/remote_gdb.hh"
#include "base/loader/object_file.hh"
#include "base/loader/symtab.hh"
@@ -35,7 +36,7 @@
#include "mem/functional/physical.hh"
#include "sim/byteswap.hh"
#include "sim/builder.hh"
-#include "arch/vtophys.hh"
+
using namespace LittleEndianGuest;
diff --git a/kern/tru64/tru64_system.cc b/arch/alpha/tru64/system.cc
index aa78e8de6..d09a0c85d 100644
--- a/kern/tru64/tru64_system.cc
+++ b/arch/alpha/tru64/system.cc
@@ -26,22 +26,22 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include "arch/alpha/tru64/system.hh"
+#include "arch/isa_traits.hh"
+#include "arch/vtophys.hh"
#include "base/loader/symtab.hh"
#include "base/trace.hh"
#include "cpu/base.hh"
#include "cpu/exec_context.hh"
#include "kern/tru64/tru64_events.hh"
-#include "kern/tru64/tru64_system.hh"
#include "kern/system_events.hh"
#include "mem/functional/memory_control.hh"
#include "mem/functional/physical.hh"
#include "sim/builder.hh"
-#include "arch/isa_traits.hh"
-#include "arch/vtophys.hh"
using namespace std;
-Tru64System::Tru64System(Tru64System::Params *p)
+Tru64AlphaSystem::Tru64AlphaSystem(Tru64AlphaSystem::Params *p)
: AlphaSystem(p)
{
Addr addr = 0;
@@ -77,7 +77,7 @@ Tru64System::Tru64System(Tru64System::Params *p)
#endif
}
-Tru64System::~Tru64System()
+Tru64AlphaSystem::~Tru64AlphaSystem()
{
#ifdef DEBUG
delete kernelPanicEvent;
@@ -93,7 +93,7 @@ Tru64System::~Tru64System()
#endif
}
-BEGIN_DECLARE_SIM_OBJECT_PARAMS(Tru64System)
+BEGIN_DECLARE_SIM_OBJECT_PARAMS(Tru64AlphaSystem)
Param<Tick> boot_cpu_frequency;
SimObjectParam<MemoryController *> memctrl;
@@ -113,9 +113,9 @@ BEGIN_DECLARE_SIM_OBJECT_PARAMS(Tru64System)
Param<bool> bin;
VectorParam<string> binned_fns;
-END_DECLARE_SIM_OBJECT_PARAMS(Tru64System)
+END_DECLARE_SIM_OBJECT_PARAMS(Tru64AlphaSystem)
-BEGIN_INIT_SIM_OBJECT_PARAMS(Tru64System)
+BEGIN_INIT_SIM_OBJECT_PARAMS(Tru64AlphaSystem)
INIT_PARAM(boot_cpu_frequency, "frequency of the boot cpu"),
INIT_PARAM(memctrl, "memory controller"),
@@ -132,9 +132,9 @@ BEGIN_INIT_SIM_OBJECT_PARAMS(Tru64System)
INIT_PARAM_DFLT(bin, "is this system to be binned", false),
INIT_PARAM(binned_fns, "functions to be broken down and binned")
-END_INIT_SIM_OBJECT_PARAMS(Tru64System)
+END_INIT_SIM_OBJECT_PARAMS(Tru64AlphaSystem)
-CREATE_SIM_OBJECT(Tru64System)
+CREATE_SIM_OBJECT(Tru64AlphaSystem)
{
AlphaSystem::Params *p = new AlphaSystem::Params;
p->name = getInstanceName();
@@ -153,7 +153,7 @@ CREATE_SIM_OBJECT(Tru64System)
p->binned_fns = binned_fns;
p->bin_int = false;
- return new Tru64System(p);
+ return new Tru64AlphaSystem(p);
}
-REGISTER_SIM_OBJECT("Tru64System", Tru64System)
+REGISTER_SIM_OBJECT("Tru64AlphaSystem", Tru64AlphaSystem)
diff --git a/kern/tru64/tru64_system.hh b/arch/alpha/tru64/system.hh
index 38e6d9dd7..0e0cc1bc8 100644
--- a/kern/tru64/tru64_system.hh
+++ b/arch/alpha/tru64/system.hh
@@ -26,8 +26,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef __KERN_TRU64_TRU64_SYSTEM_HH__
-#define __KERN_TRU64_TRU64_SYSTEM_HH__
+#ifndef __ARCH_ALPHA_TRU64_SYSTEM_HH__
+#define __ARCH_ALPHA_TRU64_SYSTEM_HH__
#include "arch/alpha/system.hh"
#include "arch/isa_traits.hh"
@@ -40,10 +40,11 @@ class BadAddrEvent;
class SkipFuncEvent;
class PrintfEvent;
class DebugPrintfEvent;
+class DebugPrintfrEvent;
class DumpMbufEvent;
class AlphaArguments;
-class Tru64System : public AlphaSystem
+class Tru64AlphaSystem : public AlphaSystem
{
private:
#ifdef DEBUG
@@ -60,11 +61,11 @@ class Tru64System : public AlphaSystem
DumpMbufEvent *dumpMbufEvent;
public:
- Tru64System(Params *p);
- ~Tru64System();
+ Tru64AlphaSystem(Params *p);
+ ~Tru64AlphaSystem();
static void Printf(AlphaArguments args);
static void DumpMbuf(AlphaArguments args);
};
-#endif // __KERN_TRU64_TRU64_SYSTEM_HH__
+#endif // __ARCH_ALPHA_TRU64_SYSTEM_HH__
diff --git a/base/loader/elf_object.cc b/base/loader/elf_object.cc
index 9dd9f9d00..fd69c9e56 100644
--- a/base/loader/elf_object.cc
+++ b/base/loader/elf_object.cc
@@ -38,8 +38,8 @@
#define __LIBELF_NEED_LINK_H 0
#define __LIBELF_SYMBOL_VERSIONS 0
-#include <libelf/libelf.h>
-#include <libelf/gelf.h>
+#include "libelf/libelf.h"
+#include "libelf/gelf.h"
#include "base/loader/elf_object.hh"
diff --git a/kern/linux/events.cc b/kern/linux/events.cc
new file mode 100644
index 000000000..a781165ac
--- /dev/null
+++ b/kern/linux/events.cc
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2004-2006 The Regents of The University of Michigan
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met: redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer;
+ * redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution;
+ * neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "arch/arguments.hh"
+#include "base/trace.hh"
+#include "cpu/exec_context.hh"
+#include "kern/linux/events.hh"
+#include "kern/linux/printk.hh"
+#include "kern/system_events.hh"
+
+
+namespace Linux {
+
+void
+DebugPrintkEvent::process(ExecContext *xc)
+{
+ if (DTRACE(DebugPrintf)) {
+ if (!raw) {
+ StringWrap name(xc->system->name() + ".dprintk");
+ DPRINTFN("");
+ }
+
+ AlphaArguments args(xc);
+ Printk(args);
+ SkipFuncEvent::process(xc);
+ }
+}
+
+} // namespace linux
diff --git a/kern/linux/events.hh b/kern/linux/events.hh
new file mode 100644
index 000000000..95c268976
--- /dev/null
+++ b/kern/linux/events.hh
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2004-2006 The Regents of The University of Michigan
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met: redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer;
+ * redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution;
+ * neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef __KERN_LINUX_EVENTS_HH__
+#define __KERN_LINUX_EVENTS_HH__
+
+#include "kern/system_events.hh"
+
+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) {}
+ virtual void process(ExecContext *xc);
+};
+
+}
+
+#endif
diff --git a/kern/tru64/tru64.hh b/kern/tru64/tru64.hh
index ad568cb0c..9c541ae1a 100644
--- a/kern/tru64/tru64.hh
+++ b/kern/tru64/tru64.hh
@@ -155,15 +155,16 @@ class Tru64 {
/// implementing another set of stat functions using the old
/// structure definition and binding them to the old syscall
/// numbers.
+
struct pre_F64_stat {
dev_t st_dev;
ino_t st_ino;
mode_t st_mode;
nlink_t st_nlink;
- uid_t st_uid;
+ uid_t st_uid __attribute__ ((aligned(sizeof(uid_t))));
gid_t st_gid;
dev_t st_rdev;
- off_t st_size;
+ off_t st_size __attribute__ ((aligned(sizeof(off_t))));
time_t st_atimeX;
int32_t st_uatime;
time_t st_mtimeX;
diff --git a/python/m5/objects/System.py b/python/m5/objects/System.py
index 6d1d6a68c..5925cadf5 100644
--- a/python/m5/objects/System.py
+++ b/python/m5/objects/System.py
@@ -1,17 +1,21 @@
from m5 import *
+
class System(SimObject):
type = 'System'
boot_cpu_frequency = Param.Frequency(Self.cpu[0].clock.frequency,
"boot processor frequency")
memctrl = Param.MemoryController(Parent.any, "memory controller")
physmem = Param.PhysicalMemory(Parent.any, "phsyical memory")
+ init_param = Param.UInt64(0, "numerical value to pass into simulator")
+ bin = Param.Bool(False, "is this system binned")
+ binned_fns = VectorParam.String([], "functions broken down and binned")
kernel = Param.String("file that contains the kernel code")
+ readfile = Param.String("", "file to read startup script from")
+
+class AlphaSystem(System):
+ type = 'AlphaSystem'
console = Param.String("file that contains the console code")
pal = Param.String("file that contains palcode")
- readfile = Param.String("", "file to read startup script from")
- init_param = Param.UInt64(0, "numerical value to pass into simulator")
boot_osflags = Param.String("a", "boot flags to pass to the kernel")
system_type = Param.UInt64("Type of system we are emulating")
system_rev = Param.UInt64("Revision of system we are emulating")
- bin = Param.Bool(False, "is this system binned")
- binned_fns = VectorParam.String([], "functions broken down and binned")
diff --git a/sim/syscall_emul.hh b/sim/syscall_emul.hh
index f49248dea..eca9f79e0 100644
--- a/sim/syscall_emul.hh
+++ b/sim/syscall_emul.hh
@@ -380,7 +380,7 @@ chmodFunc(SyscallDesc *desc, int callnum, Process *process,
// do the chmod
int result = chmod(path.c_str(), hostMode);
if (result < 0)
- return errno;
+ return -errno;
return 0;
}
@@ -407,7 +407,7 @@ fchmodFunc(SyscallDesc *desc, int callnum, Process *process,
// do the fchmod
int result = fchmod(process->sim_fd(fd), hostMode);
if (result < 0)
- return errno;
+ return -errno;
return 0;
}
@@ -428,7 +428,7 @@ statFunc(SyscallDesc *desc, int callnum, Process *process,
int result = stat(path.c_str(), &hostBuf);
if (result < 0)
- return errno;
+ return -errno;
OS::copyOutStatBuf(xc->mem, xc->getSyscallArg(1), &hostBuf);
@@ -457,7 +457,7 @@ fstat64Func(SyscallDesc *desc, int callnum, Process *process,
#endif
if (result < 0)
- return errno;
+ return -errno;
OS::copyOutStat64Buf(xc->mem, fd, xc->getSyscallArg(1), &hostBuf);
@@ -553,7 +553,7 @@ statfsFunc(SyscallDesc *desc, int callnum, Process *process,
int result = statfs(path.c_str(), &hostBuf);
if (result < 0)
- return errno;
+ return -errno;
OS::copyOutStatfsBuf(xc->mem, xc->getSyscallArg(1), &hostBuf);
@@ -576,7 +576,7 @@ fstatfsFunc(SyscallDesc *desc, int callnum, Process *process,
int result = fstatfs(fd, &hostBuf);
if (result < 0)
- return errno;
+ return -errno;
OS::copyOutStatfsBuf(xc->mem, xc->getSyscallArg(1), &hostBuf);
@@ -618,7 +618,7 @@ writevFunc(SyscallDesc *desc, int callnum, Process *process,
}
if (result < 0)
- return errno;
+ return -errno;
return 0;
}