Commit 92f0f706 authored by Stephanos Ioannidis's avatar Stephanos Ioannidis Committed by Christopher Friedt
Browse files

lib: libc: Drop `z_` prefix from stdio syscalls



This commit removes the `z_` prefix from the stdio syscall functions
(`z_zephyr_write_stdout` and `z_zephyr_read_stdin`) since it is
redundant and does not align with the convention used by the equivalent
minimal libc syscall functions (e.g. `zephyr_fputc` and
`zephyr_fwrite`).

Signed-off-by: default avatarStephanos Ioannidis <root@stephanos.io>
parent 86b8cf1f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -23,9 +23,9 @@
 */
#define _MLIBC_RESTRICT

__syscall int z_zephyr_read_stdin(char *buf, int nbytes);
__syscall int zephyr_read_stdin(char *buf, int nbytes);

__syscall int z_zephyr_write_stdout(const void *buf, int nbytes);
__syscall int zephyr_write_stdout(const void *buf, int nbytes);

#else
/* Minimal libc */
+5 −5
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ void __stdout_hook_install(int (*hook)(int))
	_stdout_hook = hook;
}

int z_impl_z_zephyr_write_stdout(const void *buffer, int nbytes)
int z_impl_zephyr_write_stdout(const void *buffer, int nbytes)
{
	const char *buf = buffer;
	int i;
@@ -42,12 +42,12 @@ int z_impl_z_zephyr_write_stdout(const void *buffer, int nbytes)
}

#ifdef CONFIG_USERSPACE
static inline int z_vrfy_z_zephyr_write_stdout(const void *buf, int nbytes)
static inline int z_vrfy_zephyr_write_stdout(const void *buf, int nbytes)
{
	Z_OOPS(Z_SYSCALL_MEMORY_READ(buf, nbytes));
	return z_impl_z_zephyr_write_stdout(buf, nbytes);
	return z_impl_zephyr_write_stdout(buf, nbytes);
}
#include <syscalls/z_zephyr_write_stdout_mrsh.c>
#include <syscalls/zephyr_write_stdout_mrsh.c>
#endif

#ifndef CONFIG_POSIX_API
@@ -55,7 +55,7 @@ int _write(int fd, const char *buf, unsigned int nbytes)
{
	ARG_UNUSED(fd);

	return z_zephyr_write_stdout(buf, nbytes);
	return zephyr_write_stdout(buf, nbytes);
}
#endif

+10 −10
Original line number Diff line number Diff line
@@ -178,7 +178,7 @@ void __stdin_hook_install(unsigned char (*hook)(void))
	_stdin_hook = hook;
}

int z_impl_z_zephyr_read_stdin(char *buf, int nbytes)
int z_impl_zephyr_read_stdin(char *buf, int nbytes)
{
	int i = 0;

@@ -193,15 +193,15 @@ int z_impl_z_zephyr_read_stdin(char *buf, int nbytes)
}

#ifdef CONFIG_USERSPACE
static inline int z_vrfy_z_zephyr_read_stdin(char *buf, int nbytes)
static inline int z_vrfy_zephyr_read_stdin(char *buf, int nbytes)
{
	Z_OOPS(Z_SYSCALL_MEMORY_WRITE(buf, nbytes));
	return z_impl_z_zephyr_read_stdin((char *)buf, nbytes);
	return z_impl_zephyr_read_stdin((char *)buf, nbytes);
}
#include <syscalls/z_zephyr_read_stdin_mrsh.c>
#include <syscalls/zephyr_read_stdin_mrsh.c>
#endif

int z_impl_z_zephyr_write_stdout(const void *buffer, int nbytes)
int z_impl_zephyr_write_stdout(const void *buffer, int nbytes)
{
	const char *buf = buffer;
	int i;
@@ -216,12 +216,12 @@ int z_impl_z_zephyr_write_stdout(const void *buffer, int nbytes)
}

#ifdef CONFIG_USERSPACE
static inline int z_vrfy_z_zephyr_write_stdout(const void *buf, int nbytes)
static inline int z_vrfy_zephyr_write_stdout(const void *buf, int nbytes)
{
	Z_OOPS(Z_SYSCALL_MEMORY_READ(buf, nbytes));
	return z_impl_z_zephyr_write_stdout((const void *)buf, nbytes);
	return z_impl_zephyr_write_stdout((const void *)buf, nbytes);
}
#include <syscalls/z_zephyr_write_stdout_mrsh.c>
#include <syscalls/zephyr_write_stdout_mrsh.c>
#endif

#ifndef CONFIG_POSIX_API
@@ -229,7 +229,7 @@ int _read(int fd, char *buf, int nbytes)
{
	ARG_UNUSED(fd);

	return z_zephyr_read_stdin(buf, nbytes);
	return zephyr_read_stdin(buf, nbytes);
}
__weak FUNC_ALIAS(_read, read, int);

@@ -237,7 +237,7 @@ int _write(int fd, const void *buf, int nbytes)
{
	ARG_UNUSED(fd);

	return z_zephyr_write_stdout(buf, nbytes);
	return zephyr_write_stdout(buf, nbytes);
}
__weak FUNC_ALIAS(_write, write, int);