2018-03-27 07:57:25 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2018, Intel Corporation.
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
2018-09-15 01:43:44 +08:00
|
|
|
#ifndef ZEPHYR_INCLUDE_MISC_LIBC_HOOKS_H_
|
|
|
|
#define ZEPHYR_INCLUDE_MISC_LIBC_HOOKS_H_
|
2018-03-27 07:57:25 +08:00
|
|
|
|
|
|
|
#include <toolchain.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Private header for specifying accessory functions to the C library internals
|
|
|
|
* that need to call into the kernel as system calls
|
|
|
|
*/
|
|
|
|
|
2018-03-27 08:07:33 +08:00
|
|
|
#ifdef CONFIG_NEWLIB_LIBC
|
|
|
|
|
|
|
|
/* syscall generation ignores preprocessor, ensure this is defined to ensure
|
|
|
|
* we don't have compile errors
|
|
|
|
*/
|
|
|
|
#define _MLIBC_RESTRICT
|
|
|
|
|
|
|
|
__syscall int _zephyr_read(char *buf, int nbytes);
|
|
|
|
|
|
|
|
__syscall int _zephyr_write(char *buf, int nbytes);
|
|
|
|
|
|
|
|
#else
|
2018-03-27 07:57:25 +08:00
|
|
|
/* Minimal libc */
|
|
|
|
|
|
|
|
__syscall int _zephyr_fputc(int c, FILE *stream);
|
|
|
|
|
|
|
|
__syscall size_t _zephyr_fwrite(const void *_MLIBC_RESTRICT ptr, size_t size,
|
|
|
|
size_t nitems, FILE *_MLIBC_RESTRICT stream);
|
|
|
|
|
2018-03-27 08:07:33 +08:00
|
|
|
#endif /* CONFIG_NEWLIB_LIBC */
|
|
|
|
|
2018-03-27 07:57:25 +08:00
|
|
|
#include <syscalls/libc-hooks.h>
|
|
|
|
|
2018-09-15 01:43:44 +08:00
|
|
|
#endif /* ZEPHYR_INCLUDE_MISC_LIBC_HOOKS_H_ */
|