1 // SPDX-License-Identifier: GPL-2.0+
3 * Library for freestanding binary
5 * Copyright 2019, Heinrich Schuchardt <xypron.glpk@gmx.de>
7 * GCC requires that freestanding programs provide memcpy(), memmove(),
8 * memset(), and memcmp().
14 * memcmp() - compare memory areas
16 * @s1: pointer to first area
17 * @s2: pointer to second area
18 * @n: number of bytes to compare
19 * Return: 0 if both memory areas are the same, otherwise the sign of the
20 * result value is the same as the sign of the difference between
21 * the first differing pair of bytes taken as u8.
23 int memcmp(const void *s1, const void *s2, size_t n)
38 * memcpy() - copy memory area
40 * @dest: destination buffer
42 * @n: number of bytes to copy
43 * Return: pointer to destination buffer
45 void *memmove(void *dest, const void *src, size_t n)
63 * memcpy() - copy memory area
65 * @dest: destination buffer
67 * @n: number of bytes to copy
68 * Return: pointer to destination buffer
70 void *memcpy(void *dest, const void *src, size_t n)
72 return memmove(dest, src, n);
76 * memset() - fill memory with a constant byte
78 * @s: destination buffer
80 * @n: number of bytes to set
81 * Return: pointer to destination buffer
83 void *memset(void *s, int c, size_t n)
93 * __cyg_profile_func_enter() - record function entry
95 * This is called on every function entry when compiling with
96 * -finstrument-functions.
100 * @param func_ptr Pointer to function being entered
101 * @param caller Pointer to function which called this function
103 void __attribute__((no_instrument_function))
104 __cyg_profile_func_enter(void *func_ptr, void *caller)
109 * __cyg_profile_func_exit() - record function exit
111 * This is called on every function exit when compiling with
112 * -finstrument-functions.
114 * We do nothing here.
116 * @param func_ptr Pointer to function being entered
117 * @param caller Pointer to function which called this function
119 void __attribute__((no_instrument_function))
120 __cyg_profile_func_exit(void *func_ptr, void *caller)