mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-16 09:34:18 +00:00
fix(semihosting): fix seek call failure check
The code checks that the semihosting seek call return value is not zero instead of a negative value when there is an error condition. This defect has been fixed. In [1], possible return values for semihosting seek calls are mentioned. [1]: https://github.com/ARM-software/abi-aa/blob/main/semihosting/ semihosting.rst#sys-seek-0x0a Change-Id: I70f09e98323e9c5bf4eeda322ac065e855e256fc Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
This commit is contained in:
parent
58aebb6a53
commit
7c49438874
2 changed files with 7 additions and 2 deletions
|
@ -649,6 +649,9 @@ subsections:
|
|||
- title: Context Management
|
||||
scope: context mgmt
|
||||
|
||||
- title: Semihosting
|
||||
scope: semihosting
|
||||
|
||||
- title: Drivers
|
||||
|
||||
subsections:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2013-2020, ARM Limited and Contributors. All rights reserved.
|
||||
* Copyright (c) 2013-2022, ARM Limited and Contributors. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
@ -64,8 +64,10 @@ long semihosting_file_seek(long file_handle, ssize_t offset)
|
|||
|
||||
result = semihosting_call(SEMIHOSTING_SYS_SEEK, (uintptr_t)&seek_block);
|
||||
|
||||
if (result != 0) {
|
||||
if (result < 0) {
|
||||
result = semihosting_call(SEMIHOSTING_SYS_ERRNO, 0);
|
||||
} else {
|
||||
result = 0;
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
Loading…
Add table
Reference in a new issue