xref: /DragonStub/lib/aarch64/initplat.c (revision 39ce220cb6fde14bedf2ef61695f3d20726e41ef)
1 /*
2  * Copright (C) 2014 Linaro Ltd.
3  * Author: Ard Biesheuvel <ard.biesheuvel@linaro.org>
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice and this list of conditions, without modification.
10  * 2. The name of the author may not be used to endorse or promote products
11  *    derived from this software without specific prior written permission.
12  *
13  * Alternatively, this software may be distributed under the terms of the
14  * GNU General Public License as published by the Free Software Foundation;
15  * either version 2 of the License, or (at your option) any later version.
16  */
17 
18 #include "lib.h"
19 
20 VOID
21 InitializeLibPlatform (
22     IN EFI_HANDLE           ImageHandle EFI_UNUSED,
23     IN EFI_SYSTEM_TABLE     *SystemTable EFI_UNUSED
24     )
25 {
26 }
27 
28 #ifndef __SIZE_TYPE__
29 #define __SIZE_TYPE__ UINTN
30 #endif
31 
32 /*
33  * Calls to these functions may be emitted implicitly by GCC even when
34  * -ffreestanding is in effect.
35  */
36 void *memset(void *s, int c, __SIZE_TYPE__ n)
37 {
38     unsigned char *p = s;
39 
40     while (n--)
41         *p++ = c;
42 
43     return s;
44 }
45 
46 void *memcpy(void *dest, const void *src, __SIZE_TYPE__ n)
47 {
48     const unsigned char *q = src;
49     unsigned char *p = dest;
50 
51     while (n--)
52         *p++ = *q++;
53 
54     return dest;
55 }
56