aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/boot/compressed/misc.c20
-rw-r--r--arch/x86/boot/compressed/string.c10
2 files changed, 17 insertions, 13 deletions
diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c
index 3100092b1346..17684615374b 100644
--- a/arch/x86/boot/compressed/misc.c
+++ b/arch/x86/boot/compressed/misc.c
@@ -98,8 +98,14 @@
98 */ 98 */
99#define STATIC static 99#define STATIC static
100 100
101#undef memset
102#undef memcpy 101#undef memcpy
102
103/*
104 * Use a normal definition of memset() from string.c. There are already
105 * included header files which expect a definition of memset() and by
106 * the time we define memset macro, it is too late.
107 */
108#undef memset
103#define memzero(s, n) memset((s), 0, (n)) 109#define memzero(s, n) memset((s), 0, (n))
104 110
105 111
@@ -110,8 +116,6 @@ static void error(char *m);
110 */ 116 */
111struct boot_params *real_mode; /* Pointer to real-mode data */ 117struct boot_params *real_mode; /* Pointer to real-mode data */
112 118
113void *memset(void *s, int c, size_t n);
114
115memptr free_mem_ptr; 119memptr free_mem_ptr;
116memptr free_mem_end_ptr; 120memptr free_mem_end_ptr;
117 121
@@ -216,16 +220,6 @@ void __putstr(const char *s)
216 outb(0xff & (pos >> 1), vidport+1); 220 outb(0xff & (pos >> 1), vidport+1);
217} 221}
218 222
219void *memset(void *s, int c, size_t n)
220{
221 int i;
222 char *ss = s;
223
224 for (i = 0; i < n; i++)
225 ss[i] = c;
226 return s;
227}
228
229static void error(char *x) 223static void error(char *x)
230{ 224{
231 error_putstr("\n\n"); 225 error_putstr("\n\n");
diff --git a/arch/x86/boot/compressed/string.c b/arch/x86/boot/compressed/string.c
index 920b55e3e241..f3c57e341402 100644
--- a/arch/x86/boot/compressed/string.c
+++ b/arch/x86/boot/compressed/string.c
@@ -33,3 +33,13 @@ void *memcpy(void *dest, const void *src, size_t n)
33 return dest; 33 return dest;
34} 34}
35#endif 35#endif
36
37void *memset(void *s, int c, size_t n)
38{
39 int i;
40 char *ss = s;
41
42 for (i = 0; i < n; i++)
43 ss[i] = c;
44 return s;
45}