utility.cc (13759:9941fca869a9) utility.cc (13999:a26c2e234a80)
1/*
2 * Copyright (c) 2009-2014, 2016-2018 ARM Limited
3 * All rights reserved.
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

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

456
457Addr
458roundPage(Addr addr)
459{
460 return (addr + PageBytes - 1) & ~(PageBytes - 1);
461}
462
463bool
1/*
2 * Copyright (c) 2009-2014, 2016-2018 ARM Limited
3 * All rights reserved.
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

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

456
457Addr
458roundPage(Addr addr)
459{
460 return (addr + PageBytes - 1) & ~(PageBytes - 1);
461}
462
463bool
464mcrMrc15TrapToHyp(const MiscRegIndex miscReg, HCR hcr, CPSR cpsr, SCR scr,
465 HDCR hdcr, HSTR hstr, HCPTR hcptr, uint32_t iss)
464mcrMrc15TrapToHyp(const MiscRegIndex miscReg, ThreadContext *tc, uint32_t iss)
466{
467 bool isRead;
468 uint32_t crm;
469 IntRegIndex rt;
470 uint32_t crn;
471 uint32_t opc1;
472 uint32_t opc2;
473 bool trapToHype = false;
474
465{
466 bool isRead;
467 uint32_t crm;
468 IntRegIndex rt;
469 uint32_t crn;
470 uint32_t opc1;
471 uint32_t opc2;
472 bool trapToHype = false;
473
474 const CPSR cpsr = tc->readMiscReg(MISCREG_CPSR);
475 const HCR hcr = tc->readMiscReg(MISCREG_HCR);
476 const SCR scr = tc->readMiscReg(MISCREG_SCR);
477 const HDCR hdcr = tc->readMiscReg(MISCREG_HDCR);
478 const HSTR hstr = tc->readMiscReg(MISCREG_HSTR);
479 const HCPTR hcptr = tc->readMiscReg(MISCREG_HCPTR);
475
476 if (!inSecureState(scr, cpsr) && (cpsr.mode != MODE_HYP)) {
477 mcrMrcIssExtract(iss, isRead, crm, rt, crn, opc1, opc2);
478 trapToHype = ((uint32_t) hstr) & (1 << crn);
479 trapToHype |= hdcr.tpm && (crn == 9) && (crm >= 12);
480 trapToHype |= hcr.tidcp && (
481 ((crn == 9) && ((crm <= 2) || ((crm >= 5) && (crm <= 8)))) ||
482 ((crn == 10) && ((crm <= 1) || (crm == 4) || (crm == 8))) ||

--- 385 unchanged lines hidden ---
480
481 if (!inSecureState(scr, cpsr) && (cpsr.mode != MODE_HYP)) {
482 mcrMrcIssExtract(iss, isRead, crm, rt, crn, opc1, opc2);
483 trapToHype = ((uint32_t) hstr) & (1 << crn);
484 trapToHype |= hdcr.tpm && (crn == 9) && (crm >= 12);
485 trapToHype |= hcr.tidcp && (
486 ((crn == 9) && ((crm <= 2) || ((crm >= 5) && (crm <= 8)))) ||
487 ((crn == 10) && ((crm <= 1) || (crm == 4) || (crm == 8))) ||

--- 385 unchanged lines hidden ---