linux-zen-desktop/arch/um/os-Linux/user_syms.c

44 lines
1.2 KiB
C
Raw Permalink Normal View History

2023-08-30 17:31:07 +02:00
// SPDX-License-Identifier: GPL-2.0
#define __NO_FORTIFY
#include <linux/types.h>
#include <linux/module.h>
2023-10-24 12:59:35 +02:00
/*
* This file exports some critical string functions and compiler
* built-in functions (where calls are emitted by the compiler
* itself that we cannot avoid even in kernel code) to modules.
*
* "_user.c" code that previously used exports here such as hostfs
* really should be considered part of the 'hypervisor' and define
* its own API boundary like hostfs does now; don't add exports to
* this file for such cases.
2023-08-30 17:31:07 +02:00
*/
/* If it's not defined, the export is included in lib/string.c.*/
#ifdef __HAVE_ARCH_STRSTR
2023-10-24 12:59:35 +02:00
#undef strstr
2023-08-30 17:31:07 +02:00
EXPORT_SYMBOL(strstr);
#endif
#ifndef __x86_64__
2023-10-24 12:59:35 +02:00
#undef memcpy
2023-08-30 17:31:07 +02:00
extern void *memcpy(void *, const void *, size_t);
EXPORT_SYMBOL(memcpy);
2023-10-24 12:59:35 +02:00
extern void *memmove(void *, const void *, size_t);
2023-08-30 17:31:07 +02:00
EXPORT_SYMBOL(memmove);
2023-10-24 12:59:35 +02:00
#undef memset
extern void *memset(void *, int, size_t);
2023-08-30 17:31:07 +02:00
EXPORT_SYMBOL(memset);
#endif
#ifdef CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA
2023-10-24 12:59:35 +02:00
/* needed for __access_ok() */
2023-08-30 17:31:07 +02:00
EXPORT_SYMBOL(vsyscall_ehdr);
EXPORT_SYMBOL(vsyscall_end);
#endif
#ifdef _FORTIFY_SOURCE
2023-10-24 12:59:35 +02:00
extern int __sprintf_chk(char *str, int flag, size_t len, const char *format);
2023-08-30 17:31:07 +02:00
EXPORT_SYMBOL(__sprintf_chk);
#endif