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"
|
2006-11-08 19:58:00 +01:00
|
|
|
#include "arch/sparc/types.hh"
|
2006-10-25 23:49:41 +02:00
|
|
|
#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
|
2006-11-08 16:27:38 +01:00
|
|
|
SparcFault<PowerOnReset>::vals =
|
|
|
|
{"power_on_reset", 0x001, 0, {H, H, H}};
|
2006-11-08 14:12:19 +01:00
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
2006-11-08 16:27:38 +01:00
|
|
|
SparcFault<WatchDogReset>::vals =
|
|
|
|
{"watch_dog_reset", 0x002, 120, {H, H, H}};
|
2006-11-08 14:12:19 +01:00
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
2006-11-08 16:27:38 +01:00
|
|
|
SparcFault<ExternallyInitiatedReset>::vals =
|
|
|
|
{"externally_initiated_reset", 0x003, 110, {H, H, H}};
|
2006-11-08 14:12:19 +01:00
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
2006-11-08 16:27:38 +01:00
|
|
|
SparcFault<SoftwareInitiatedReset>::vals =
|
|
|
|
{"software_initiated_reset", 0x004, 130, {SH, SH, H}};
|
2006-11-08 14:12:19 +01:00
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
2006-11-08 16:27:38 +01:00
|
|
|
SparcFault<REDStateException>::vals =
|
|
|
|
{"RED_state_exception", 0x005, 1, {H, H, H}};
|
2006-11-08 14:12:19 +01:00
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
2006-11-08 16:27:38 +01:00
|
|
|
SparcFault<StoreError>::vals =
|
|
|
|
{"store_error", 0x007, 201, {H, H, H}};
|
2006-11-08 14:12:19 +01:00
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
2006-11-08 16:27:38 +01:00
|
|
|
SparcFault<InstructionAccessException>::vals =
|
|
|
|
{"instruction_access_exception", 0x008, 300, {H, H, H}};
|
|
|
|
|
|
|
|
//XXX This trap is apparently dropped from ua2005
|
|
|
|
/*template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<InstructionAccessMMUMiss>::vals =
|
|
|
|
{"inst_mmu", 0x009, 2, {H, H, H}};*/
|
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<InstructionAccessError>::vals =
|
|
|
|
{"instruction_access_error", 0x00A, 400, {H, H, H}};
|
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<IllegalInstruction>::vals =
|
|
|
|
{"illegal_instruction", 0x010, 620, {H, H, H}};
|
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<PrivilegedOpcode>::vals =
|
|
|
|
{"privileged_opcode", 0x011, 700, {P, SH, SH}};
|
|
|
|
|
|
|
|
//XXX This trap is apparently dropped from ua2005
|
|
|
|
/*template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<UnimplementedLDD>::vals =
|
|
|
|
{"unimp_ldd", 0x012, 6, {H, H, H}};*/
|
|
|
|
|
|
|
|
//XXX This trap is apparently dropped from ua2005
|
|
|
|
/*template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<UnimplementedSTD>::vals =
|
|
|
|
{"unimp_std", 0x013, 6, {H, H, H}};*/
|
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<FpDisabled>::vals =
|
|
|
|
{"fp_disabled", 0x020, 800, {P, P, H}};
|
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<FpExceptionIEEE754>::vals =
|
|
|
|
{"fp_exception_ieee_754", 0x021, 1110, {P, P, H}};
|
2006-11-08 14:12:19 +01:00
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
2006-11-08 16:27:38 +01:00
|
|
|
SparcFault<FpExceptionOther>::vals =
|
|
|
|
{"fp_exception_other", 0x022, 1110, {P, P, H}};
|
2006-11-08 14:12:19 +01:00
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
2006-11-08 16:27:38 +01:00
|
|
|
SparcFault<TagOverflow>::vals =
|
|
|
|
{"tag_overflow", 0x023, 1400, {P, P, H}};
|
2006-11-08 14:12:19 +01:00
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
2006-11-08 16:27:38 +01:00
|
|
|
SparcFault<CleanWindow>::vals =
|
|
|
|
{"clean_window", 0x024, 1010, {P, P, H}};
|
2006-11-08 14:12:19 +01:00
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
2006-11-08 16:27:38 +01:00
|
|
|
SparcFault<DivisionByZero>::vals =
|
|
|
|
{"division_by_zero", 0x028, 1500, {P, P, H}};
|
2006-11-08 14:12:19 +01:00
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
2006-11-08 16:27:38 +01:00
|
|
|
SparcFault<InternalProcessorError>::vals =
|
|
|
|
{"internal_processor_error", 0x029, 4, {H, H, H}};
|
2006-11-08 14:12:19 +01:00
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
2006-11-08 16:27:38 +01:00
|
|
|
SparcFault<InstructionInvalidTSBEntry>::vals =
|
|
|
|
{"instruction_invalid_tsb_entry", 0x02A, 210, {H, H, SH}};
|
2006-11-08 14:12:19 +01:00
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
2006-11-08 16:27:38 +01:00
|
|
|
SparcFault<DataInvalidTSBEntry>::vals =
|
|
|
|
{"data_invalid_tsb_entry", 0x02B, 1203, {H, H, H}};
|
2006-11-08 14:12:19 +01:00
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
2006-11-08 16:27:38 +01:00
|
|
|
SparcFault<DataAccessException>::vals =
|
|
|
|
{"data_access_exception", 0x030, 1201, {H, H, H}};
|
|
|
|
|
|
|
|
//XXX This trap is apparently dropped from ua2005
|
|
|
|
/*template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<DataAccessMMUMiss>::vals =
|
|
|
|
{"data_mmu", 0x031, 12, {H, H, H}};*/
|
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<DataAccessError>::vals =
|
|
|
|
{"data_access_error", 0x032, 1210, {H, H, H}};
|
2006-11-08 14:12:19 +01:00
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
2006-11-08 16:27:38 +01:00
|
|
|
SparcFault<DataAccessProtection>::vals =
|
|
|
|
{"data_access_protection", 0x033, 1207, {H, H, H}};
|
2006-11-08 14:12:19 +01:00
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
2006-11-08 16:27:38 +01:00
|
|
|
SparcFault<MemAddressNotAligned>::vals =
|
|
|
|
{"mem_address_not_aligned", 0x034, 1020, {H, H, H}};
|
2006-11-08 14:12:19 +01:00
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
2006-11-08 16:27:38 +01:00
|
|
|
SparcFault<LDDFMemAddressNotAligned>::vals =
|
|
|
|
{"LDDF_mem_address_not_aligned", 0x035, 1010, {H, H, H}};
|
2006-11-08 14:12:19 +01:00
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
2006-11-08 16:27:38 +01:00
|
|
|
SparcFault<STDFMemAddressNotAligned>::vals =
|
|
|
|
{"STDF_mem_address_not_aligned", 0x036, 1010, {H, H, H}};
|
2006-11-08 14:12:19 +01:00
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
2006-11-08 16:27:38 +01:00
|
|
|
SparcFault<PrivilegedAction>::vals =
|
|
|
|
{"privileged_action", 0x037, 1110, {H, H, SH}};
|
2006-11-08 14:12:19 +01:00
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
2006-11-08 16:27:38 +01:00
|
|
|
SparcFault<LDQFMemAddressNotAligned>::vals =
|
|
|
|
{"LDQF_mem_address_not_aligned", 0x038, 1010, {H, H, H}};
|
2006-11-08 14:12:19 +01:00
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
2006-11-08 16:27:38 +01:00
|
|
|
SparcFault<STQFMemAddressNotAligned>::vals =
|
|
|
|
{"STQF_mem_address_not_aligned", 0x039, 1010, {H, H, H}};
|
2006-11-08 14:12:19 +01:00
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
2006-11-08 16:27:38 +01:00
|
|
|
SparcFault<InstructionRealTranslationMiss>::vals =
|
|
|
|
{"instruction_real_translation_miss", 0x03E, 208, {H, H, SH}};
|
2006-11-08 14:12:19 +01:00
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
2006-11-08 16:27:38 +01:00
|
|
|
SparcFault<DataRealTranslationMiss>::vals =
|
|
|
|
{"data_real_translation_miss", 0x03F, 1203, {H, H, H}};
|
|
|
|
|
|
|
|
//XXX This trap is apparently dropped from ua2005
|
|
|
|
/*template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<AsyncDataError>::vals =
|
|
|
|
{"async_data", 0x040, 2, {H, H, H}};*/
|
2006-11-08 14:12:19 +01:00
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
2006-11-08 16:27:38 +01:00
|
|
|
SparcFault<InterruptLevelN>::vals =
|
2007-01-05 21:04:17 +01:00
|
|
|
{"interrupt_level_n", 0x040, 0, {P, P, SH}};
|
2006-11-08 14:12:19 +01:00
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
2006-11-08 16:27:38 +01:00
|
|
|
SparcFault<HstickMatch>::vals =
|
|
|
|
{"hstick_match", 0x05E, 1601, {H, H, H}};
|
2006-11-08 14:12:19 +01:00
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
2006-11-08 16:27:38 +01:00
|
|
|
SparcFault<TrapLevelZero>::vals =
|
|
|
|
{"trap_level_zero", 0x05F, 202, {H, H, SH}};
|
2006-11-08 14:12:19 +01:00
|
|
|
|
2007-03-03 23:22:47 +01:00
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<InterruptVector>::vals =
|
|
|
|
{"interrupt_vector", 0x060, 2630, {H, H, H}};
|
|
|
|
|
2006-11-08 14:12:19 +01:00
|
|
|
template<> SparcFaultBase::FaultVals
|
2006-11-08 16:27:38 +01:00
|
|
|
SparcFault<PAWatchpoint>::vals =
|
|
|
|
{"PA_watchpoint", 0x061, 1209, {H, H, H}};
|
2006-11-08 14:12:19 +01:00
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
2006-11-08 16:27:38 +01:00
|
|
|
SparcFault<VAWatchpoint>::vals =
|
|
|
|
{"VA_watchpoint", 0x062, 1120, {P, P, SH}};
|
2006-11-08 14:12:19 +01:00
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
2006-11-08 16:27:38 +01:00
|
|
|
SparcFault<FastInstructionAccessMMUMiss>::vals =
|
|
|
|
{"fast_instruction_access_MMU_miss", 0x064, 208, {H, H, SH}};
|
2006-03-07 10:32:34 +01:00
|
|
|
|
2006-11-08 16:27:38 +01:00
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<FastDataAccessMMUMiss>::vals =
|
|
|
|
{"fast_data_access_MMU_miss", 0x068, 1203, {H, H, H}};
|
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<FastDataAccessProtection>::vals =
|
|
|
|
{"fast_data_access_protection", 0x06C, 1207, {H, H, H}};
|
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<InstructionBreakpoint>::vals =
|
|
|
|
{"instruction_break", 0x076, 610, {H, H, H}};
|
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<CpuMondo>::vals =
|
|
|
|
{"cpu_mondo", 0x07C, 1608, {P, P, SH}};
|
|
|
|
|
|
|
|
template<> SparcFaultBase::FaultVals
|
|
|
|
SparcFault<DevMondo>::vals =
|
|
|
|
{"dev_mondo", 0x07D, 1611, {P, P, SH}};
|
2006-04-06 20:53:14 +02:00
|
|
|
|
2006-11-08 14:12:19 +01:00
|
|
|
template<> SparcFaultBase::FaultVals
|
2007-01-09 00:07:17 +01:00
|
|
|
SparcFault<ResumableError>::vals =
|
2006-11-08 16:27:38 +01:00
|
|
|
{"resume_error", 0x07E, 3330, {P, P, SH}};
|
2006-03-07 10:32:34 +01:00
|
|
|
|
2006-11-08 14:12:19 +01:00
|
|
|
template<> SparcFaultBase::FaultVals
|
2006-11-08 16:27:38 +01:00
|
|
|
SparcFault<SpillNNormal>::vals =
|
|
|
|
{"spill_n_normal", 0x080, 900, {P, P, H}};
|
2006-03-07 10:32:34 +01:00
|
|
|
|
2006-11-08 14:12:19 +01:00
|
|
|
template<> SparcFaultBase::FaultVals
|
2006-11-08 16:27:38 +01:00
|
|
|
SparcFault<SpillNOther>::vals =
|
|
|
|
{"spill_n_other", 0x0A0, 900, {P, P, H}};
|
2006-03-07 10:32:34 +01:00
|
|
|
|
2006-11-08 14:12:19 +01:00
|
|
|
template<> SparcFaultBase::FaultVals
|
2006-11-08 16:27:38 +01:00
|
|
|
SparcFault<FillNNormal>::vals =
|
|
|
|
{"fill_n_normal", 0x0C0, 900, {P, P, H}};
|
2006-03-07 10:32:34 +01:00
|
|
|
|
2006-11-08 14:12:19 +01:00
|
|
|
template<> SparcFaultBase::FaultVals
|
2006-11-08 16:27:38 +01:00
|
|
|
SparcFault<FillNOther>::vals =
|
|
|
|
{"fill_n_other", 0x0E0, 900, {P, P, H}};
|
2006-03-07 10:32:34 +01:00
|
|
|
|
2006-11-08 14:12:19 +01:00
|
|
|
template<> SparcFaultBase::FaultVals
|
2006-11-08 16:27:38 +01:00
|
|
|
SparcFault<TrapInstruction>::vals =
|
|
|
|
{"trap_instruction", 0x100, 1602, {P, P, H}};
|
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 19:58:00 +01:00
|
|
|
/**
|
|
|
|
* This causes the thread context to enter RED state. This causes the side
|
|
|
|
* effects which go with entering RED state because of a trap.
|
|
|
|
*/
|
|
|
|
|
|
|
|
void enterREDState(ThreadContext *tc)
|
|
|
|
{
|
|
|
|
//@todo Disable the mmu?
|
|
|
|
//@todo Disable watchpoints?
|
2007-03-07 21:04:31 +01:00
|
|
|
MiscReg HPSTATE = tc->readMiscRegNoEffect(MISCREG_HPSTATE);
|
2006-11-08 19:58:00 +01:00
|
|
|
//HPSTATE.red = 1
|
|
|
|
HPSTATE |= (1 << 5);
|
|
|
|
//HPSTATE.hpriv = 1
|
|
|
|
HPSTATE |= (1 << 2);
|
2007-03-07 21:04:31 +01:00
|
|
|
tc->setMiscReg(MISCREG_HPSTATE, HPSTATE);
|
2006-11-21 00:07:58 +01:00
|
|
|
//PSTATE.priv is set to 1 here. The manual says it should be 0, but
|
|
|
|
//Legion sets it to 1.
|
2007-03-07 21:04:31 +01:00
|
|
|
MiscReg PSTATE = tc->readMiscRegNoEffect(MISCREG_PSTATE);
|
2006-11-21 00:07:58 +01:00
|
|
|
PSTATE |= (1 << 2);
|
2007-03-07 21:04:31 +01:00
|
|
|
tc->setMiscReg(MISCREG_PSTATE, PSTATE);
|
2006-11-08 19:58:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This sets everything up for a RED state trap except for actually jumping to
|
|
|
|
* the handler.
|
|
|
|
*/
|
|
|
|
|
|
|
|
void doREDFault(ThreadContext *tc, TrapType tt)
|
|
|
|
{
|
2007-03-07 21:04:31 +01:00
|
|
|
MiscReg TL = tc->readMiscRegNoEffect(MISCREG_TL);
|
|
|
|
MiscReg TSTATE = tc->readMiscRegNoEffect(MISCREG_TSTATE);
|
|
|
|
MiscReg PSTATE = tc->readMiscRegNoEffect(MISCREG_PSTATE);
|
|
|
|
MiscReg HPSTATE = tc->readMiscRegNoEffect(MISCREG_HPSTATE);
|
|
|
|
//MiscReg CCR = tc->readMiscRegNoEffect(MISCREG_CCR);
|
2006-12-05 07:55:02 +01:00
|
|
|
MiscReg CCR = tc->readIntReg(NumIntArchRegs + 2);
|
2007-03-07 21:04:31 +01:00
|
|
|
MiscReg ASI = tc->readMiscRegNoEffect(MISCREG_ASI);
|
|
|
|
MiscReg CWP = tc->readMiscRegNoEffect(MISCREG_CWP);
|
|
|
|
//MiscReg CANSAVE = tc->readMiscRegNoEffect(MISCREG_CANSAVE);
|
|
|
|
MiscReg CANSAVE = tc->readMiscRegNoEffect(NumIntArchRegs + 3);
|
|
|
|
MiscReg GL = tc->readMiscRegNoEffect(MISCREG_GL);
|
2006-11-08 19:58:00 +01:00
|
|
|
MiscReg PC = tc->readPC();
|
|
|
|
MiscReg NPC = tc->readNextPC();
|
|
|
|
|
|
|
|
TL++;
|
|
|
|
|
2007-01-23 21:50:03 +01:00
|
|
|
if (bits(PSTATE, 3,3)) {
|
|
|
|
PC &= mask(32);
|
|
|
|
NPC &= mask(32);
|
|
|
|
}
|
|
|
|
|
2006-11-08 19:58:00 +01:00
|
|
|
//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
|
2007-03-07 21:04:31 +01:00
|
|
|
tc->setMiscRegNoEffect(MISCREG_TSTATE, TSTATE);
|
2006-11-08 19:58:00 +01:00
|
|
|
|
|
|
|
//set TPC to PC
|
2007-03-07 21:04:31 +01:00
|
|
|
tc->setMiscRegNoEffect(MISCREG_TPC, PC);
|
2006-11-08 19:58:00 +01:00
|
|
|
//set TNPC to NPC
|
2007-03-07 21:04:31 +01:00
|
|
|
tc->setMiscRegNoEffect(MISCREG_TNPC, NPC);
|
2006-11-08 19:58:00 +01:00
|
|
|
|
|
|
|
//set HTSTATE.hpstate to hpstate
|
2007-03-07 21:04:31 +01:00
|
|
|
tc->setMiscRegNoEffect(MISCREG_HTSTATE, HPSTATE);
|
2006-11-08 19:58:00 +01:00
|
|
|
|
|
|
|
//TT = trap type;
|
2007-03-07 21:04:31 +01:00
|
|
|
tc->setMiscRegNoEffect(MISCREG_TT, tt);
|
2006-11-08 19:58:00 +01:00
|
|
|
|
|
|
|
//Update GL
|
2007-03-07 21:04:31 +01:00
|
|
|
tc->setMiscReg(MISCREG_GL, min<int>(GL+1, MaxGL));
|
2006-11-08 19:58:00 +01:00
|
|
|
|
2007-01-23 03:55:43 +01:00
|
|
|
PSTATE = mbits(PSTATE, 2, 2); // just save the priv bit
|
|
|
|
PSTATE |= (1 << 4); //set PSTATE.pef to 1
|
2007-03-07 21:04:31 +01:00
|
|
|
tc->setMiscRegNoEffect(MISCREG_PSTATE, PSTATE);
|
2006-11-08 19:58:00 +01:00
|
|
|
|
|
|
|
//set HPSTATE.red to 1
|
|
|
|
HPSTATE |= (1 << 5);
|
|
|
|
//set HPSTATE.hpriv to 1
|
|
|
|
HPSTATE |= (1 << 2);
|
|
|
|
//set HPSTATE.ibe to 0
|
|
|
|
HPSTATE &= ~(1 << 10);
|
|
|
|
//set HPSTATE.tlz to 0
|
|
|
|
HPSTATE &= ~(1 << 0);
|
2007-03-07 21:04:31 +01:00
|
|
|
tc->setMiscRegNoEffect(MISCREG_HPSTATE, HPSTATE);
|
2006-11-08 19:58:00 +01:00
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
if(changedCWP)
|
|
|
|
{
|
|
|
|
CWP = (CWP + NWindows) % NWindows;
|
2007-03-07 21:04:31 +01:00
|
|
|
tc->setMiscReg(MISCREG_CWP, CWP);
|
2006-11-08 19:58:00 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-10-25 23:49:41 +02:00
|
|
|
/**
|
|
|
|
* This sets everything up for a normal trap except for actually jumping to
|
2006-11-08 19:58:00 +01:00
|
|
|
* the handler.
|
2006-10-25 23:49:41 +02:00
|
|
|
*/
|
|
|
|
|
2006-11-08 19:58:00 +01:00
|
|
|
void doNormalFault(ThreadContext *tc, TrapType tt, bool gotoHpriv)
|
2006-10-25 23:49:41 +02:00
|
|
|
{
|
2007-03-07 21:04:31 +01:00
|
|
|
MiscReg TL = tc->readMiscRegNoEffect(MISCREG_TL);
|
|
|
|
MiscReg TSTATE = tc->readMiscRegNoEffect(MISCREG_TSTATE);
|
|
|
|
MiscReg PSTATE = tc->readMiscRegNoEffect(MISCREG_PSTATE);
|
|
|
|
MiscReg HPSTATE = tc->readMiscRegNoEffect(MISCREG_HPSTATE);
|
|
|
|
//MiscReg CCR = tc->readMiscRegNoEffect(MISCREG_CCR);
|
2006-12-05 07:55:02 +01:00
|
|
|
MiscReg CCR = tc->readIntReg(NumIntArchRegs + 2);
|
2007-03-07 21:04:31 +01:00
|
|
|
MiscReg ASI = tc->readMiscRegNoEffect(MISCREG_ASI);
|
|
|
|
MiscReg CWP = tc->readMiscRegNoEffect(MISCREG_CWP);
|
|
|
|
//MiscReg CANSAVE = tc->readMiscRegNoEffect(MISCREG_CANSAVE);
|
2006-12-05 07:55:02 +01:00
|
|
|
MiscReg CANSAVE = tc->readIntReg(NumIntArchRegs + 3);
|
2007-03-07 21:04:31 +01:00
|
|
|
MiscReg GL = tc->readMiscRegNoEffect(MISCREG_GL);
|
2006-11-08 19:58:00 +01:00
|
|
|
MiscReg PC = tc->readPC();
|
|
|
|
MiscReg NPC = tc->readNextPC();
|
2006-10-25 23:49:41 +02:00
|
|
|
|
2007-01-23 21:50:03 +01:00
|
|
|
if (bits(PSTATE, 3,3)) {
|
|
|
|
PC &= mask(32);
|
|
|
|
NPC &= mask(32);
|
|
|
|
}
|
|
|
|
|
2006-10-25 23:49:41 +02:00
|
|
|
//Increment the trap level
|
|
|
|
TL++;
|
2007-03-07 21:04:31 +01:00
|
|
|
tc->setMiscRegNoEffect(MISCREG_TL, TL);
|
2006-10-25 23:49:41 +02:00
|
|
|
|
|
|
|
//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
|
2007-03-07 21:04:31 +01:00
|
|
|
tc->setMiscRegNoEffect(MISCREG_TSTATE, TSTATE);
|
2006-10-25 23:49:41 +02:00
|
|
|
|
|
|
|
//set TPC to PC
|
2007-03-07 21:04:31 +01:00
|
|
|
tc->setMiscRegNoEffect(MISCREG_TPC, PC);
|
2006-10-25 23:49:41 +02:00
|
|
|
//set TNPC to NPC
|
2007-03-07 21:04:31 +01:00
|
|
|
tc->setMiscRegNoEffect(MISCREG_TNPC, NPC);
|
2006-10-25 23:49:41 +02:00
|
|
|
|
|
|
|
//set HTSTATE.hpstate to hpstate
|
2007-03-07 21:04:31 +01:00
|
|
|
tc->setMiscRegNoEffect(MISCREG_HTSTATE, HPSTATE);
|
2006-10-25 23:49:41 +02:00
|
|
|
|
|
|
|
//TT = trap type;
|
2007-03-07 21:04:31 +01:00
|
|
|
tc->setMiscRegNoEffect(MISCREG_TT, tt);
|
2006-10-25 23:49:41 +02:00
|
|
|
|
|
|
|
//Update the global register level
|
2007-01-09 00:07:17 +01:00
|
|
|
if (!gotoHpriv)
|
2007-03-07 21:04:31 +01:00
|
|
|
tc->setMiscReg(MISCREG_GL, min<int>(GL+1, MaxPGL));
|
2006-10-25 23:49:41 +02:00
|
|
|
else
|
2007-03-07 21:04:31 +01:00
|
|
|
tc->setMiscReg(MISCREG_GL, min<int>(GL+1, MaxGL));
|
2006-10-25 23:49:41 +02:00
|
|
|
|
|
|
|
//PSTATE.mm is unchanged
|
2007-01-23 03:55:43 +01:00
|
|
|
PSTATE |= (1 << 4); //PSTATE.pef = whether or not an fpu is present
|
|
|
|
PSTATE &= ~(1 << 3); //PSTATE.am = 0
|
|
|
|
PSTATE &= ~(1 << 1); //PSTATE.ie = 0
|
2006-10-25 23:49:41 +02:00
|
|
|
//PSTATE.tle is unchanged
|
|
|
|
//PSTATE.tct = 0
|
|
|
|
|
2007-01-09 00:07:17 +01:00
|
|
|
if (gotoHpriv)
|
2006-10-25 23:49:41 +02:00
|
|
|
{
|
2007-01-23 03:55:43 +01:00
|
|
|
PSTATE &= ~(1 << 9); // PSTATE.cle = 0
|
|
|
|
//The manual says PSTATE.priv should be 0, but Legion leaves it alone
|
|
|
|
HPSTATE &= ~(1 << 5); //HPSTATE.red = 0
|
|
|
|
HPSTATE |= (1 << 2); //HPSTATE.hpriv = 1
|
|
|
|
HPSTATE &= ~(1 << 10); //HPSTATE.ibe = 0
|
2006-10-25 23:49:41 +02:00
|
|
|
//HPSTATE.tlz is unchanged
|
2007-03-07 21:04:31 +01:00
|
|
|
tc->setMiscRegNoEffect(MISCREG_HPSTATE, HPSTATE);
|
2007-01-23 03:55:43 +01:00
|
|
|
} else { // we are going to priv
|
|
|
|
PSTATE |= (1 << 2); //PSTATE.priv = 1
|
|
|
|
replaceBits(PSTATE, 9, 9, PSTATE >> 8); //PSTATE.cle = PSTATE.tle
|
2006-10-25 23:49:41 +02:00
|
|
|
}
|
2007-03-07 21:04:31 +01:00
|
|
|
tc->setMiscRegNoEffect(MISCREG_PSTATE, PSTATE);
|
2007-01-23 03:55:43 +01:00
|
|
|
|
2006-10-25 23:49:41 +02:00
|
|
|
|
|
|
|
bool changedCWP = true;
|
2007-01-09 00:07:17 +01:00
|
|
|
if (tt == 0x24)
|
2006-10-25 23:49:41 +02:00
|
|
|
CWP++;
|
2007-01-09 00:07:17 +01:00
|
|
|
else if (0x80 <= tt && tt <= 0xbf)
|
2006-10-25 23:49:41 +02:00
|
|
|
CWP += (CANSAVE + 2);
|
2007-01-09 00:07:17 +01:00
|
|
|
else if (0xc0 <= tt && tt <= 0xff)
|
2006-10-25 23:49:41 +02:00
|
|
|
CWP--;
|
|
|
|
else
|
|
|
|
changedCWP = false;
|
2006-10-27 02:23:00 +02:00
|
|
|
|
2007-01-09 00:07:17 +01:00
|
|
|
if (changedCWP)
|
2006-10-25 23:49:41 +02:00
|
|
|
{
|
|
|
|
CWP = (CWP + NWindows) % NWindows;
|
2007-03-07 21:04:31 +01:00
|
|
|
tc->setMiscReg(MISCREG_CWP, CWP);
|
2006-10-25 23:49:41 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-11-10 21:24:10 +01:00
|
|
|
void getREDVector(MiscReg TT, Addr & PC, Addr & NPC)
|
2006-11-08 19:58:00 +01:00
|
|
|
{
|
2006-11-10 01:24:35 +01:00
|
|
|
//XXX The following constant might belong in a header file.
|
2006-11-11 02:17:42 +01:00
|
|
|
const Addr RSTVAddr = 0xFFF0000000ULL;
|
2006-11-10 21:24:10 +01:00
|
|
|
PC = RSTVAddr | ((TT << 5) & 0xFF);
|
2006-11-08 19:58:00 +01:00
|
|
|
NPC = PC + sizeof(MachInst);
|
|
|
|
}
|
|
|
|
|
2006-11-10 01:24:35 +01:00
|
|
|
void getHyperVector(ThreadContext * tc, Addr & PC, Addr & NPC, MiscReg TT)
|
2006-11-08 19:58:00 +01:00
|
|
|
{
|
2007-03-07 21:04:31 +01:00
|
|
|
Addr HTBA = tc->readMiscRegNoEffect(MISCREG_HTBA);
|
2006-11-08 19:58:00 +01:00
|
|
|
PC = (HTBA & ~mask(14)) | ((TT << 5) & mask(14));
|
|
|
|
NPC = PC + sizeof(MachInst);
|
|
|
|
}
|
|
|
|
|
2006-11-10 01:24:35 +01:00
|
|
|
void getPrivVector(ThreadContext * tc, Addr & PC, Addr & NPC, MiscReg TT, MiscReg TL)
|
2006-11-08 19:58:00 +01:00
|
|
|
{
|
2007-03-07 21:04:31 +01:00
|
|
|
Addr TBA = tc->readMiscRegNoEffect(MISCREG_TBA);
|
2006-11-08 19:58:00 +01:00
|
|
|
PC = (TBA & ~mask(15)) |
|
|
|
|
(TL > 1 ? (1 << 14) : 0) |
|
|
|
|
((TT << 5) & mask(14));
|
|
|
|
NPC = PC + sizeof(MachInst);
|
|
|
|
}
|
|
|
|
|
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-12-08 00:50:33 +01:00
|
|
|
//panic("Invoking a second fault!\n");
|
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-11-08 19:58:00 +01:00
|
|
|
//We can refer to this to see what the trap level -was-, but something
|
|
|
|
//in the middle could change it in the regfile out from under us.
|
2007-03-07 21:04:31 +01:00
|
|
|
MiscReg tl = tc->readMiscRegNoEffect(MISCREG_TL);
|
|
|
|
MiscReg tt = tc->readMiscRegNoEffect(MISCREG_TT);
|
|
|
|
MiscReg pstate = tc->readMiscRegNoEffect(MISCREG_PSTATE);
|
|
|
|
MiscReg hpstate = tc->readMiscRegNoEffect(MISCREG_HPSTATE);
|
2006-11-08 19:58:00 +01:00
|
|
|
|
|
|
|
Addr PC, NPC;
|
|
|
|
|
|
|
|
PrivilegeLevel current;
|
2007-01-09 00:07:17 +01:00
|
|
|
if (hpstate & HPSTATE::hpriv)
|
2006-11-21 00:07:58 +01:00
|
|
|
current = Hyperprivileged;
|
2007-01-09 00:07:17 +01:00
|
|
|
else if (pstate & PSTATE::priv)
|
2006-11-08 19:58:00 +01:00
|
|
|
current = Privileged;
|
|
|
|
else
|
2006-11-21 00:07:58 +01:00
|
|
|
current = User;
|
2006-11-08 19:58:00 +01:00
|
|
|
|
|
|
|
PrivilegeLevel level = getNextLevel(current);
|
|
|
|
|
2007-01-09 00:07:17 +01:00
|
|
|
if ((hpstate & HPSTATE::red) || (tl == MaxTL - 1)) {
|
2006-11-10 21:24:10 +01:00
|
|
|
getREDVector(5, PC, NPC);
|
2007-01-09 00:07:17 +01:00
|
|
|
doREDFault(tc, tt);
|
2006-11-21 00:07:58 +01:00
|
|
|
//This changes the hpstate and pstate, so we need to make sure we
|
|
|
|
//save the old version on the trap stack in doREDFault.
|
|
|
|
enterREDState(tc);
|
2007-01-09 00:07:17 +01:00
|
|
|
} else if (tl == MaxTL) {
|
2006-12-08 00:50:33 +01:00
|
|
|
panic("Should go to error state here.. crap\n");
|
2006-11-08 19:58:00 +01:00
|
|
|
//Do error_state somehow?
|
|
|
|
//Probably inject a WDR fault using the interrupt mechanism.
|
|
|
|
//What should the PC and NPC be set to?
|
2007-01-09 00:07:17 +01:00
|
|
|
} else if (tl > MaxPTL && level == Privileged) {
|
2006-11-08 19:58:00 +01:00
|
|
|
//guest_watchdog fault
|
|
|
|
doNormalFault(tc, trapType(), true);
|
2006-11-10 01:24:35 +01:00
|
|
|
getHyperVector(tc, PC, NPC, 2);
|
2007-01-09 00:07:17 +01:00
|
|
|
} else if (level == Hyperprivileged ||
|
2006-12-10 00:00:40 +01:00
|
|
|
level == Privileged && trapType() >= 384) {
|
2006-11-08 19:58:00 +01:00
|
|
|
doNormalFault(tc, trapType(), true);
|
2006-11-10 01:24:35 +01:00
|
|
|
getHyperVector(tc, PC, NPC, trapType());
|
2006-12-10 00:00:40 +01:00
|
|
|
} else {
|
2006-11-08 19:58:00 +01:00
|
|
|
doNormalFault(tc, trapType(), false);
|
2007-01-09 00:07:17 +01:00
|
|
|
getPrivVector(tc, PC, NPC, trapType(), tl+1);
|
2006-11-08 19:58:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
tc->setPC(PC);
|
|
|
|
tc->setNextPC(NPC);
|
|
|
|
tc->setNextNPC(NPC + sizeof(MachInst));
|
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.
|
|
|
|
|
2007-03-07 21:04:31 +01:00
|
|
|
tc->setMiscRegNoEffect(MISCREG_TL, MaxTL);
|
|
|
|
tc->setMiscRegNoEffect(MISCREG_TT, trapType());
|
|
|
|
tc->setMiscReg(MISCREG_GL, MaxGL);
|
2006-11-10 21:24:10 +01:00
|
|
|
|
2006-11-21 00:07:58 +01:00
|
|
|
//Turn on pef and priv, set everything else to 0
|
2007-03-07 21:04:31 +01:00
|
|
|
tc->setMiscRegNoEffect(MISCREG_PSTATE, (1 << 4) | (1 << 2));
|
2006-11-03 16:54:34 +01:00
|
|
|
|
2006-11-10 21:24:10 +01:00
|
|
|
//Turn on red and hpriv, set everything else to 0
|
2007-03-07 21:04:31 +01:00
|
|
|
MiscReg HPSTATE = tc->readMiscRegNoEffect(MISCREG_HPSTATE);
|
2006-11-14 07:29:11 +01:00
|
|
|
//HPSTATE.red = 1
|
|
|
|
HPSTATE |= (1 << 5);
|
|
|
|
//HPSTATE.hpriv = 1
|
|
|
|
HPSTATE |= (1 << 2);
|
|
|
|
//HPSTATE.ibe = 0
|
|
|
|
HPSTATE &= ~(1 << 10);
|
|
|
|
//HPSTATE.tlz = 0
|
|
|
|
HPSTATE &= ~(1 << 0);
|
2007-03-07 21:04:31 +01:00
|
|
|
tc->setMiscRegNoEffect(MISCREG_HPSTATE, HPSTATE);
|
2006-11-10 21:24:10 +01:00
|
|
|
|
|
|
|
//The tick register is unreadable by nonprivileged software
|
2007-03-07 21:04:31 +01:00
|
|
|
tc->setMiscRegNoEffect(MISCREG_TICK, 1ULL << 63);
|
2006-11-10 21:24:10 +01:00
|
|
|
|
2006-11-21 00:07:58 +01:00
|
|
|
//Enter RED state. We do this last so that the actual state preserved in
|
|
|
|
//the trap stack is the state from before this fault.
|
|
|
|
enterREDState(tc);
|
|
|
|
|
2006-11-10 21:24:10 +01:00
|
|
|
Addr PC, NPC;
|
|
|
|
getREDVector(trapType(), PC, NPC);
|
|
|
|
tc->setPC(PC);
|
|
|
|
tc->setNextPC(NPC);
|
|
|
|
tc->setNextNPC(NPC + sizeof(MachInst));
|
|
|
|
|
|
|
|
//These registers are specified as "undefined" after a POR, and they
|
|
|
|
//should have reasonable values after the miscregfile is reset
|
|
|
|
/*
|
|
|
|
// Clear all the soft interrupt bits
|
|
|
|
softint = 0;
|
|
|
|
// disable timer compare interrupts, reset tick_cmpr
|
2007-03-07 21:04:31 +01:00
|
|
|
tc->setMiscRegNoEffect(MISCREG_
|
2006-11-10 21:24:10 +01:00
|
|
|
tick_cmprFields.int_dis = 1;
|
2006-11-03 16:54:34 +01:00
|
|
|
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;
|
|
|
|
|
|
|
|
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-11-08 19:58:00 +01:00
|
|
|
#else // !FULL_SYSTEM
|
2006-05-15 05:53:29 +02:00
|
|
|
|
2006-10-25 23:49:41 +02:00
|
|
|
void SpillNNormal::invoke(ThreadContext *tc)
|
|
|
|
{
|
2006-11-08 19:58:00 +01:00
|
|
|
doNormalFault(tc, trapType(), false);
|
2006-10-25 23:49:41 +02:00
|
|
|
|
|
|
|
Process *p = tc->getProcessPtr();
|
|
|
|
|
2006-11-08 19:58:00 +01:00
|
|
|
//XXX This will only work in faults from a SparcLiveProcess
|
2006-10-25 23:49:41 +02:00
|
|
|
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)
|
|
|
|
{
|
2006-11-08 19:58:00 +01:00
|
|
|
doNormalFault(tc, trapType(), false);
|
2006-10-25 23:49:41 +02:00
|
|
|
|
|
|
|
Process * p = tc->getProcessPtr();
|
|
|
|
|
2006-11-08 19:58:00 +01:00
|
|
|
//XXX This will only work in faults from a SparcLiveProcess
|
2006-10-25 23:49:41 +02:00
|
|
|
SparcLiveProcess *lp = dynamic_cast<SparcLiveProcess *>(p);
|
|
|
|
assert(lp);
|
|
|
|
|
2006-11-08 19:58:00 +01:00
|
|
|
//Then adjust the PC and NPC
|
2006-10-25 23:49:41 +02:00
|
|
|
Addr fillStart = lp->readFillStart();
|
|
|
|
tc->setPC(fillStart);
|
|
|
|
tc->setNextPC(fillStart + sizeof(MachInst));
|
|
|
|
tc->setNextNPC(fillStart + 2*sizeof(MachInst));
|
|
|
|
}
|
|
|
|
|
2007-02-28 17:36:38 +01:00
|
|
|
void TrapInstruction::invoke(ThreadContext *tc)
|
|
|
|
{
|
|
|
|
//In SE, this mechanism is how the process requests a service from the
|
|
|
|
//operating system. We'll get the process object from the thread context
|
|
|
|
//and let it service the request.
|
|
|
|
|
|
|
|
Process *p = tc->getProcessPtr();
|
|
|
|
|
|
|
|
SparcLiveProcess *lp = dynamic_cast<SparcLiveProcess *>(p);
|
|
|
|
assert(lp);
|
|
|
|
|
|
|
|
lp->handleTrap(_n, tc);
|
|
|
|
|
|
|
|
//We need to explicitly advance the pc, since that's not done for us
|
|
|
|
//on a faulting instruction
|
|
|
|
tc->setPC(tc->readNextPC());
|
|
|
|
tc->setNextPC(tc->readNextNPC());
|
|
|
|
tc->setNextNPC(tc->readNextNPC() + sizeof(MachInst));
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
|