From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 008223858025 for ; Wed, 26 May 2021 14:21:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 008223858025 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rearnsha@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CE74C1516; Wed, 26 May 2021 07:21:41 -0700 (PDT) Received: from e126323.arm.com (unknown [10.57.7.111]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 45DF43F73D; Wed, 26 May 2021 07:21:41 -0700 (PDT) From: Richard Earnshaw To: newlib@sourceware.org Cc: Richard Earnshaw Subject: [committed] aarch64: support binary mode for opening files Date: Wed, 26 May 2021 15:21:29 +0100 Message-Id: <20210526142129.3332336-1-rearnsha@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------2.25.1" Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-14.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 May 2021 14:21:44 -0000 This is a multi-part message in MIME format. --------------2.25.1 Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit Newlib for aarch64 uses libgloss for the backend. One common libgloss implementation is the 'rdimon' implementation, which uses the Arm Semihosting protocol. In order to support a remote host that runs on Windows we need to know whether a file is to be opened in binary or text mode. That means that we need to preserve this information via O_BINARY until we know what the libgloss binding will be. This patch simply copies the arm implementation from sys/arm/sys and puts it in machine/aarch64/sys, because we don't have a 'sys' subtree on aarch64. --- newlib/libc/machine/aarch64/sys/fcntl.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 newlib/libc/machine/aarch64/sys/fcntl.h --------------2.25.1 Content-Type: text/x-patch; name="0001-aarch64-support-binary-mode-for-opening-files.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="0001-aarch64-support-binary-mode-for-opening-files.patch" diff --git a/newlib/libc/machine/aarch64/sys/fcntl.h b/newlib/libc/machine/aarch64/sys/fcntl.h new file mode 100644 index 000000000..7da1d46da --- /dev/null +++ b/newlib/libc/machine/aarch64/sys/fcntl.h @@ -0,0 +1,12 @@ +#ifndef _SYS_FCNTL_H_ +#define _SYS_FCNTL_H_ + +#include + +/* We want to support O_BINARY for the open syscall. + For example, the Demon debug monitor has a separate + flag value for "rb" vs "r". */ +#define _FBINARY 0x10000 +#define O_BINARY _FBINARY + +#endif /* _SYS_FCNTL_H_ */ --------------2.25.1--