public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* [committed] aarch64: support binary mode for opening files
@ 2021-05-26 14:21 Richard Earnshaw
  0 siblings, 0 replies; only message in thread
From: Richard Earnshaw @ 2021-05-26 14:21 UTC (permalink / raw)
  To: newlib; +Cc: Richard Earnshaw

[-- Attachment #1: Type: text/plain, Size: 713 bytes --]


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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-aarch64-support-binary-mode-for-opening-files.patch --]
[-- Type: text/x-patch; name="0001-aarch64-support-binary-mode-for-opening-files.patch", Size: 545 bytes --]

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 <sys/_default_fcntl.h>
+
+/* 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_ */

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-26 14:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-26 14:21 [committed] aarch64: support binary mode for opening files Richard Earnshaw

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).