aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/boot/compressed/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/boot/compressed/misc.c')
-rw-r--r--arch/x86/boot/compressed/misc.c35
1 files changed, 28 insertions, 7 deletions
diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c
index 8f7bef8e9fff..3a19d04cebeb 100644
--- a/arch/x86/boot/compressed/misc.c
+++ b/arch/x86/boot/compressed/misc.c
@@ -139,6 +139,10 @@ static int lines, cols;
139#include "../../../../lib/decompress_unlzma.c" 139#include "../../../../lib/decompress_unlzma.c"
140#endif 140#endif
141 141
142#ifdef CONFIG_KERNEL_XZ
143#include "../../../../lib/decompress_unxz.c"
144#endif
145
142#ifdef CONFIG_KERNEL_LZO 146#ifdef CONFIG_KERNEL_LZO
143#include "../../../../lib/decompress_unlzo.c" 147#include "../../../../lib/decompress_unlzo.c"
144#endif 148#endif
@@ -229,18 +233,35 @@ void *memset(void *s, int c, size_t n)
229 ss[i] = c; 233 ss[i] = c;
230 return s; 234 return s;
231} 235}
232 236#ifdef CONFIG_X86_32
233void *memcpy(void *dest, const void *src, size_t n) 237void *memcpy(void *dest, const void *src, size_t n)
234{ 238{
235 int i; 239 int d0, d1, d2;
236 const char *s = src; 240 asm volatile(
237 char *d = dest; 241 "rep ; movsl\n\t"
242 "movl %4,%%ecx\n\t"
243 "rep ; movsb\n\t"
244 : "=&c" (d0), "=&D" (d1), "=&S" (d2)
245 : "0" (n >> 2), "g" (n & 3), "1" (dest), "2" (src)
246 : "memory");
238 247
239 for (i = 0; i < n; i++)
240 d[i] = s[i];
241 return dest; 248 return dest;
242} 249}
250#else
251void *memcpy(void *dest, const void *src, size_t n)
252{
253 long d0, d1, d2;
254 asm volatile(
255 "rep ; movsq\n\t"
256 "movq %4,%%rcx\n\t"
257 "rep ; movsb\n\t"
258 : "=&c" (d0), "=&D" (d1), "=&S" (d2)
259 : "0" (n >> 3), "g" (n & 7), "1" (dest), "2" (src)
260 : "memory");
243 261
262 return dest;
263}
264#endif
244 265
245static void error(char *x) 266static void error(char *x)
246{ 267{
@@ -338,7 +359,7 @@ asmlinkage void decompress_kernel(void *rmode, memptr heap,
338 if (heap > 0x3fffffffffffUL) 359 if (heap > 0x3fffffffffffUL)
339 error("Destination address too large"); 360 error("Destination address too large");
340#else 361#else
341 if (heap > ((-__PAGE_OFFSET-(512<<20)-1) & 0x7fffffff)) 362 if (heap > ((-__PAGE_OFFSET-(128<<20)-1) & 0x7fffffff))
342 error("Destination address too large"); 363 error("Destination address too large");
343#endif 364#endif
344#ifndef CONFIG_RELOCATABLE 365#ifndef CONFIG_RELOCATABLE