From c4724cac6b75ae9a9f32715f1acfa2d20dcd6fcc Mon Sep 17 00:00:00 2001 From: Adrian Herrera Date: Fri, 15 Nov 2019 11:42:23 +0000 Subject: [PATCH] arch-arm: Semihosting, fix SYS_FLEN SYS_FLEN was incorrectly handled as SYS_ISTTY. This patch fixes this behaviour. Change-Id: I66e0b97d8b44d2cb78e0b1bb940fd6f4b52c658f Reviewed-by: Giacomo Travaglini Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23752 Reviewed-by: Gabe Black Maintainer: Giacomo Travaglini Tested-by: kokoro --- src/arch/arm/semihosting.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/arch/arm/semihosting.cc b/src/arch/arm/semihosting.cc index e04f4199d..2fe5373b8 100644 --- a/src/arch/arm/semihosting.cc +++ b/src/arch/arm/semihosting.cc @@ -454,11 +454,11 @@ ArmSemihosting::callFLen(ThreadContext *tc, bool aarch64, if (argv[1] > files.size() || !files[argv[1]]) return retError(EBADF); - int64_t ret = files[argv[1]]->isTTY(); + int64_t ret = files[argv[1]]->flen(); if (ret < 0) { return retError(-ret); } else { - return retOK(0); + return retOK(ret); } } -- 2.30.2