RE: [PATCH] RISC-V: fix setting up std streams in init_semihosting()

"Ram Nalamothu (QUIC)" <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <BY5PR02MB638730F269E6F98DC05A7C38F0692@BY5PR02MB6387.namprd02.prod.outlook.com>
Hi,

What is missing for this patch to be pushed?
If nothing, could someone please help me by applying this patch.

Regards,
Ram

-----Original Message-----
From: Ram Nalamothu (QUIC) <[email protected]> 
Sent: Friday, January 5, 2024 5:22 PM
To: [email protected]
Cc: [email protected]; [email protected]
Subject: RE: [PATCH] RISC-V: fix setting up std streams in init_semihosting()

Ping

-----Original Message-----
From: Kito Cheng <[email protected]>
Sent: Wednesday, January 3, 2024 1:48 PM
To: Ram Nalamothu (QUIC) <[email protected]>
Cc: [email protected]; [email protected]
Subject: Re: [PATCH] RISC-V: fix setting up std streams in init_semihosting()

WARNING: This email originated from outside of Qualcomm. Please be wary of any links or attachments, and do not enable macros.

The change seems weird to me at my first time reading, however it makes sense after reading _open and __add_fdentry.

So LGTM, thanks for fixing this issue :)

(BTW, I don't have commit right either :P)

On Wed, Jan 3, 2024 at 4:03 PM Ram Nalamothu (QUIC) <[email protected]> wrote:
>
> Without this patch, the following simple test would fail to run as expected.
>
> #include <stdio.h>
> int main() {
>   int n;
>   printf("Enter a number\n");
>   scanf("%d", &n);
>   printf("Entered number: %d\n", n);
>   return 0;
> }
>
> If the patch looks good, could someone please commit it on behalf of me as I don't have commit rights.
>
> -- 8< --
>
> Currently init_semihosting() assumes the return value from _open() 
> call as the file descriptor handle and that is incorrect.
>
> The semihost _open() call returns the fdtable index returned by the
> __add_fdentry() for the file opened.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.