}
void
-ArmSemihosting::call64(ThreadContext *tc)
+ArmSemihosting::call64(ThreadContext *tc, bool gem5_ops)
{
RegVal op = tc->readIntReg(ArmISA::INTREG_X0 & mask(32));
+ if (op > MaxStandardOp && !gem5_ops) {
+ unrecognizedCall<Abi64>(
+ tc, "Gem5 semihosting op (0x%x) disabled from here.", op);
+ return;
+ }
auto it = calls.find(op);
if (it == calls.end()) {
}
void
-ArmSemihosting::call32(ThreadContext *tc)
+ArmSemihosting::call32(ThreadContext *tc, bool gem5_ops)
{
RegVal op = tc->readIntReg(ArmISA::INTREG_R0);
+ if (op > MaxStandardOp && !gem5_ops) {
+ unrecognizedCall<Abi32>(
+ tc, "Gem5 semihosting op (0x%x) disabled from here.", op);
+ return;
+ }
auto it = calls.find(op);
if (it == calls.end()) {
ArmSemihosting(const ArmSemihostingParams *p);
/** Perform an Arm Semihosting call from aarch64 code. */
- void call64(ThreadContext *tc);
+ void call64(ThreadContext *tc, bool gem5_ops);
/** Perform an Arm Semihosting call from aarch32 code. */
- void call32(ThreadContext *tc);
+ void call32(ThreadContext *tc, bool gem5_ops);
public: // SimObject and related interfaces
void serialize(CheckpointOut &cp) const override;
}
void
-ArmSystem::callSemihosting64(ThreadContext *tc)
+ArmSystem::callSemihosting64(ThreadContext *tc, bool gem5_ops)
{
- getArmSystem(tc)->semihosting->call64(tc);
+ getArmSystem(tc)->semihosting->call64(tc, gem5_ops);
}
void
-ArmSystem::callSemihosting32(ThreadContext *tc)
+ArmSystem::callSemihosting32(ThreadContext *tc, bool gem5_ops)
{
- getArmSystem(tc)->semihosting->call32(tc);
+ getArmSystem(tc)->semihosting->call32(tc, gem5_ops);
}
void
static bool haveSemihosting(ThreadContext *tc);
/** Make a Semihosting call from aarch64 */
- static void callSemihosting64(ThreadContext *tc);
+ static void callSemihosting64(ThreadContext *tc, bool gem5_ops=false);
/** Make a Semihosting call from aarch32 */
- static void callSemihosting32(ThreadContext *tc);
+ static void callSemihosting32(ThreadContext *tc, bool gem5_ops=false);
/** Make a call to notify the power controller of STANDBYWFI assertion */
static void callSetStandByWfi(ThreadContext *tc);