diff options
Diffstat (limited to 'arch/alpha')
-rw-r--r-- | arch/alpha/SConscript | 8 | ||||
-rw-r--r-- | arch/alpha/faults.cc | 74 | ||||
-rw-r--r-- | arch/alpha/faults.hh | 67 | ||||
-rw-r--r-- | arch/alpha/linux/process.cc (renamed from arch/alpha/linux_process.cc) | 2 | ||||
-rw-r--r-- | arch/alpha/linux/process.hh (renamed from arch/alpha/linux_process.hh) | 0 | ||||
-rw-r--r-- | arch/alpha/process.hh | 4 | ||||
-rw-r--r-- | arch/alpha/system.cc | 1 | ||||
-rw-r--r-- | arch/alpha/tru64/process.cc (renamed from arch/alpha/tru64_process.cc) | 2 | ||||
-rw-r--r-- | arch/alpha/tru64/process.hh (renamed from arch/alpha/tru64_process.hh) | 0 |
9 files changed, 64 insertions, 94 deletions
diff --git a/arch/alpha/SConscript b/arch/alpha/SConscript index 03d73eef7..6dec2d070 100644 --- a/arch/alpha/SConscript +++ b/arch/alpha/SConscript @@ -56,14 +56,18 @@ full_system_sources = Split(''' osfpal.cc stacktrace.cc vtophys.cc + system.cc + freebsd/system.cc + linux/system.cc + tru64/system.cc ''') # Syscall emulation (non-full-system) sources syscall_emulation_sources = Split(''' common_syscall_emul.cc - linux_process.cc - tru64_process.cc + linux/process.cc + tru64/process.cc process.cc ''') diff --git a/arch/alpha/faults.cc b/arch/alpha/faults.cc index 84f785c0a..75165eece 100644 --- a/arch/alpha/faults.cc +++ b/arch/alpha/faults.cc @@ -30,84 +30,80 @@ #include "cpu/exec_context.hh" #include "cpu/base.hh" #include "base/trace.hh" -#include "kern/kernel_stats.hh" namespace AlphaISA { FaultName MachineCheckFault::_name = "mchk"; FaultVect MachineCheckFault::_vect = 0x0401; -FaultStat MachineCheckFault::_stat; +FaultStat MachineCheckFault::_count; FaultName AlignmentFault::_name = "unalign"; FaultVect AlignmentFault::_vect = 0x0301; -FaultStat AlignmentFault::_stat; +FaultStat AlignmentFault::_count; FaultName ResetFault::_name = "reset"; FaultVect ResetFault::_vect = 0x0001; -FaultStat ResetFault::_stat; +FaultStat ResetFault::_count; FaultName ArithmeticFault::_name = "arith"; FaultVect ArithmeticFault::_vect = 0x0501; -FaultStat ArithmeticFault::_stat; +FaultStat ArithmeticFault::_count; FaultName InterruptFault::_name = "interrupt"; FaultVect InterruptFault::_vect = 0x0101; -FaultStat InterruptFault::_stat; +FaultStat InterruptFault::_count; FaultName NDtbMissFault::_name = "dtb_miss_single"; FaultVect NDtbMissFault::_vect = 0x0201; -FaultStat NDtbMissFault::_stat; +FaultStat NDtbMissFault::_count; FaultName PDtbMissFault::_name = "dtb_miss_double"; FaultVect PDtbMissFault::_vect = 0x0281; -FaultStat PDtbMissFault::_stat; +FaultStat PDtbMissFault::_count; FaultName DtbPageFault::_name = "dfault"; FaultVect DtbPageFault::_vect = 0x0381; -FaultStat DtbPageFault::_stat; +FaultStat DtbPageFault::_count; FaultName DtbAcvFault::_name = "dfault"; FaultVect DtbAcvFault::_vect = 0x0381; -FaultStat DtbAcvFault::_stat; +FaultStat DtbAcvFault::_count; FaultName ItbMissFault::_name = "itbmiss"; FaultVect ItbMissFault::_vect = 0x0181; -FaultStat ItbMissFault::_stat; +FaultStat ItbMissFault::_count; FaultName ItbPageFault::_name = "itbmiss"; FaultVect ItbPageFault::_vect = 0x0181; -FaultStat ItbPageFault::_stat; +FaultStat ItbPageFault::_count; FaultName ItbAcvFault::_name = "iaccvio"; FaultVect ItbAcvFault::_vect = 0x0081; -FaultStat ItbAcvFault::_stat; +FaultStat ItbAcvFault::_count; FaultName UnimplementedOpcodeFault::_name = "opdec"; FaultVect UnimplementedOpcodeFault::_vect = 0x0481; -FaultStat UnimplementedOpcodeFault::_stat; +FaultStat UnimplementedOpcodeFault::_count; FaultName FloatEnableFault::_name = "fen"; FaultVect FloatEnableFault::_vect = 0x0581; -FaultStat FloatEnableFault::_stat; +FaultStat FloatEnableFault::_count; FaultName PalFault::_name = "pal"; FaultVect PalFault::_vect = 0x2001; -FaultStat PalFault::_stat; +FaultStat PalFault::_count; FaultName IntegerOverflowFault::_name = "intover"; FaultVect IntegerOverflowFault::_vect = 0x0501; -FaultStat IntegerOverflowFault::_stat; +FaultStat IntegerOverflowFault::_count; #if FULL_SYSTEM void AlphaFault::invoke(ExecContext * xc) { - DPRINTF(Fault, "Fault %s at PC: %#x\n", name(), xc->regs.pc); - xc->cpu->recordEvent(csprintf("Fault %s", name())); - - assert(!xc->misspeculating()); - xc->kernelStats->fault(this); + FaultBase::invoke(xc); + countStat()++; // exception restart address if (setRestartAddress() || !xc->inPalMode()) @@ -125,43 +121,11 @@ void AlphaFault::invoke(ExecContext * xc) void ArithmeticFault::invoke(ExecContext * xc) { - DPRINTF(Fault, "Fault %s at PC: %#x\n", name(), xc->regs.pc); - xc->cpu->recordEvent(csprintf("Fault %s", name())); - - assert(!xc->misspeculating()); - xc->kernelStats->fault(this); - + FaultBase::invoke(xc); panic("Arithmetic traps are unimplemented!"); } - -/*void ArithmeticFault::invoke(ExecContext * xc) -{ - panic("Arithmetic traps are unimplemented!"); -}*/ - #endif } // namespace AlphaISA -/*Fault * ListOfFaults[] = { - (Fault *)&NoFault, - (Fault *)&ResetFault, - (Fault *)&MachineCheckFault, - (Fault *)&ArithmeticFault, - (Fault *)&InterruptFault, - (Fault *)&NDtbMissFault, - (Fault *)&PDtbMissFault, - (Fault *)&AlignmentFault, - (Fault *)&DtbPageFault, - (Fault *)&DtbAcvFault, - (Fault *)&ItbMissFault, - (Fault *)&ItbPageFault, - (Fault *)&ItbAcvFault, - (Fault *)&UnimplementedOpcodeFault, - (Fault *)&FloatEnableFault, - (Fault *)&PalFault, - (Fault *)&IntegerOverflowFault, - }; - -int NumFaults = sizeof(ListOfFaults) / sizeof(Fault *);*/ diff --git a/arch/alpha/faults.hh b/arch/alpha/faults.hh index c4a72e07c..1a196cc94 100644 --- a/arch/alpha/faults.hh +++ b/arch/alpha/faults.hh @@ -38,7 +38,7 @@ namespace AlphaISA typedef const Addr FaultVect; -class AlphaFault : public virtual FaultBase +class AlphaFault : public FaultBase { protected: virtual bool skipFaultingInstruction() {return false;} @@ -48,6 +48,7 @@ class AlphaFault : public virtual FaultBase void invoke(ExecContext * xc); #endif virtual FaultVect vect() = 0; + virtual FaultStat & countStat() = 0; }; class MachineCheckFault : public AlphaFault @@ -55,11 +56,11 @@ class MachineCheckFault : public AlphaFault private: static FaultName _name; static FaultVect _vect; - static FaultStat _stat; + static FaultStat _count; public: FaultName name() {return _name;} FaultVect vect() {return _vect;} - FaultStat & stat() {return _stat;} + FaultStat & countStat() {return _count;} bool isMachineCheckFault() {return true;} }; @@ -68,11 +69,11 @@ class AlignmentFault : public AlphaFault private: static FaultName _name; static FaultVect _vect; - static FaultStat _stat; + static FaultStat _count; public: FaultName name() {return _name;} FaultVect vect() {return _vect;} - FaultStat & stat() {return _stat;} + FaultStat & countStat() {return _count;} bool isAlignmentFault() {return true;} }; @@ -91,11 +92,11 @@ class ResetFault : public AlphaFault private: static FaultName _name; static FaultVect _vect; - static FaultStat _stat; + static FaultStat _count; public: FaultName name() {return _name;} FaultVect vect() {return _vect;} - FaultStat & stat() {return _stat;} + FaultStat & countStat() {return _count;} }; class ArithmeticFault : public AlphaFault @@ -105,11 +106,11 @@ class ArithmeticFault : public AlphaFault private: static FaultName _name; static FaultVect _vect; - static FaultStat _stat; + static FaultStat _count; public: FaultName name() {return _name;} FaultVect vect() {return _vect;} - FaultStat & stat() {return _stat;} + FaultStat & countStat() {return _count;} #if FULL_SYSTEM void invoke(ExecContext * xc); #endif @@ -122,11 +123,11 @@ class InterruptFault : public AlphaFault private: static FaultName _name; static FaultVect _vect; - static FaultStat _stat; + static FaultStat _count; public: FaultName name() {return _name;} FaultVect vect() {return _vect;} - FaultStat & stat() {return _stat;} + FaultStat & countStat() {return _count;} }; class NDtbMissFault : public AlphaFault @@ -134,11 +135,11 @@ class NDtbMissFault : public AlphaFault private: static FaultName _name; static FaultVect _vect; - static FaultStat _stat; + static FaultStat _count; public: FaultName name() {return _name;} FaultVect vect() {return _vect;} - FaultStat & stat() {return _stat;} + FaultStat & countStat() {return _count;} }; class PDtbMissFault : public AlphaFault @@ -146,11 +147,11 @@ class PDtbMissFault : public AlphaFault private: static FaultName _name; static FaultVect _vect; - static FaultStat _stat; + static FaultStat _count; public: FaultName name() {return _name;} FaultVect vect() {return _vect;} - FaultStat & stat() {return _stat;} + FaultStat & countStat() {return _count;} }; class DtbPageFault : public AlphaFault @@ -158,11 +159,11 @@ class DtbPageFault : public AlphaFault private: static FaultName _name; static FaultVect _vect; - static FaultStat _stat; + static FaultStat _count; public: FaultName name() {return _name;} FaultVect vect() {return _vect;} - FaultStat & stat() {return _stat;} + FaultStat & countStat() {return _count;} }; class DtbAcvFault : public AlphaFault @@ -170,11 +171,11 @@ class DtbAcvFault : public AlphaFault private: static FaultName _name; static FaultVect _vect; - static FaultStat _stat; + static FaultStat _count; public: FaultName name() {return _name;} FaultVect vect() {return _vect;} - FaultStat & stat() {return _stat;} + FaultStat & countStat() {return _count;} }; class ItbMissFault : public AlphaFault @@ -182,11 +183,11 @@ class ItbMissFault : public AlphaFault private: static FaultName _name; static FaultVect _vect; - static FaultStat _stat; + static FaultStat _count; public: FaultName name() {return _name;} FaultVect vect() {return _vect;} - FaultStat & stat() {return _stat;} + FaultStat & countStat() {return _count;} }; class ItbPageFault : public AlphaFault @@ -194,11 +195,11 @@ class ItbPageFault : public AlphaFault private: static FaultName _name; static FaultVect _vect; - static FaultStat _stat; + static FaultStat _count; public: FaultName name() {return _name;} FaultVect vect() {return _vect;} - FaultStat & stat() {return _stat;} + FaultStat & countStat() {return _count;} }; class ItbAcvFault : public AlphaFault @@ -206,11 +207,11 @@ class ItbAcvFault : public AlphaFault private: static FaultName _name; static FaultVect _vect; - static FaultStat _stat; + static FaultStat _count; public: FaultName name() {return _name;} FaultVect vect() {return _vect;} - FaultStat & stat() {return _stat;} + FaultStat & countStat() {return _count;} }; class UnimplementedOpcodeFault : public AlphaFault @@ -218,11 +219,11 @@ class UnimplementedOpcodeFault : public AlphaFault private: static FaultName _name; static FaultVect _vect; - static FaultStat _stat; + static FaultStat _count; public: FaultName name() {return _name;} FaultVect vect() {return _vect;} - FaultStat & stat() {return _stat;} + FaultStat & countStat() {return _count;} }; class FloatEnableFault : public AlphaFault @@ -230,11 +231,11 @@ class FloatEnableFault : public AlphaFault private: static FaultName _name; static FaultVect _vect; - static FaultStat _stat; + static FaultStat _count; public: FaultName name() {return _name;} FaultVect vect() {return _vect;} - FaultStat & stat() {return _stat;} + FaultStat & countStat() {return _count;} }; class PalFault : public AlphaFault @@ -244,11 +245,11 @@ class PalFault : public AlphaFault private: static FaultName _name; static FaultVect _vect; - static FaultStat _stat; + static FaultStat _count; public: FaultName name() {return _name;} FaultVect vect() {return _vect;} - FaultStat & stat() {return _stat;} + FaultStat & countStat() {return _count;} }; class IntegerOverflowFault : public AlphaFault @@ -256,11 +257,11 @@ class IntegerOverflowFault : public AlphaFault private: static FaultName _name; static FaultVect _vect; - static FaultStat _stat; + static FaultStat _count; public: FaultName name() {return _name;} FaultVect vect() {return _vect;} - FaultStat & stat() {return _stat;} + FaultStat & countStat() {return _count;} }; } // AlphaISA namespace diff --git a/arch/alpha/linux_process.cc b/arch/alpha/linux/process.cc index 0b193fb55..d78e6a4ee 100644 --- a/arch/alpha/linux_process.cc +++ b/arch/alpha/linux/process.cc @@ -27,7 +27,7 @@ */ #include "arch/alpha/common_syscall_emul.hh" -#include "arch/alpha/linux_process.hh" +#include "arch/alpha/linux/process.hh" #include "arch/alpha/isa_traits.hh" #include "base/trace.hh" diff --git a/arch/alpha/linux_process.hh b/arch/alpha/linux/process.hh index 7de1b1ac1..7de1b1ac1 100644 --- a/arch/alpha/linux_process.hh +++ b/arch/alpha/linux/process.hh diff --git a/arch/alpha/process.hh b/arch/alpha/process.hh index 7b660ddd0..4a2a4212e 100644 --- a/arch/alpha/process.hh +++ b/arch/alpha/process.hh @@ -31,8 +31,8 @@ #include <string> -#include "arch/alpha/linux_process.hh" -#include "arch/alpha/tru64_process.hh" +#include "arch/alpha/linux/process.hh" +#include "arch/alpha/tru64/process.hh" #include "base/loader/object_file.hh" namespace AlphaISA diff --git a/arch/alpha/system.cc b/arch/alpha/system.cc index 1e80c7768..25543da57 100644 --- a/arch/alpha/system.cc +++ b/arch/alpha/system.cc @@ -37,6 +37,7 @@ #include "sim/byteswap.hh" #include "sim/builder.hh" + using namespace LittleEndianGuest; AlphaSystem::AlphaSystem(Params *p) diff --git a/arch/alpha/tru64_process.cc b/arch/alpha/tru64/process.cc index 90e8b1139..58d41e3ef 100644 --- a/arch/alpha/tru64_process.cc +++ b/arch/alpha/tru64/process.cc @@ -28,7 +28,7 @@ #include "arch/alpha/isa_traits.hh" #include "arch/alpha/common_syscall_emul.hh" -#include "arch/alpha/tru64_process.hh" +#include "arch/alpha/tru64/process.hh" #include "cpu/exec_context.hh" #include "kern/tru64/tru64.hh" #include "mem/functional/functional.hh" diff --git a/arch/alpha/tru64_process.hh b/arch/alpha/tru64/process.hh index 051760702..051760702 100644 --- a/arch/alpha/tru64_process.hh +++ b/arch/alpha/tru64/process.hh |