Deleted Added
sdiff udiff text old ( 12104:edd63f9c6184 ) new ( 12406:86bde4a026b5 )
full compact
1// -*- mode:c++ -*-
2
3// Copyright (c) 2007 MIPS Technologies, Inc.
4// All rights reserved.
5//
6// Redistribution and use in source and binary forms, with or without
7// modification, are permitted provided that the following conditions are
8// met: redistributions of source code must retain the above copyright

--- 723 unchanged lines hidden (view full) ---

732 // Undefined;
733 }
734 Debug = debug;
735 }}, IsReturn, IsSerializing, IsERET);
736 }
737 format CP0TLB {
738 0x01: tlbr({{
739 MipsISA::PTE *PTEntry =
740 xc->tcBase()->getITBPtr()->
741 getEntry(Index & 0x7FFFFFFF);
742 if (PTEntry == NULL) {
743 fatal("Invalid PTE Entry received on "
744 "a TLBR instruction\n");
745 }
746 /* Setup PageMask */
747 // If 1KB pages are not enabled, a read of PageMask
748 // must return 0b00 in bits 12, 11

--- 63 unchanged lines hidden (view full) ---

812 } else if ((newEntry.Mask & 0x30000) == 0x30000) {
813 newEntry.AddrShiftAmount = 28;
814 } else {
815 fatal("Invalid Mask Pattern Detected!\n");
816 }
817 newEntry.OffsetMask =
818 (1 << newEntry.AddrShiftAmount) - 1;
819
820 MipsISA::TLB *Ptr = xc->tcBase()->getITBPtr();
821 Config3Reg config3 = Config3;
822 PageGrainReg pageGrain = PageGrain;
823 int SP = 0;
824 if (bits(config3, config3.sp) == 1 &&
825 bits(pageGrain, pageGrain.esp) == 1) {
826 SP = 1;
827 }
828 Ptr->insertAt(newEntry, Index & 0x7FFFFFFF, SP);
829 }});
830 0x06: tlbwr({{
831 //Create PTE
832 MipsISA::PTE newEntry;
833 //Write PTE
834 newEntry.Mask = (Addr)(PageMask >> 11);
835 newEntry.VPN = (Addr)(EntryHi >> 11);
836 /* PageGrain _ ESP Config3 _ SP */

--- 40 unchanged lines hidden (view full) ---

877 } else if ((newEntry.Mask & 0x30000) == 0x30000) {
878 newEntry.AddrShiftAmount = 28;
879 } else {
880 fatal("Invalid Mask Pattern Detected!\n");
881 }
882 newEntry.OffsetMask =
883 (1 << newEntry.AddrShiftAmount) - 1;
884
885 MipsISA::TLB *Ptr = xc->tcBase()->getITBPtr();
886 Config3Reg config3 = Config3;
887 PageGrainReg pageGrain = PageGrain;
888 int SP = 0;
889 if (bits(config3, config3.sp) == 1 &&
890 bits(pageGrain, pageGrain.esp) == 1) {
891 SP = 1;
892 }
893 Ptr->insertAt(newEntry, Random, SP);
894 }});
895
896 0x08: tlbp({{
897 Config3Reg config3 = Config3;
898 PageGrainReg pageGrain = PageGrain;
899 EntryHiReg entryHi = EntryHi;
900 int tlbIndex;
901 Addr vpn;
902 if (pageGrain.esp == 1 && config3.sp ==1) {
903 vpn = EntryHi >> 11;
904 } else {
905 // Mask off lower 2 bits
906 vpn = ((EntryHi >> 11) & 0xFFFFFFFC);
907 }
908 tlbIndex = xc->tcBase()->getITBPtr()->
909 probeEntry(vpn, entryHi.asid);
910 // Check TLB for entry matching EntryHi
911 if (tlbIndex != -1) {
912 Index = tlbIndex;
913 } else {
914 // else, set Index = 1 << 31
915 Index = (1 << 31);
916 }
917 }});

--- 1653 unchanged lines hidden ---