iPXE
implicit.c
Go to the documentation of this file.
1 /** @file
2  *
3  * gcc sometimes likes to insert implicit calls to memcpy() and
4  * memset(). Unfortunately, there doesn't seem to be any way to
5  * prevent it from doing this, or to force it to use the optimised
6  * versions as seen by C code; it insists on inserting symbol
7  * references to "memcpy" and "memset". We therefore include wrapper
8  * functions just to keep gcc happy.
9  *
10  */
11 
12 #include <string.h>
13 
14 void * gcc_implicit_memcpy ( void *dest, const void *src,
15  size_t len ) asm ( "memcpy" );
16 
17 void * gcc_implicit_memcpy ( void *dest, const void *src, size_t len ) {
18  return memcpy ( dest, src, len );
19 }
20 
21 void * gcc_implicit_memset ( void *dest, int character,
22  size_t len ) asm ( "memset" );
23 
24 void * gcc_implicit_memset ( void *dest, int character, size_t len ) {
25  return memset ( dest, character, len );
26 }
void * gcc_implicit_memcpy(void *dest, const void *src, size_t len) asm("memcpy")
Definition: implicit.c:17
void * gcc_implicit_memset(void *dest, int character, size_t len) asm("memset")
Definition: implicit.c:24
void * memcpy(void *dest, const void *src, size_t len) __nonnull
static void * dest
Definition: strings.h:176
static __always_inline void off_t userptr_t src
Definition: efi_uaccess.h:66
uint32_t len
Length.
Definition: ena.h:14
String functions.
void * memset(void *dest, int character, size_t len) __nonnull