aarch64: support binary mode for opening files

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.
This commit is contained in:
Richard Earnshaw 2021-05-26 15:17:11 +01:00
parent fd84f6cf51
commit 2a3a03972b
1 changed files with 12 additions and 0 deletions

View File

@ -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_ */