diff --git a/repos/libports/include/libc/genode.h b/repos/libports/include/libc/genode.h new file mode 100644 index 0000000000..d504fb197b --- /dev/null +++ b/repos/libports/include/libc/genode.h @@ -0,0 +1,30 @@ +/* + * \brief POSIX wrappers for important base lib features + * \author Christian Prochaska + * \date 2020-07-06 + */ + +/* + * Copyright (C) 2020 Genode Labs GmbH + * + * This file is part of the Genode OS framework, which is distributed + * under the terms of the GNU Affero General Public License version 3. + */ + +#ifndef _INCLUDE__LIBC__GENODE_H_ +#define _INCLUDE__LIBC__GENODE_H_ + +/* libc includes */ +#include + +#ifdef __cplusplus +extern "C" { +#endif + +void genode_cache_coherent(void *addr, size_t size); + +#ifdef __cplusplus +} +#endif + +#endif /* _INCLUDE__LIBC__GENODE_H_ */ diff --git a/repos/libports/lib/mk/libc.mk b/repos/libports/lib/mk/libc.mk index bd2bbbc331..b634f4fc10 100644 --- a/repos/libports/lib/mk/libc.mk +++ b/repos/libports/lib/mk/libc.mk @@ -18,7 +18,8 @@ SRC_CC = atexit.cc dummies.cc rlimit.cc sysctl.cc \ pread_pwrite.cc readv_writev.cc poll.cc \ vfs_plugin.cc dynamic_linker.cc signal.cc \ socket_operations.cc socket_fs_plugin.cc syscall.cc legacy.cc \ - getpwent.cc getrandom.cc fork.cc execve.cc kernel.cc component.cc + getpwent.cc getrandom.cc fork.cc execve.cc kernel.cc component.cc \ + genode.cc # # Pthreads diff --git a/repos/libports/lib/symbols/libc b/repos/libports/lib/symbols/libc index 8a731c5eb6..9c55aab9c6 100644 --- a/repos/libports/lib/symbols/libc +++ b/repos/libports/lib/symbols/libc @@ -237,6 +237,7 @@ fwprintf T fwrite T fwscanf T gai_strerror T +genode_cache_coherent T getaddrinfo T getbootfile T getbsize T diff --git a/repos/libports/src/lib/libc/genode.cc b/repos/libports/src/lib/libc/genode.cc new file mode 100644 index 0000000000..5312dfd599 --- /dev/null +++ b/repos/libports/src/lib/libc/genode.cc @@ -0,0 +1,23 @@ +/* + * \brief POSIX wrappers for important base lib features + * \author Christian Prochaska + * \date 2020-07-06 + */ + +/* + * Copyright (C) 2020 Genode Labs GmbH + * + * This file is part of the Genode OS framework, which is distributed + * under the terms of the GNU Affero General Public License version 3. + */ + +/* Genode includes */ +#include + +/* libc includes */ +#include + +void genode_cache_coherent(void *addr, size_t size) +{ + Genode::cache_coherent((Genode::addr_t)addr, size); +}