Moved where some alpha specific source files were mentioned to be in the alpha specific Sconscript, and took advantage of the os specific directories for the process files.
arch/sparc/faults.cc:
Remove fake fault, fix to have normal m5 line length limit, and change pointers to be const pointers so that the default faults aren't changed accidentally.
arch/sparc/faults.hh:
Fix to have normal m5 line length limit, change pointers to const pointers.
arch/sparc/faults.hh:
Added a typedef for the Addr type, and changed the formatting of the faults slightly.
arch/sparc/faults.hh:
ur
Using cleaned up fault class deiffinitions
arch/sparc/faults.hh:
Added typedef for Addr
arch/sparc/faults.hh:
Made Addr a global type
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Changed Fault * to Fault, which is a typedef to FaultBase *, which is the old Fault class renamed.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Changed Fault to be a RefCountingPtr
arch/sparc/faults.cc:
arch/sparc/faults.hh:
MachineCheckFaults and AlignmentFaults are now generated by the ISA, rather than being created directly.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Put the Alpha faults into the AlphaISA namespace
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Moved the _stat for MachineCheckFault and AlignmentFault into the isa specific classes to prevent instantiation of the generic classes.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Changed ev5_trap from a function of the execution context to a function of the fault. The actual function still resides in the execution context.
arch/sparc/faults.cc:
AlphaFault is now an abstract class.
arch/sparc/faults.hh:
AlphaFault is now an abstract class. Also, AlphaMachineCheckFault and AlphaAlignmentFault multiply inherit from both AlphaFault and from MachineCheckFault and AlignmentFault respectively. These classes get their name from the generic classes.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
moved ev5_trap fully into the fault class.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Changed the name of the fault's invocation method from ev5_trap to invoke.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Moved the fault invocation code into the fault class fully, and got rid of the need for isA.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Got rid of the multiple inheritance in the Fault classes, and the base MachineCheck and Alignment faults.
arch/sparc/faults.cc:
bk cp ../alpha/faults.cc faults.cc
arch/sparc/faults.hh:
bk cp ../alpha/faults.hh faults.hh
SConscript:
Moved the alpha specific source files into the alpha specific SConscript
arch/alpha/SConscript:
Moved the alpha specific source files into the alpha specific SConscript, and moved the process files into the new os specific subfolders.
arch/alpha/linux/process.cc:
arch/alpha/process.hh:
arch/sparc/process.hh:
arch/alpha/tru64/process.cc:
Changed the include paths to use the new os specific directories.
--HG--
rename : arch/alpha/linux_process.cc => arch/alpha/linux/process.cc
rename : arch/alpha/linux_process.hh => arch/alpha/linux/process.hh
rename : arch/alpha/tru64_process.cc => arch/alpha/tru64/process.cc
rename : arch/alpha/tru64_process.hh => arch/alpha/tru64/process.hh
rename : arch/sparc/linux_process.cc => arch/sparc/linux/process.cc
rename : arch/sparc/linux_process.hh => arch/sparc/linux/process.hh
extra : convert_revision : dc7eed7994b9c5e7308c771f43758292e78ce3e3
2006-03-07 10:25:42 +01:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2003-2005 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.
|
2006-06-01 01:26:56 +02:00
|
|
|
*
|
|
|
|
* Authors: Gabe Black
|
|
|
|
* Kevin Lim
|
Moved where some alpha specific source files were mentioned to be in the alpha specific Sconscript, and took advantage of the os specific directories for the process files.
arch/sparc/faults.cc:
Remove fake fault, fix to have normal m5 line length limit, and change pointers to be const pointers so that the default faults aren't changed accidentally.
arch/sparc/faults.hh:
Fix to have normal m5 line length limit, change pointers to const pointers.
arch/sparc/faults.hh:
Added a typedef for the Addr type, and changed the formatting of the faults slightly.
arch/sparc/faults.hh:
ur
Using cleaned up fault class deiffinitions
arch/sparc/faults.hh:
Added typedef for Addr
arch/sparc/faults.hh:
Made Addr a global type
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Changed Fault * to Fault, which is a typedef to FaultBase *, which is the old Fault class renamed.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Changed Fault to be a RefCountingPtr
arch/sparc/faults.cc:
arch/sparc/faults.hh:
MachineCheckFaults and AlignmentFaults are now generated by the ISA, rather than being created directly.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Put the Alpha faults into the AlphaISA namespace
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Moved the _stat for MachineCheckFault and AlignmentFault into the isa specific classes to prevent instantiation of the generic classes.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Changed ev5_trap from a function of the execution context to a function of the fault. The actual function still resides in the execution context.
arch/sparc/faults.cc:
AlphaFault is now an abstract class.
arch/sparc/faults.hh:
AlphaFault is now an abstract class. Also, AlphaMachineCheckFault and AlphaAlignmentFault multiply inherit from both AlphaFault and from MachineCheckFault and AlignmentFault respectively. These classes get their name from the generic classes.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
moved ev5_trap fully into the fault class.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Changed the name of the fault's invocation method from ev5_trap to invoke.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Moved the fault invocation code into the fault class fully, and got rid of the need for isA.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Got rid of the multiple inheritance in the Fault classes, and the base MachineCheck and Alignment faults.
arch/sparc/faults.cc:
bk cp ../alpha/faults.cc faults.cc
arch/sparc/faults.hh:
bk cp ../alpha/faults.hh faults.hh
SConscript:
Moved the alpha specific source files into the alpha specific SConscript
arch/alpha/SConscript:
Moved the alpha specific source files into the alpha specific SConscript, and moved the process files into the new os specific subfolders.
arch/alpha/linux/process.cc:
arch/alpha/process.hh:
arch/sparc/process.hh:
arch/alpha/tru64/process.cc:
Changed the include paths to use the new os specific directories.
--HG--
rename : arch/alpha/linux_process.cc => arch/alpha/linux/process.cc
rename : arch/alpha/linux_process.hh => arch/alpha/linux/process.hh
rename : arch/alpha/tru64_process.cc => arch/alpha/tru64/process.cc
rename : arch/alpha/tru64_process.hh => arch/alpha/tru64/process.hh
rename : arch/sparc/linux_process.cc => arch/sparc/linux/process.cc
rename : arch/sparc/linux_process.hh => arch/sparc/linux/process.hh
extra : convert_revision : dc7eed7994b9c5e7308c771f43758292e78ce3e3
2006-03-07 10:25:42 +01:00
|
|
|
*/
|
|
|
|
|
2006-10-25 23:49:41 +02:00
|
|
|
#include <algorithm>
|
|
|
|
|
2006-03-07 10:32:34 +01:00
|
|
|
#include "arch/sparc/faults.hh"
|
2006-10-25 23:49:41 +02:00
|
|
|
#include "arch/sparc/isa_traits.hh"
|
|
|
|
#include "base/bitfield.hh"
|
Moved where some alpha specific source files were mentioned to be in the alpha specific Sconscript, and took advantage of the os specific directories for the process files.
arch/sparc/faults.cc:
Remove fake fault, fix to have normal m5 line length limit, and change pointers to be const pointers so that the default faults aren't changed accidentally.
arch/sparc/faults.hh:
Fix to have normal m5 line length limit, change pointers to const pointers.
arch/sparc/faults.hh:
Added a typedef for the Addr type, and changed the formatting of the faults slightly.
arch/sparc/faults.hh:
ur
Using cleaned up fault class deiffinitions
arch/sparc/faults.hh:
Added typedef for Addr
arch/sparc/faults.hh:
Made Addr a global type
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Changed Fault * to Fault, which is a typedef to FaultBase *, which is the old Fault class renamed.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Changed Fault to be a RefCountingPtr
arch/sparc/faults.cc:
arch/sparc/faults.hh:
MachineCheckFaults and AlignmentFaults are now generated by the ISA, rather than being created directly.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Put the Alpha faults into the AlphaISA namespace
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Moved the _stat for MachineCheckFault and AlignmentFault into the isa specific classes to prevent instantiation of the generic classes.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Changed ev5_trap from a function of the execution context to a function of the fault. The actual function still resides in the execution context.
arch/sparc/faults.cc:
AlphaFault is now an abstract class.
arch/sparc/faults.hh:
AlphaFault is now an abstract class. Also, AlphaMachineCheckFault and AlphaAlignmentFault multiply inherit from both AlphaFault and from MachineCheckFault and AlignmentFault respectively. These classes get their name from the generic classes.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
moved ev5_trap fully into the fault class.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Changed the name of the fault's invocation method from ev5_trap to invoke.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Moved the fault invocation code into the fault class fully, and got rid of the need for isA.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Got rid of the multiple inheritance in the Fault classes, and the base MachineCheck and Alignment faults.
arch/sparc/faults.cc:
bk cp ../alpha/faults.cc faults.cc
arch/sparc/faults.hh:
bk cp ../alpha/faults.hh faults.hh
SConscript:
Moved the alpha specific source files into the alpha specific SConscript
arch/alpha/SConscript:
Moved the alpha specific source files into the alpha specific SConscript, and moved the process files into the new os specific subfolders.
arch/alpha/linux/process.cc:
arch/alpha/process.hh:
arch/sparc/process.hh:
arch/alpha/tru64/process.cc:
Changed the include paths to use the new os specific directories.
--HG--
rename : arch/alpha/linux_process.cc => arch/alpha/linux/process.cc
rename : arch/alpha/linux_process.hh => arch/alpha/linux/process.hh
rename : arch/alpha/tru64_process.cc => arch/alpha/tru64/process.cc
rename : arch/alpha/tru64_process.hh => arch/alpha/tru64/process.hh
rename : arch/sparc/linux_process.cc => arch/sparc/linux/process.cc
rename : arch/sparc/linux_process.hh => arch/sparc/linux/process.hh
extra : convert_revision : dc7eed7994b9c5e7308c771f43758292e78ce3e3
2006-03-07 10:25:42 +01:00
|
|
|
#include "base/trace.hh"
|
2006-11-03 16:54:34 +01:00
|
|
|
#include "config/full_system.hh"
|
2006-10-25 23:49:41 +02:00
|
|
|
#include "cpu/base.hh"
|
|
|
|
#include "cpu/thread_context.hh"
|
2006-06-26 22:49:05 +02:00
|
|
|
#if !FULL_SYSTEM
|
2006-11-03 16:54:34 +01:00
|
|
|
#include "arch/sparc/process.hh"
|
2006-06-26 22:49:05 +02:00
|
|
|
#include "mem/page_table.hh"
|
2006-10-25 23:49:41 +02:00
|
|
|
#include "sim/process.hh"
|
2006-06-26 22:49:05 +02:00
|
|
|
#endif
|
Moved where some alpha specific source files were mentioned to be in the alpha specific Sconscript, and took advantage of the os specific directories for the process files.
arch/sparc/faults.cc:
Remove fake fault, fix to have normal m5 line length limit, and change pointers to be const pointers so that the default faults aren't changed accidentally.
arch/sparc/faults.hh:
Fix to have normal m5 line length limit, change pointers to const pointers.
arch/sparc/faults.hh:
Added a typedef for the Addr type, and changed the formatting of the faults slightly.
arch/sparc/faults.hh:
ur
Using cleaned up fault class deiffinitions
arch/sparc/faults.hh:
Added typedef for Addr
arch/sparc/faults.hh:
Made Addr a global type
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Changed Fault * to Fault, which is a typedef to FaultBase *, which is the old Fault class renamed.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Changed Fault to be a RefCountingPtr
arch/sparc/faults.cc:
arch/sparc/faults.hh:
MachineCheckFaults and AlignmentFaults are now generated by the ISA, rather than being created directly.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Put the Alpha faults into the AlphaISA namespace
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Moved the _stat for MachineCheckFault and AlignmentFault into the isa specific classes to prevent instantiation of the generic classes.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Changed ev5_trap from a function of the execution context to a function of the fault. The actual function still resides in the execution context.
arch/sparc/faults.cc:
AlphaFault is now an abstract class.
arch/sparc/faults.hh:
AlphaFault is now an abstract class. Also, AlphaMachineCheckFault and AlphaAlignmentFault multiply inherit from both AlphaFault and from MachineCheckFault and AlignmentFault respectively. These classes get their name from the generic classes.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
moved ev5_trap fully into the fault class.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Changed the name of the fault's invocation method from ev5_trap to invoke.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Moved the fault invocation code into the fault class fully, and got rid of the need for isA.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Got rid of the multiple inheritance in the Fault classes, and the base MachineCheck and Alignment faults.
arch/sparc/faults.cc:
bk cp ../alpha/faults.cc faults.cc
arch/sparc/faults.hh:
bk cp ../alpha/faults.hh faults.hh
SConscript:
Moved the alpha specific source files into the alpha specific SConscript
arch/alpha/SConscript:
Moved the alpha specific source files into the alpha specific SConscript, and moved the process files into the new os specific subfolders.
arch/alpha/linux/process.cc:
arch/alpha/process.hh:
arch/sparc/process.hh:
arch/alpha/tru64/process.cc:
Changed the include paths to use the new os specific directories.
--HG--
rename : arch/alpha/linux_process.cc => arch/alpha/linux/process.cc
rename : arch/alpha/linux_process.hh => arch/alpha/linux/process.hh
rename : arch/alpha/tru64_process.cc => arch/alpha/tru64/process.cc
rename : arch/alpha/tru64_process.hh => arch/alpha/tru64/process.hh
rename : arch/sparc/linux_process.cc => arch/sparc/linux/process.cc
rename : arch/sparc/linux_process.hh => arch/sparc/linux/process.hh
extra : convert_revision : dc7eed7994b9c5e7308c771f43758292e78ce3e3
2006-03-07 10:25:42 +01:00
|
|
|
|
2006-10-25 23:49:41 +02:00
|
|
|
using namespace std;
|
|
|
|
|
2006-03-07 10:32:34 +01:00
|
|
|
namespace SparcISA
|
Moved where some alpha specific source files were mentioned to be in the alpha specific Sconscript, and took advantage of the os specific directories for the process files.
arch/sparc/faults.cc:
Remove fake fault, fix to have normal m5 line length limit, and change pointers to be const pointers so that the default faults aren't changed accidentally.
arch/sparc/faults.hh:
Fix to have normal m5 line length limit, change pointers to const pointers.
arch/sparc/faults.hh:
Added a typedef for the Addr type, and changed the formatting of the faults slightly.
arch/sparc/faults.hh:
ur
Using cleaned up fault class deiffinitions
arch/sparc/faults.hh:
Added typedef for Addr
arch/sparc/faults.hh:
Made Addr a global type
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Changed Fault * to Fault, which is a typedef to FaultBase *, which is the old Fault class renamed.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Changed Fault to be a RefCountingPtr
arch/sparc/faults.cc:
arch/sparc/faults.hh:
MachineCheckFaults and AlignmentFaults are now generated by the ISA, rather than being created directly.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Put the Alpha faults into the AlphaISA namespace
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Moved the _stat for MachineCheckFault and AlignmentFault into the isa specific classes to prevent instantiation of the generic classes.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Changed ev5_trap from a function of the execution context to a function of the fault. The actual function still resides in the execution context.
arch/sparc/faults.cc:
AlphaFault is now an abstract class.
arch/sparc/faults.hh:
AlphaFault is now an abstract class. Also, AlphaMachineCheckFault and AlphaAlignmentFault multiply inherit from both AlphaFault and from MachineCheckFault and AlignmentFault respectively. These classes get their name from the generic classes.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
moved ev5_trap fully into the fault class.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Changed the name of the fault's invocation method from ev5_trap to invoke.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Moved the fault invocation code into the fault class fully, and got rid of the need for isA.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Got rid of the multiple inheritance in the Fault classes, and the base MachineCheck and Alignment faults.
arch/sparc/faults.cc:
bk cp ../alpha/faults.cc faults.cc
arch/sparc/faults.hh:
bk cp ../alpha/faults.hh faults.hh
SConscript:
Moved the alpha specific source files into the alpha specific SConscript
arch/alpha/SConscript:
Moved the alpha specific source files into the alpha specific SConscript, and moved the process files into the new os specific subfolders.
arch/alpha/linux/process.cc:
arch/alpha/process.hh:
arch/sparc/process.hh:
arch/alpha/tru64/process.cc:
Changed the include paths to use the new os specific directories.
--HG--
rename : arch/alpha/linux_process.cc => arch/alpha/linux/process.cc
rename : arch/alpha/linux_process.hh => arch/alpha/linux/process.hh
rename : arch/alpha/tru64_process.cc => arch/alpha/tru64/process.cc
rename : arch/alpha/tru64_process.hh => arch/alpha/tru64/process.hh
rename : arch/sparc/linux_process.cc => arch/sparc/linux/process.cc
rename : arch/sparc/linux_process.hh => arch/sparc/linux/process.hh
extra : convert_revision : dc7eed7994b9c5e7308c771f43758292e78ce3e3
2006-03-07 10:25:42 +01:00
|
|
|
{
|
|
|
|
|
2006-11-08 14:12:19 +01:00
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<InternalProcessorError>::vals = {"intprocerr", 0x029, 4};
|
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<MemAddressNotAligned>::vals = {"unalign", 0x034, 10};
|
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<PowerOnReset>::vals = {"pow_reset", 0x001, 0};
|
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<WatchDogReset>::vals = {"watch_dog_reset", 0x002, 1};
|
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<ExternallyInitiatedReset>::vals = {"extern_reset", 0x003, 1};
|
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<SoftwareInitiatedReset>::vals = {"software_reset", 0x004, 1};
|
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<REDStateException>::vals = {"red_counte", 0x005, 1};
|
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<InstructionAccessException>::vals = {"inst_access", 0x008, 5};
|
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<InstructionAccessMMUMiss>::vals = {"inst_mmu", 0x009, 2};
|
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<InstructionAccessError>::vals = {"inst_error", 0x00A, 3};
|
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<IllegalInstruction>::vals = {"illegal_inst", 0x010, 7};
|
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<PrivilegedOpcode>::vals = {"priv_opcode", 0x011, 6};
|
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<UnimplementedLDD>::vals = {"unimp_ldd", 0x012, 6};
|
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<UnimplementedSTD>::vals = {"unimp_std", 0x013, 6};
|
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<FpDisabled>::vals = {"fp_disabled", 0x020, 8};
|
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<FpExceptionIEEE754>::vals = {"fp_754", 0x021, 11};
|
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<FpExceptionOther>::vals = {"fp_other", 0x022, 11};
|
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<TagOverflow>::vals = {"tag_overflow", 0x023, 14};
|
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<DivisionByZero>::vals = {"div_by_zero", 0x028, 15};
|
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<DataAccessException>::vals = {"data_access", 0x030, 12};
|
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<DataAccessMMUMiss>::vals = {"data_mmu", 0x031, 12};
|
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<DataAccessError>::vals = {"data_error", 0x032, 12};
|
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<DataAccessProtection>::vals = {"data_protection", 0x033, 12};
|
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<LDDFMemAddressNotAligned>::vals = {"unalign_lddf", 0x035, 10};
|
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<STDFMemAddressNotAligned>::vals = {"unalign_stdf", 0x036, 10};
|
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<PrivilegedAction>::vals = {"priv_action", 0x037, 11};
|
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<LDQFMemAddressNotAligned>::vals = {"unalign_ldqf", 0x038, 10};
|
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<STQFMemAddressNotAligned>::vals = {"unalign_stqf", 0x039, 10};
|
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<AsyncDataError>::vals = {"async_data", 0x040, 2};
|
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<CleanWindow>::vals = {"clean_win", 0x024, 10};
|
2006-03-07 10:32:34 +01:00
|
|
|
|
2006-04-06 20:53:14 +02:00
|
|
|
//The enumerated faults
|
|
|
|
|
2006-11-08 14:12:19 +01:00
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<InterruptLevelN>::vals = {"interrupt_n", 0x041, 0};
|
2006-03-07 10:32:34 +01:00
|
|
|
|
2006-11-08 14:12:19 +01:00
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<SpillNNormal>::vals = {"spill_n_normal", 0x080, 9};
|
2006-03-07 10:32:34 +01:00
|
|
|
|
2006-11-08 14:12:19 +01:00
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<SpillNOther>::vals = {"spill_n_other", 0x0A0, 9};
|
2006-03-07 10:32:34 +01:00
|
|
|
|
2006-11-08 14:12:19 +01:00
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<FillNNormal>::vals = {"fill_n_normal", 0x0C0, 9};
|
2006-03-07 10:32:34 +01:00
|
|
|
|
2006-11-08 14:12:19 +01:00
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<FillNOther>::vals = {"fill_n_other", 0x0E0, 9};
|
2006-03-07 10:32:34 +01:00
|
|
|
|
2006-11-08 14:12:19 +01:00
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<TrapInstruction>::vals = {"trap_inst_n", 0x100, 16};
|
Moved where some alpha specific source files were mentioned to be in the alpha specific Sconscript, and took advantage of the os specific directories for the process files.
arch/sparc/faults.cc:
Remove fake fault, fix to have normal m5 line length limit, and change pointers to be const pointers so that the default faults aren't changed accidentally.
arch/sparc/faults.hh:
Fix to have normal m5 line length limit, change pointers to const pointers.
arch/sparc/faults.hh:
Added a typedef for the Addr type, and changed the formatting of the faults slightly.
arch/sparc/faults.hh:
ur
Using cleaned up fault class deiffinitions
arch/sparc/faults.hh:
Added typedef for Addr
arch/sparc/faults.hh:
Made Addr a global type
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Changed Fault * to Fault, which is a typedef to FaultBase *, which is the old Fault class renamed.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Changed Fault to be a RefCountingPtr
arch/sparc/faults.cc:
arch/sparc/faults.hh:
MachineCheckFaults and AlignmentFaults are now generated by the ISA, rather than being created directly.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Put the Alpha faults into the AlphaISA namespace
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Moved the _stat for MachineCheckFault and AlignmentFault into the isa specific classes to prevent instantiation of the generic classes.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Changed ev5_trap from a function of the execution context to a function of the fault. The actual function still resides in the execution context.
arch/sparc/faults.cc:
AlphaFault is now an abstract class.
arch/sparc/faults.hh:
AlphaFault is now an abstract class. Also, AlphaMachineCheckFault and AlphaAlignmentFault multiply inherit from both AlphaFault and from MachineCheckFault and AlignmentFault respectively. These classes get their name from the generic classes.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
moved ev5_trap fully into the fault class.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Changed the name of the fault's invocation method from ev5_trap to invoke.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Moved the fault invocation code into the fault class fully, and got rid of the need for isA.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Got rid of the multiple inheritance in the Fault classes, and the base MachineCheck and Alignment faults.
arch/sparc/faults.cc:
bk cp ../alpha/faults.cc faults.cc
arch/sparc/faults.hh:
bk cp ../alpha/faults.hh faults.hh
SConscript:
Moved the alpha specific source files into the alpha specific SConscript
arch/alpha/SConscript:
Moved the alpha specific source files into the alpha specific SConscript, and moved the process files into the new os specific subfolders.
arch/alpha/linux/process.cc:
arch/alpha/process.hh:
arch/sparc/process.hh:
arch/alpha/tru64/process.cc:
Changed the include paths to use the new os specific directories.
--HG--
rename : arch/alpha/linux_process.cc => arch/alpha/linux/process.cc
rename : arch/alpha/linux_process.hh => arch/alpha/linux/process.hh
rename : arch/alpha/tru64_process.cc => arch/alpha/tru64/process.cc
rename : arch/alpha/tru64_process.hh => arch/alpha/tru64/process.hh
rename : arch/sparc/linux_process.cc => arch/sparc/linux/process.cc
rename : arch/sparc/linux_process.hh => arch/sparc/linux/process.hh
extra : convert_revision : dc7eed7994b9c5e7308c771f43758292e78ce3e3
2006-03-07 10:25:42 +01:00
|
|
|
|
2006-06-26 22:49:05 +02:00
|
|
|
#if !FULL_SYSTEM
|
2006-11-08 14:12:19 +01:00
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<PageTableFault>::vals = {"page_table_fault", 0x0000, 0};
|
2006-06-26 22:49:05 +02:00
|
|
|
#endif
|
|
|
|
|
2006-10-25 23:49:41 +02:00
|
|
|
/**
|
|
|
|
* This sets everything up for a normal trap except for actually jumping to
|
|
|
|
* the handler. It will need to be expanded to include the state machine in
|
|
|
|
* the manual. Right now it assumes that traps will always be to the
|
|
|
|
* privileged level.
|
|
|
|
*/
|
|
|
|
|
|
|
|
void doNormalFault(ThreadContext *tc, TrapType tt)
|
|
|
|
{
|
|
|
|
uint64_t TL = tc->readMiscReg(MISCREG_TL);
|
|
|
|
uint64_t TSTATE = tc->readMiscReg(MISCREG_TSTATE);
|
|
|
|
uint64_t PSTATE = tc->readMiscReg(MISCREG_PSTATE);
|
|
|
|
uint64_t HPSTATE = tc->readMiscReg(MISCREG_HPSTATE);
|
|
|
|
uint64_t CCR = tc->readMiscReg(MISCREG_CCR);
|
|
|
|
uint64_t ASI = tc->readMiscReg(MISCREG_ASI);
|
|
|
|
uint64_t CWP = tc->readMiscReg(MISCREG_CWP);
|
|
|
|
uint64_t CANSAVE = tc->readMiscReg(MISCREG_CANSAVE);
|
|
|
|
uint64_t GL = tc->readMiscReg(MISCREG_GL);
|
|
|
|
uint64_t PC = tc->readPC();
|
|
|
|
uint64_t NPC = tc->readNextPC();
|
|
|
|
|
|
|
|
//Increment the trap level
|
|
|
|
TL++;
|
|
|
|
tc->setMiscReg(MISCREG_TL, TL);
|
|
|
|
|
|
|
|
//Save off state
|
|
|
|
|
|
|
|
//set TSTATE.gl to gl
|
|
|
|
replaceBits(TSTATE, 42, 40, GL);
|
|
|
|
//set TSTATE.ccr to ccr
|
|
|
|
replaceBits(TSTATE, 39, 32, CCR);
|
|
|
|
//set TSTATE.asi to asi
|
|
|
|
replaceBits(TSTATE, 31, 24, ASI);
|
|
|
|
//set TSTATE.pstate to pstate
|
|
|
|
replaceBits(TSTATE, 20, 8, PSTATE);
|
|
|
|
//set TSTATE.cwp to cwp
|
|
|
|
replaceBits(TSTATE, 4, 0, CWP);
|
|
|
|
|
|
|
|
//Write back TSTATE
|
|
|
|
tc->setMiscReg(MISCREG_TSTATE, TSTATE);
|
|
|
|
|
|
|
|
//set TPC to PC
|
|
|
|
tc->setMiscReg(MISCREG_TPC, PC);
|
|
|
|
//set TNPC to NPC
|
|
|
|
tc->setMiscReg(MISCREG_TNPC, NPC);
|
|
|
|
|
|
|
|
//set HTSTATE.hpstate to hpstate
|
|
|
|
tc->setMiscReg(MISCREG_HTSTATE, HPSTATE);
|
|
|
|
|
|
|
|
//TT = trap type;
|
|
|
|
tc->setMiscReg(MISCREG_TT, tt);
|
|
|
|
|
|
|
|
//Update the global register level
|
|
|
|
if(1/*We're delivering the trap in priveleged mode*/)
|
2006-11-08 10:18:15 +01:00
|
|
|
tc->setMiscReg(MISCREG_GL, min<int>(GL+1, MaxGL));
|
2006-10-25 23:49:41 +02:00
|
|
|
else
|
2006-11-08 10:18:15 +01:00
|
|
|
tc->setMiscReg(MISCREG_GL, min<int>(GL+1, MaxPGL));
|
2006-10-25 23:49:41 +02:00
|
|
|
|
|
|
|
//PSTATE.mm is unchanged
|
|
|
|
//PSTATE.pef = whether or not an fpu is present
|
|
|
|
//XXX We'll say there's one present, even though there aren't
|
|
|
|
//implementations for a decent number of the instructions
|
|
|
|
PSTATE |= (1 << 4);
|
|
|
|
//PSTATE.am = 0
|
|
|
|
PSTATE &= ~(1 << 3);
|
|
|
|
if(1/*We're delivering the trap in priveleged mode*/)
|
|
|
|
{
|
|
|
|
//PSTATE.priv = 1
|
|
|
|
PSTATE |= (1 << 2);
|
|
|
|
//PSTATE.cle = PSTATE.tle
|
|
|
|
replaceBits(PSTATE, 9, 9, PSTATE >> 8);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
//PSTATE.priv = 0
|
|
|
|
PSTATE &= ~(1 << 2);
|
|
|
|
//PSTATE.cle = 0
|
|
|
|
PSTATE &= ~(1 << 9);
|
|
|
|
}
|
|
|
|
//PSTATE.ie = 0
|
|
|
|
PSTATE &= ~(1 << 1);
|
|
|
|
//PSTATE.tle is unchanged
|
|
|
|
//PSTATE.tct = 0
|
|
|
|
//XXX Where exactly is this field?
|
|
|
|
tc->setMiscReg(MISCREG_PSTATE, PSTATE);
|
|
|
|
|
|
|
|
if(0/*We're delivering the trap in hyperprivileged mode*/)
|
|
|
|
{
|
|
|
|
//HPSTATE.red = 0
|
|
|
|
HPSTATE &= ~(1 << 5);
|
|
|
|
//HPSTATE.hpriv = 1
|
|
|
|
HPSTATE |= (1 << 2);
|
|
|
|
//HPSTATE.ibe = 0
|
|
|
|
HPSTATE &= ~(1 << 10);
|
|
|
|
//HPSTATE.tlz is unchanged
|
|
|
|
tc->setMiscReg(MISCREG_HPSTATE, HPSTATE);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool changedCWP = true;
|
|
|
|
if(tt == 0x24)
|
|
|
|
CWP++;
|
|
|
|
else if(0x80 <= tt && tt <= 0xbf)
|
|
|
|
CWP += (CANSAVE + 2);
|
|
|
|
else if(0xc0 <= tt && tt <= 0xff)
|
|
|
|
CWP--;
|
|
|
|
else
|
|
|
|
changedCWP = false;
|
2006-10-27 02:23:00 +02:00
|
|
|
|
2006-10-25 23:49:41 +02:00
|
|
|
if(changedCWP)
|
|
|
|
{
|
|
|
|
CWP = (CWP + NWindows) % NWindows;
|
|
|
|
tc->setMiscRegWithEffect(MISCREG_CWP, CWP);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Moved where some alpha specific source files were mentioned to be in the alpha specific Sconscript, and took advantage of the os specific directories for the process files.
arch/sparc/faults.cc:
Remove fake fault, fix to have normal m5 line length limit, and change pointers to be const pointers so that the default faults aren't changed accidentally.
arch/sparc/faults.hh:
Fix to have normal m5 line length limit, change pointers to const pointers.
arch/sparc/faults.hh:
Added a typedef for the Addr type, and changed the formatting of the faults slightly.
arch/sparc/faults.hh:
ur
Using cleaned up fault class deiffinitions
arch/sparc/faults.hh:
Added typedef for Addr
arch/sparc/faults.hh:
Made Addr a global type
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Changed Fault * to Fault, which is a typedef to FaultBase *, which is the old Fault class renamed.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Changed Fault to be a RefCountingPtr
arch/sparc/faults.cc:
arch/sparc/faults.hh:
MachineCheckFaults and AlignmentFaults are now generated by the ISA, rather than being created directly.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Put the Alpha faults into the AlphaISA namespace
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Moved the _stat for MachineCheckFault and AlignmentFault into the isa specific classes to prevent instantiation of the generic classes.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Changed ev5_trap from a function of the execution context to a function of the fault. The actual function still resides in the execution context.
arch/sparc/faults.cc:
AlphaFault is now an abstract class.
arch/sparc/faults.hh:
AlphaFault is now an abstract class. Also, AlphaMachineCheckFault and AlphaAlignmentFault multiply inherit from both AlphaFault and from MachineCheckFault and AlignmentFault respectively. These classes get their name from the generic classes.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
moved ev5_trap fully into the fault class.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Changed the name of the fault's invocation method from ev5_trap to invoke.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Moved the fault invocation code into the fault class fully, and got rid of the need for isA.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Got rid of the multiple inheritance in the Fault classes, and the base MachineCheck and Alignment faults.
arch/sparc/faults.cc:
bk cp ../alpha/faults.cc faults.cc
arch/sparc/faults.hh:
bk cp ../alpha/faults.hh faults.hh
SConscript:
Moved the alpha specific source files into the alpha specific SConscript
arch/alpha/SConscript:
Moved the alpha specific source files into the alpha specific SConscript, and moved the process files into the new os specific subfolders.
arch/alpha/linux/process.cc:
arch/alpha/process.hh:
arch/sparc/process.hh:
arch/alpha/tru64/process.cc:
Changed the include paths to use the new os specific directories.
--HG--
rename : arch/alpha/linux_process.cc => arch/alpha/linux/process.cc
rename : arch/alpha/linux_process.hh => arch/alpha/linux/process.hh
rename : arch/alpha/tru64_process.cc => arch/alpha/tru64/process.cc
rename : arch/alpha/tru64_process.hh => arch/alpha/tru64/process.hh
rename : arch/sparc/linux_process.cc => arch/sparc/linux/process.cc
rename : arch/sparc/linux_process.hh => arch/sparc/linux/process.hh
extra : convert_revision : dc7eed7994b9c5e7308c771f43758292e78ce3e3
2006-03-07 10:25:42 +01:00
|
|
|
#if FULL_SYSTEM
|
|
|
|
|
2006-11-08 14:12:19 +01:00
|
|
|
void SparcFaultBase::invoke(ThreadContext * tc)
|
Moved where some alpha specific source files were mentioned to be in the alpha specific Sconscript, and took advantage of the os specific directories for the process files.
arch/sparc/faults.cc:
Remove fake fault, fix to have normal m5 line length limit, and change pointers to be const pointers so that the default faults aren't changed accidentally.
arch/sparc/faults.hh:
Fix to have normal m5 line length limit, change pointers to const pointers.
arch/sparc/faults.hh:
Added a typedef for the Addr type, and changed the formatting of the faults slightly.
arch/sparc/faults.hh:
ur
Using cleaned up fault class deiffinitions
arch/sparc/faults.hh:
Added typedef for Addr
arch/sparc/faults.hh:
Made Addr a global type
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Changed Fault * to Fault, which is a typedef to FaultBase *, which is the old Fault class renamed.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Changed Fault to be a RefCountingPtr
arch/sparc/faults.cc:
arch/sparc/faults.hh:
MachineCheckFaults and AlignmentFaults are now generated by the ISA, rather than being created directly.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Put the Alpha faults into the AlphaISA namespace
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Moved the _stat for MachineCheckFault and AlignmentFault into the isa specific classes to prevent instantiation of the generic classes.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Changed ev5_trap from a function of the execution context to a function of the fault. The actual function still resides in the execution context.
arch/sparc/faults.cc:
AlphaFault is now an abstract class.
arch/sparc/faults.hh:
AlphaFault is now an abstract class. Also, AlphaMachineCheckFault and AlphaAlignmentFault multiply inherit from both AlphaFault and from MachineCheckFault and AlignmentFault respectively. These classes get their name from the generic classes.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
moved ev5_trap fully into the fault class.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Changed the name of the fault's invocation method from ev5_trap to invoke.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Moved the fault invocation code into the fault class fully, and got rid of the need for isA.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Got rid of the multiple inheritance in the Fault classes, and the base MachineCheck and Alignment faults.
arch/sparc/faults.cc:
bk cp ../alpha/faults.cc faults.cc
arch/sparc/faults.hh:
bk cp ../alpha/faults.hh faults.hh
SConscript:
Moved the alpha specific source files into the alpha specific SConscript
arch/alpha/SConscript:
Moved the alpha specific source files into the alpha specific SConscript, and moved the process files into the new os specific subfolders.
arch/alpha/linux/process.cc:
arch/alpha/process.hh:
arch/sparc/process.hh:
arch/alpha/tru64/process.cc:
Changed the include paths to use the new os specific directories.
--HG--
rename : arch/alpha/linux_process.cc => arch/alpha/linux/process.cc
rename : arch/alpha/linux_process.hh => arch/alpha/linux/process.hh
rename : arch/alpha/tru64_process.cc => arch/alpha/tru64/process.cc
rename : arch/alpha/tru64_process.hh => arch/alpha/tru64/process.hh
rename : arch/sparc/linux_process.cc => arch/sparc/linux/process.cc
rename : arch/sparc/linux_process.hh => arch/sparc/linux/process.hh
extra : convert_revision : dc7eed7994b9c5e7308c771f43758292e78ce3e3
2006-03-07 10:25:42 +01:00
|
|
|
{
|
2006-06-06 23:32:21 +02:00
|
|
|
FaultBase::invoke(tc);
|
2006-03-07 10:32:34 +01:00
|
|
|
countStat()++;
|
Moved where some alpha specific source files were mentioned to be in the alpha specific Sconscript, and took advantage of the os specific directories for the process files.
arch/sparc/faults.cc:
Remove fake fault, fix to have normal m5 line length limit, and change pointers to be const pointers so that the default faults aren't changed accidentally.
arch/sparc/faults.hh:
Fix to have normal m5 line length limit, change pointers to const pointers.
arch/sparc/faults.hh:
Added a typedef for the Addr type, and changed the formatting of the faults slightly.
arch/sparc/faults.hh:
ur
Using cleaned up fault class deiffinitions
arch/sparc/faults.hh:
Added typedef for Addr
arch/sparc/faults.hh:
Made Addr a global type
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Changed Fault * to Fault, which is a typedef to FaultBase *, which is the old Fault class renamed.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Changed Fault to be a RefCountingPtr
arch/sparc/faults.cc:
arch/sparc/faults.hh:
MachineCheckFaults and AlignmentFaults are now generated by the ISA, rather than being created directly.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Put the Alpha faults into the AlphaISA namespace
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Moved the _stat for MachineCheckFault and AlignmentFault into the isa specific classes to prevent instantiation of the generic classes.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Changed ev5_trap from a function of the execution context to a function of the fault. The actual function still resides in the execution context.
arch/sparc/faults.cc:
AlphaFault is now an abstract class.
arch/sparc/faults.hh:
AlphaFault is now an abstract class. Also, AlphaMachineCheckFault and AlphaAlignmentFault multiply inherit from both AlphaFault and from MachineCheckFault and AlignmentFault respectively. These classes get their name from the generic classes.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
moved ev5_trap fully into the fault class.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Changed the name of the fault's invocation method from ev5_trap to invoke.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Moved the fault invocation code into the fault class fully, and got rid of the need for isA.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Got rid of the multiple inheritance in the Fault classes, and the base MachineCheck and Alignment faults.
arch/sparc/faults.cc:
bk cp ../alpha/faults.cc faults.cc
arch/sparc/faults.hh:
bk cp ../alpha/faults.hh faults.hh
SConscript:
Moved the alpha specific source files into the alpha specific SConscript
arch/alpha/SConscript:
Moved the alpha specific source files into the alpha specific SConscript, and moved the process files into the new os specific subfolders.
arch/alpha/linux/process.cc:
arch/alpha/process.hh:
arch/sparc/process.hh:
arch/alpha/tru64/process.cc:
Changed the include paths to use the new os specific directories.
--HG--
rename : arch/alpha/linux_process.cc => arch/alpha/linux/process.cc
rename : arch/alpha/linux_process.hh => arch/alpha/linux/process.hh
rename : arch/alpha/tru64_process.cc => arch/alpha/tru64/process.cc
rename : arch/alpha/tru64_process.hh => arch/alpha/tru64/process.hh
rename : arch/sparc/linux_process.cc => arch/sparc/linux/process.cc
rename : arch/sparc/linux_process.hh => arch/sparc/linux/process.hh
extra : convert_revision : dc7eed7994b9c5e7308c771f43758292e78ce3e3
2006-03-07 10:25:42 +01:00
|
|
|
|
2006-03-07 10:32:34 +01:00
|
|
|
//Use the SPARC trap state machine
|
Moved where some alpha specific source files were mentioned to be in the alpha specific Sconscript, and took advantage of the os specific directories for the process files.
arch/sparc/faults.cc:
Remove fake fault, fix to have normal m5 line length limit, and change pointers to be const pointers so that the default faults aren't changed accidentally.
arch/sparc/faults.hh:
Fix to have normal m5 line length limit, change pointers to const pointers.
arch/sparc/faults.hh:
Added a typedef for the Addr type, and changed the formatting of the faults slightly.
arch/sparc/faults.hh:
ur
Using cleaned up fault class deiffinitions
arch/sparc/faults.hh:
Added typedef for Addr
arch/sparc/faults.hh:
Made Addr a global type
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Changed Fault * to Fault, which is a typedef to FaultBase *, which is the old Fault class renamed.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Changed Fault to be a RefCountingPtr
arch/sparc/faults.cc:
arch/sparc/faults.hh:
MachineCheckFaults and AlignmentFaults are now generated by the ISA, rather than being created directly.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Put the Alpha faults into the AlphaISA namespace
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Moved the _stat for MachineCheckFault and AlignmentFault into the isa specific classes to prevent instantiation of the generic classes.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Changed ev5_trap from a function of the execution context to a function of the fault. The actual function still resides in the execution context.
arch/sparc/faults.cc:
AlphaFault is now an abstract class.
arch/sparc/faults.hh:
AlphaFault is now an abstract class. Also, AlphaMachineCheckFault and AlphaAlignmentFault multiply inherit from both AlphaFault and from MachineCheckFault and AlignmentFault respectively. These classes get their name from the generic classes.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
moved ev5_trap fully into the fault class.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Changed the name of the fault's invocation method from ev5_trap to invoke.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Moved the fault invocation code into the fault class fully, and got rid of the need for isA.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Got rid of the multiple inheritance in the Fault classes, and the base MachineCheck and Alignment faults.
arch/sparc/faults.cc:
bk cp ../alpha/faults.cc faults.cc
arch/sparc/faults.hh:
bk cp ../alpha/faults.hh faults.hh
SConscript:
Moved the alpha specific source files into the alpha specific SConscript
arch/alpha/SConscript:
Moved the alpha specific source files into the alpha specific SConscript, and moved the process files into the new os specific subfolders.
arch/alpha/linux/process.cc:
arch/alpha/process.hh:
arch/sparc/process.hh:
arch/alpha/tru64/process.cc:
Changed the include paths to use the new os specific directories.
--HG--
rename : arch/alpha/linux_process.cc => arch/alpha/linux/process.cc
rename : arch/alpha/linux_process.hh => arch/alpha/linux/process.hh
rename : arch/alpha/tru64_process.cc => arch/alpha/tru64/process.cc
rename : arch/alpha/tru64_process.hh => arch/alpha/tru64/process.hh
rename : arch/sparc/linux_process.cc => arch/sparc/linux/process.cc
rename : arch/sparc/linux_process.hh => arch/sparc/linux/process.hh
extra : convert_revision : dc7eed7994b9c5e7308c771f43758292e78ce3e3
2006-03-07 10:25:42 +01:00
|
|
|
}
|
|
|
|
|
2006-11-03 16:54:34 +01:00
|
|
|
void PowerOnReset::invoke(ThreadContext * tc)
|
|
|
|
{
|
|
|
|
//For SPARC, when a system is first started, there is a power
|
|
|
|
//on reset Trap which sets the processor into the following state.
|
|
|
|
//Bits that aren't set aren't defined on startup.
|
|
|
|
/*
|
|
|
|
tl = MaxTL;
|
|
|
|
gl = MaxGL;
|
|
|
|
|
|
|
|
tickFields.counter = 0; //The TICK register is unreadable bya
|
|
|
|
tickFields.npt = 1; //The TICK register is unreadable by by !priv
|
|
|
|
|
|
|
|
softint = 0; // Clear all the soft interrupt bits
|
|
|
|
tick_cmprFields.int_dis = 1; // disable timer compare interrupts
|
|
|
|
tick_cmprFields.tick_cmpr = 0; // Reset to 0 for pretty printing
|
|
|
|
stickFields.npt = 1; //The TICK register is unreadable by by !priv
|
|
|
|
stick_cmprFields.int_dis = 1; // disable timer compare interrupts
|
|
|
|
stick_cmprFields.tick_cmpr = 0; // Reset to 0 for pretty printing
|
|
|
|
|
|
|
|
tt[tl] = _trapType;
|
|
|
|
pstate = 0; // fields 0 but pef
|
|
|
|
pstateFields.pef = 1;
|
|
|
|
|
|
|
|
hpstate = 0;
|
|
|
|
hpstateFields.red = 1;
|
|
|
|
hpstateFields.hpriv = 1;
|
|
|
|
hpstateFields.tlz = 0; // this is a guess
|
|
|
|
hintp = 0; // no interrupts pending
|
|
|
|
hstick_cmprFields.int_dis = 1; // disable timer compare interrupts
|
|
|
|
hstick_cmprFields.tick_cmpr = 0; // Reset to 0 for pretty printing
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
|
2006-05-15 05:53:29 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !FULL_SYSTEM
|
|
|
|
|
2006-10-25 23:49:41 +02:00
|
|
|
void SpillNNormal::invoke(ThreadContext *tc)
|
|
|
|
{
|
|
|
|
doNormalFault(tc, trapType());
|
|
|
|
|
|
|
|
Process *p = tc->getProcessPtr();
|
|
|
|
|
|
|
|
//This will only work in faults from a SparcLiveProcess
|
|
|
|
SparcLiveProcess *lp = dynamic_cast<SparcLiveProcess *>(p);
|
|
|
|
assert(lp);
|
|
|
|
|
|
|
|
//Then adjust the PC and NPC
|
|
|
|
Addr spillStart = lp->readSpillStart();
|
|
|
|
tc->setPC(spillStart);
|
|
|
|
tc->setNextPC(spillStart + sizeof(MachInst));
|
|
|
|
tc->setNextNPC(spillStart + 2*sizeof(MachInst));
|
|
|
|
}
|
|
|
|
|
|
|
|
void FillNNormal::invoke(ThreadContext *tc)
|
|
|
|
{
|
|
|
|
doNormalFault(tc, trapType());
|
|
|
|
|
|
|
|
Process * p = tc->getProcessPtr();
|
|
|
|
|
|
|
|
//This will only work in faults from a SparcLiveProcess
|
|
|
|
SparcLiveProcess *lp = dynamic_cast<SparcLiveProcess *>(p);
|
|
|
|
assert(lp);
|
|
|
|
|
|
|
|
//The adjust the PC and NPC
|
|
|
|
Addr fillStart = lp->readFillStart();
|
|
|
|
tc->setPC(fillStart);
|
|
|
|
tc->setNextPC(fillStart + sizeof(MachInst));
|
|
|
|
tc->setNextNPC(fillStart + 2*sizeof(MachInst));
|
|
|
|
}
|
|
|
|
|
2006-06-26 22:49:05 +02:00
|
|
|
void PageTableFault::invoke(ThreadContext *tc)
|
|
|
|
{
|
|
|
|
Process *p = tc->getProcessPtr();
|
|
|
|
|
|
|
|
// address is higher than the stack region or in the current stack region
|
|
|
|
if (vaddr > p->stack_base || vaddr > p->stack_min)
|
|
|
|
FaultBase::invoke(tc);
|
|
|
|
|
|
|
|
// We've accessed the next page
|
|
|
|
if (vaddr > p->stack_min - PageBytes) {
|
|
|
|
p->stack_min -= PageBytes;
|
|
|
|
if (p->stack_base - p->stack_min > 8*1024*1024)
|
|
|
|
fatal("Over max stack size for one thread\n");
|
|
|
|
p->pTable->allocate(p->stack_min, PageBytes);
|
|
|
|
warn("Increasing stack size by one page.");
|
|
|
|
} else {
|
|
|
|
FaultBase::invoke(tc);
|
|
|
|
}
|
|
|
|
}
|
2006-10-25 23:49:41 +02:00
|
|
|
|
Moved where some alpha specific source files were mentioned to be in the alpha specific Sconscript, and took advantage of the os specific directories for the process files.
arch/sparc/faults.cc:
Remove fake fault, fix to have normal m5 line length limit, and change pointers to be const pointers so that the default faults aren't changed accidentally.
arch/sparc/faults.hh:
Fix to have normal m5 line length limit, change pointers to const pointers.
arch/sparc/faults.hh:
Added a typedef for the Addr type, and changed the formatting of the faults slightly.
arch/sparc/faults.hh:
ur
Using cleaned up fault class deiffinitions
arch/sparc/faults.hh:
Added typedef for Addr
arch/sparc/faults.hh:
Made Addr a global type
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Changed Fault * to Fault, which is a typedef to FaultBase *, which is the old Fault class renamed.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Changed Fault to be a RefCountingPtr
arch/sparc/faults.cc:
arch/sparc/faults.hh:
MachineCheckFaults and AlignmentFaults are now generated by the ISA, rather than being created directly.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Put the Alpha faults into the AlphaISA namespace
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Moved the _stat for MachineCheckFault and AlignmentFault into the isa specific classes to prevent instantiation of the generic classes.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Changed ev5_trap from a function of the execution context to a function of the fault. The actual function still resides in the execution context.
arch/sparc/faults.cc:
AlphaFault is now an abstract class.
arch/sparc/faults.hh:
AlphaFault is now an abstract class. Also, AlphaMachineCheckFault and AlphaAlignmentFault multiply inherit from both AlphaFault and from MachineCheckFault and AlignmentFault respectively. These classes get their name from the generic classes.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
moved ev5_trap fully into the fault class.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Changed the name of the fault's invocation method from ev5_trap to invoke.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Moved the fault invocation code into the fault class fully, and got rid of the need for isA.
arch/sparc/faults.cc:
arch/sparc/faults.hh:
Got rid of the multiple inheritance in the Fault classes, and the base MachineCheck and Alignment faults.
arch/sparc/faults.cc:
bk cp ../alpha/faults.cc faults.cc
arch/sparc/faults.hh:
bk cp ../alpha/faults.hh faults.hh
SConscript:
Moved the alpha specific source files into the alpha specific SConscript
arch/alpha/SConscript:
Moved the alpha specific source files into the alpha specific SConscript, and moved the process files into the new os specific subfolders.
arch/alpha/linux/process.cc:
arch/alpha/process.hh:
arch/sparc/process.hh:
arch/alpha/tru64/process.cc:
Changed the include paths to use the new os specific directories.
--HG--
rename : arch/alpha/linux_process.cc => arch/alpha/linux/process.cc
rename : arch/alpha/linux_process.hh => arch/alpha/linux/process.hh
rename : arch/alpha/tru64_process.cc => arch/alpha/tru64/process.cc
rename : arch/alpha/tru64_process.hh => arch/alpha/tru64/process.hh
rename : arch/sparc/linux_process.cc => arch/sparc/linux/process.cc
rename : arch/sparc/linux_process.hh => arch/sparc/linux/process.hh
extra : convert_revision : dc7eed7994b9c5e7308c771f43758292e78ce3e3
2006-03-07 10:25:42 +01:00
|
|
|
#endif
|
|
|
|
|
2006-03-07 10:32:34 +01:00
|
|
|
} // namespace SparcISA
|
|
|
|
|