mirror of
https://github.com/apache/nuttx.git
synced 2026-05-19 11:53:25 +08:00
xtensa: hostfs: handle nonblock open for iss
Signed-off-by: chenxiaoyi <chenxiaoyi@xiaomi.com>
This commit is contained in:
@@ -279,6 +279,14 @@ config XTENSA_SEMIHOSTING_HOSTFS
|
||||
This doesn't support some directory operations like readdir because
|
||||
of the limitations of semihosting mechanism.
|
||||
|
||||
config XTENSA_TARGET_ISS
|
||||
bool "Target machine is Instruction Set Simulator"
|
||||
default n
|
||||
---help---
|
||||
This setting determines whether the target is Cadence Instruction
|
||||
Set Simulator, which might have some sepecial characteristics such
|
||||
as how to open a file nonblock.
|
||||
|
||||
if XTENSA_SEMIHOSTING_HOSTFS
|
||||
|
||||
config XTENSA_SEMIHOSTING_HOSTFS_CACHE_COHERENCE
|
||||
|
||||
@@ -63,6 +63,11 @@
|
||||
#define SIMCALL_O_RDWR 0x0002
|
||||
#define SIMCALL_O_ACCMODE 0x0003
|
||||
#define SIMCALL_O_APPEND 0x0400
|
||||
#ifdef CONFIG_XTENSA_TARGET_ISS
|
||||
# define SIMCALL_O_NONBLOCK 0x0080
|
||||
#else
|
||||
# define SIMCALL_O_NONBLOCK 0x0800
|
||||
#endif
|
||||
#define SIMCALL_O_CREAT 0x0040
|
||||
#define SIMCALL_O_TRUNC 0x0200
|
||||
#define SIMCALL_O_EXCL 0x0080
|
||||
|
||||
@@ -97,6 +97,11 @@ int host_open(const char *pathname, int flags, int mode)
|
||||
simcall_flags |= SIMCALL_O_EXCL;
|
||||
}
|
||||
|
||||
if ((flags & O_NONBLOCK) != 0)
|
||||
{
|
||||
simcall_flags |= SIMCALL_O_NONBLOCK;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_XTENSA_SEMIHOSTING_HOSTFS_CACHE_COHERENCE
|
||||
up_clean_dcache(pathname, pathname + strlen(pathname) + 1);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user