#include "copyright.h"#include "utility.h"#include "translate.h"#include "disk.h"Go to the source code of this file.
Compounds | |
| class | Instruction |
| class | Machine |
Defines | |
| #define | PageSize SectorSize |
| #define | NumPhysPages 32 |
| #define | MemorySize (NumPhysPages * PageSize) |
| #define | TLBSize 4 |
| #define | StackReg 29 |
| #define | RetAddrReg 31 |
| #define | NumGPRegs 32 |
| #define | HiReg 32 |
| #define | LoReg 33 |
| #define | PCReg 34 |
| #define | NextPCReg 35 |
| #define | PrevPCReg 36 |
| #define | LoadReg 37 |
| #define | LoadValueReg 38 |
| #define | BadVAddrReg 39 |
| #define | NumTotalRegs 40 |
Enumerations | |
| enum | ExceptionType { NoException, SyscallException, PageFaultException, ReadOnlyException, BusErrorException, AddressErrorException, OverflowException, IllegalInstrException, NumExceptionTypes } |
Functions | |
| void | ExceptionHandler (ExceptionType which) |
| unsigned int | WordToHost (unsigned int word) |
| unsigned short | ShortToHost (unsigned short shortword) |
| unsigned int | WordToMachine (unsigned int word) |
| unsigned short | ShortToMachine (unsigned short shortword) |
|
|
Definition at line 70 of file machine.h. Referenced by Machine::RaiseException. |
|
|
Definition at line 63 of file machine.h. Referenced by Machine::DumpState, and Machine::OneInstruction. |
|
|
Definition at line 68 of file machine.h. Referenced by Machine::DelayedLoad, Machine::DumpState, and Machine::OneInstruction. |
|
|
Definition at line 69 of file machine.h. Referenced by Machine::DelayedLoad, Machine::DumpState, and Machine::OneInstruction. |
|
|
Definition at line 64 of file machine.h. Referenced by Machine::DumpState, and Machine::OneInstruction. |
|
|
Definition at line 36 of file machine.h. Referenced by Machine::Machine, and Machine::Translate. |
|
|
Definition at line 66 of file machine.h. Referenced by Machine::DumpState, AddrSpace::InitRegisters, and Machine::OneInstruction. |
|
|
Definition at line 62 of file machine.h. Referenced by Machine::DumpState. |
|
|
Definition at line 35 of file machine.h. Referenced by AddrSpace::AddrSpace, and Machine::Translate. |
|
|
Definition at line 72 of file machine.h. Referenced by AddrSpace::InitRegisters, Machine::Machine, Machine::ReadRegister, and Machine::WriteRegister. |
|
|
Definition at line 31 of file machine.h. Referenced by AddrSpace::AddrSpace, AddrSpace::InitRegisters, and Machine::Translate. |
|
|
Definition at line 65 of file machine.h. Referenced by Machine::DumpState, AddrSpace::InitRegisters, and Machine::OneInstruction. |
|
|
Definition at line 67 of file machine.h. Referenced by Machine::DumpState, and Machine::OneInstruction. |
|
|
Definition at line 61 of file machine.h. Referenced by Machine::DumpState. |
|
|
Definition at line 60 of file machine.h. Referenced by Machine::DumpState, and AddrSpace::InitRegisters. |
|
|
Definition at line 37 of file machine.h. Referenced by Machine::Machine, and Machine::Translate. |
|
|
Definition at line 39 of file machine.h. Referenced by ExceptionHandler, Machine::RaiseException, Machine::ReadMem, and Machine::WriteMem.
00039 { NoException, // Everything ok!
00040 SyscallException, // A program executed a system call.
00041 PageFaultException, // No valid translation found
00042 ReadOnlyException, // Write attempted to page marked
00043 // "read-only"
00044 BusErrorException, // Translation resulted in an
00045 // invalid physical address
00046 AddressErrorException, // Unaligned reference or one that
00047 // was beyond the end of the
00048 // address space
00049 OverflowException, // Integer overflow in add or sub.
00050 IllegalInstrException, // Unimplemented or reserved instr.
00051
00052 NumExceptionTypes
00053 };
|
|
|
Definition at line 52 of file exception.cc. References NumExceptionTypes.
00053 {
00054 int type = machine->ReadRegister(2);
00055
00056 if ((which == SyscallException) && (type == SC_Halt)) {
00057 DEBUG('a', "Shutdown, initiated by user program.\n");
00058 interrupt->Halt();
00059 } else {
00060 printf("Unexpected user mode exception %d %d\n", which, type);
00061 ASSERT(FALSE);
00062 }
00063 }
|
|
|
Definition at line 56 of file translate.cc.
00056 {
00057 #ifdef HOST_IS_BIG_ENDIAN
00058 register unsigned short result;
00059 result = (shortword << 8) & 0xff00;
00060 result |= (shortword >> 8) & 0x00ff;
00061 return result;
00062 #else
00063 return shortword;
00064 #endif /* HOST_IS_BIG_ENDIAN */
00065 }
|
|
|
Definition at line 71 of file translate.cc.
00071 { return ShortToHost(shortword); }
|
|
|
Definition at line 42 of file translate.cc. References AddressErrorException, BusErrorException, IllegalInstrException, OverflowException, and ReadOnlyException.
00042 {
00043 #ifdef HOST_IS_BIG_ENDIAN
00044 register unsigned long result;
00045 result = (word >> 24) & 0x000000ff;
00046 result |= (word >> 8) & 0x0000ff00;
00047 result |= (word << 8) & 0x00ff0000;
00048 result |= (word << 24) & 0xff000000;
00049 return result;
00050 #else
00051 return word;
00052 #endif /* HOST_IS_BIG_ENDIAN */
00053 }
|
|
|
Definition at line 68 of file translate.cc.
00068 { return WordToHost(word); }
|
1.2.14 written by Dimitri van Heesch,
© 1997-2002