utility.hh (13999:a26c2e234a80) utility.hh (14169:7b419cdddf0a)
1/*
1/*
2 * Copyright (c) 2010, 2012-2013, 2016-2018 ARM Limited
2 * Copyright (c) 2010, 2012-2013, 2016-2019 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
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated

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

148{
149 CPSR cpsr = tc->readMiscReg(MISCREG_CPSR);
150 return (OperatingMode) (uint8_t) cpsr.mode;
151}
152
153static inline ExceptionLevel
154currEL(ThreadContext *tc)
155{
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
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated

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

148{
149 CPSR cpsr = tc->readMiscReg(MISCREG_CPSR);
150 return (OperatingMode) (uint8_t) cpsr.mode;
151}
152
153static inline ExceptionLevel
154currEL(ThreadContext *tc)
155{
156 CPSR cpsr = tc->readMiscReg(MISCREG_CPSR);
157 return (ExceptionLevel) (uint8_t) cpsr.el;
156 return opModeToEL(currOpMode(tc));
158}
159
160/**
161 * This function checks whether selected EL provided as an argument
162 * is using the AArch32 ISA. This information might be unavailable
163 * at the current EL status: it hence returns a pair of boolean values:
164 * a first boolean, true if information is available (known),
165 * and a second one, true if EL is using AArch32, false for AArch64.

--- 218 unchanged lines hidden ---
157}
158
159/**
160 * This function checks whether selected EL provided as an argument
161 * is using the AArch32 ISA. This information might be unavailable
162 * at the current EL status: it hence returns a pair of boolean values:
163 * a first boolean, true if information is available (known),
164 * and a second one, true if EL is using AArch32, false for AArch64.

--- 218 unchanged lines hidden ---