From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 0EAB9385841C for ; Wed, 10 Jan 2024 09:47:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0EAB9385841C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 0EAB9385841C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704880061; cv=none; b=lf73ObM0NaVGQiDS/d318D6J6q2ddW/k33sroLF6MawYvR4MJUiJ7FnvYYlhTW0D0FFYYlTBFrbrcuir4Jk4c6V5BifZxK6sNOYCWnYpvtfxsAWjbco9fcEupGZBuPpxukLOX+6u7HpoHZ/9H34jvrygDkCM9LLj6zv62gAyGY4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704880061; c=relaxed/simple; bh=qgxgUi0Oy02/7DQ67vUhAw+rGnnMRvt+ovyKExziTO4=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=dzO5Jdi0PXYXmiHI2/OjhqmwN4wgy/3bpcJgm6KeABEK0jGKvOTB4YOzsE+WCp+2/91ApgoNcFteVhbl4puYA0dT9BdE+qDjEW/vuMG2oM6cHDYPZ6EIQ1WWhxChCvuZV/BONGu+cTseoesJbIr5J7aBqlLimpLNiD1KFLBZudc= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704880058; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=edURVFXeF9IAovggLSwV/mFSKgAHI2LTbkuGOkamtdw=; b=YKRKwvzcrP2NF3ohXSWeLzXX1tIhYtFJPjkpErLci25xecEZCeeEh/yhNwe2UOVhj0zeSO Aq7hDbc5LCSDxI8/0cavnQJnXt0yZYqOjnfpm6cgybn/GaygdggBFNPhf/fQqRGuh1KK3a S5kuDcJtHzvnr7PwWmcdsWqui+D1Tmc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-588-94ey2LVGPPWkHKr_yYgVWg-1; Wed, 10 Jan 2024 04:47:37 -0500 X-MC-Unique: 94ey2LVGPPWkHKr_yYgVWg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0E784811E86 for ; Wed, 10 Jan 2024 09:47:37 +0000 (UTC) Received: from calimero.vinschen.de (unknown [10.39.195.34]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E19D62026D66 for ; Wed, 10 Jan 2024 09:47:36 +0000 (UTC) Received: by calimero.vinschen.de (Postfix, from userid 500) id 8FB12A80742; Wed, 10 Jan 2024 10:47:35 +0100 (CET) Date: Wed, 10 Jan 2024 10:47:35 +0100 From: Corinna Vinschen To: newlib@sourceware.org Subject: Re: [PATCH] RISC-V: fix setting up std streams in init_semihosting() Message-ID: Reply-To: newlib@sourceware.org Mail-Followup-To: newlib@sourceware.org References: MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Jan 10 07:57, Ram Nalamothu (QUIC) wrote: > Hi, > > What is missing for this patch to be pushed? > If nothing, could someone please help me by applying this patch. Pushed. Thanks, Corinna > > Regards, > Ram > > -----Original Message----- > From: Ram Nalamothu (QUIC) > Sent: Friday, January 5, 2024 5:22 PM > To: newlib@sourceware.org > Cc: craig.blackmore@embecosm.com; kito.cheng@sifive.com > Subject: RE: [PATCH] RISC-V: fix setting up std streams in init_semihosting() > > Ping > > -----Original Message----- > From: Kito Cheng > Sent: Wednesday, January 3, 2024 1:48 PM > To: Ram Nalamothu (QUIC) > Cc: newlib@sourceware.org; craig.blackmore@embecosm.com > 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) wrote: > > > > Without this patch, the following simple test would fail to run as expected. > > > > #include > > 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.