From: Adrian Herrera Date: Fri, 15 Nov 2019 11:42:23 +0000 (+0000) Subject: arch-arm: Semihosting, fix SYS_FLEN X-Git-Tag: v19.0.0.0~169 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c4724cac6b75ae9a9f32715f1acfa2d20dcd6fcc;p=gem5.git 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 --- 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); } }