Deleted Added
sdiff udiff text old ( 12789:b28b286fa57d ) new ( 13999:a26c2e234a80 )
full compact
1// -*- mode:c++ -*-
2
3// Copyright (c) 2010-2013,2017-2018 ARM Limited
4// All rights reserved
5//
6// The license below extends only to copyright in the software and shall
7// not be construed as granting a license to any other intellectual
8// property including but not limited to intellectual property relating

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

915 decoder_output += MiscRegRegImmOpConstructor.subst(mcr14Iop)
916 exec_output += PredOpExecute.subst(mcr14Iop)
917
918 mrc15code = '''
919 int preFlatOp1 = snsBankedIndex(op1, xc->tcBase());
920 MiscRegIndex miscReg = (MiscRegIndex)
921 xc->tcBase()->flattenRegId(RegId(MiscRegClass,
922 preFlatOp1)).index();
923 bool hypTrap = mcrMrc15TrapToHyp(miscReg, Hcr, Cpsr, Scr, Hdcr, Hstr,
924 Hcptr, imm);
925 bool can_read, undefined;
926 std::tie(can_read, undefined) = canReadCoprocReg(miscReg, Scr, Cpsr);
927 // if we're in non secure PL1 mode then we can trap regargless of whether
928 // the register is accessable, in other modes we trap if only if the register
929 // IS accessable.
930 if (undefined || (!can_read && !(hypTrap && !inUserMode(Cpsr) &&
931 !inSecureState(Scr, Cpsr)))) {
932 return std::make_shared<UndefinedInstruction>(machInst, false,

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

947 exec_output += PredOpExecute.subst(mrc15Iop)
948
949
950 mcr15code = '''
951 int preFlatDest = snsBankedIndex(dest, xc->tcBase());
952 MiscRegIndex miscReg = (MiscRegIndex)
953 xc->tcBase()->flattenRegId(RegId(MiscRegClass,
954 preFlatDest)).index();
955 bool hypTrap = mcrMrc15TrapToHyp(miscReg, Hcr, Cpsr, Scr, Hdcr, Hstr,
956 Hcptr, imm);
957 bool can_write, undefined;
958 std::tie(can_write, undefined) = canWriteCoprocReg(miscReg, Scr, Cpsr);
959
960 // if we're in non secure PL1 mode then we can trap regargless of whether
961 // the register is accessable, in other modes we trap if only if the register
962 // IS accessable.
963 if (undefined || (!can_write && !(hypTrap && !inUserMode(Cpsr) &&
964 !inSecureState(Scr, Cpsr)))) {

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

1087 header_output += BasicDeclare.subst(clrexIop)
1088 decoder_output += BasicConstructor.subst(clrexIop)
1089 exec_output += PredOpExecute.subst(clrexIop)
1090
1091 McrDcCheckCode = '''
1092 int preFlatDest = snsBankedIndex(dest, xc->tcBase());
1093 MiscRegIndex miscReg = (MiscRegIndex) xc->tcBase()->flattenRegId(
1094 RegId(MiscRegClass, preFlatDest)).index();
1095 bool hypTrap = mcrMrc15TrapToHyp(miscReg, Hcr, Cpsr, Scr, Hdcr, Hstr,
1096 Hcptr, imm);
1097 bool can_write, undefined;
1098 std::tie(can_write, undefined) = canWriteCoprocReg(miscReg, Scr, Cpsr);
1099
1100 // if we're in non secure PL1 mode then we can trap regardless
1101 // of whether the register is accessible, in other modes we
1102 // trap if only if the register IS accessible.
1103 if (undefined || (!can_write & !(hypTrap & !inUserMode(Cpsr) &
1104 !inSecureState(Scr, Cpsr)))) {

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

1185 header_output += MiscRegRegImmMemOpDeclare.subst(McrDccimvacIop)
1186 decoder_output += MiscRegRegImmOpConstructor.subst(McrDccimvacIop)
1187 exec_output += Mcr15Execute.subst(McrDccimvacIop) + \
1188 Mcr15InitiateAcc.subst(McrDccimvacIop) + \
1189 Mcr15CompleteAcc.subst(McrDccimvacIop)
1190
1191 isbCode = '''
1192 // If the barrier is due to a CP15 access check for hyp traps
1193 if ((imm != 0) && mcrMrc15TrapToHyp(MISCREG_CP15ISB, Hcr, Cpsr, Scr,
1194 Hdcr, Hstr, Hcptr, imm)) {
1195 return std::make_shared<HypervisorTrap>(machInst, imm,
1196 EC_TRAPPED_CP15_MCR_MRC);
1197 }
1198 '''
1199 isbIop = InstObjParams("isb", "Isb", "ImmOp",
1200 {"code": isbCode,
1201 "predicate_test": predicateTest},
1202 ['IsSquashAfter'])
1203 header_output += ImmOpDeclare.subst(isbIop)
1204 decoder_output += ImmOpConstructor.subst(isbIop)
1205 exec_output += PredOpExecute.subst(isbIop)
1206
1207 dsbCode = '''
1208 // If the barrier is due to a CP15 access check for hyp traps
1209 if ((imm != 0) && mcrMrc15TrapToHyp(MISCREG_CP15DSB, Hcr, Cpsr, Scr,
1210 Hdcr, Hstr, Hcptr, imm)) {
1211 return std::make_shared<HypervisorTrap>(machInst, imm,
1212 EC_TRAPPED_CP15_MCR_MRC);
1213 }
1214 '''
1215 dsbIop = InstObjParams("dsb", "Dsb", "ImmOp",
1216 {"code": dsbCode,
1217 "predicate_test": predicateTest},
1218 ['IsMemBarrier', 'IsSerializeAfter'])
1219 header_output += ImmOpDeclare.subst(dsbIop)
1220 decoder_output += ImmOpConstructor.subst(dsbIop)
1221 exec_output += PredOpExecute.subst(dsbIop)
1222
1223 dmbCode = '''
1224 // If the barrier is due to a CP15 access check for hyp traps
1225 if ((imm != 0) && mcrMrc15TrapToHyp(MISCREG_CP15DMB, Hcr, Cpsr, Scr,
1226 Hdcr, Hstr, Hcptr, imm)) {
1227 return std::make_shared<HypervisorTrap>(machInst, imm,
1228 EC_TRAPPED_CP15_MCR_MRC);
1229 }
1230 '''
1231 dmbIop = InstObjParams("dmb", "Dmb", "ImmOp",
1232 {"code": dmbCode,
1233 "predicate_test": predicateTest},
1234 ['IsMemBarrier'])

--- 46 unchanged lines hidden ---