Commit 778cb929 authored by Ian Campbell's avatar Ian Campbell Committed by Ingo Molnar

x86: unify arch/x86/boot/compressed/misc_??.c

Remainder of unification can occur inplace.

size reports no change in arch/x86/boot/compressed/vmlinux.
Signed-off-by: default avatarIan Campbell <ijc@hellion.org.uk>
Cc: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 4c83d653
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# create a compressed vmlinux image from the original vmlinux # create a compressed vmlinux image from the original vmlinux
# #
targets := vmlinux vmlinux.bin vmlinux.bin.gz head_$(BITS).o misc_$(BITS).o piggy.o targets := vmlinux vmlinux.bin vmlinux.bin.gz head_$(BITS).o misc.o piggy.o
KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O2 KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O2
KBUILD_CFLAGS += -fno-strict-aliasing -fPIC KBUILD_CFLAGS += -fno-strict-aliasing -fPIC
...@@ -18,7 +18,7 @@ KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ ...@@ -18,7 +18,7 @@ KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
LDFLAGS := -m elf_$(UTS_MACHINE) LDFLAGS := -m elf_$(UTS_MACHINE)
LDFLAGS_vmlinux := -T LDFLAGS_vmlinux := -T
$(obj)/vmlinux: $(src)/vmlinux_$(BITS).lds $(obj)/head_$(BITS).o $(obj)/misc_$(BITS).o $(obj)/piggy.o FORCE $(obj)/vmlinux: $(src)/vmlinux_$(BITS).lds $(obj)/head_$(BITS).o $(obj)/misc.o $(obj)/piggy.o FORCE
$(call if_changed,ld) $(call if_changed,ld)
@: @:
......
...@@ -15,6 +15,11 @@ ...@@ -15,6 +15,11 @@
* we just keep it from happening * we just keep it from happening
*/ */
#undef CONFIG_PARAVIRT #undef CONFIG_PARAVIRT
#ifdef CONFIG_X86_64
#define _LINUX_STRING_H_ 1
#define __LINUX_BITMAP_H 1
#endif
#include <linux/linkage.h> #include <linux/linkage.h>
#include <linux/screen_info.h> #include <linux/screen_info.h>
#include <asm/io.h> #include <asm/io.h>
...@@ -190,10 +195,20 @@ static void *memcpy(void *dest, const void *src, unsigned n); ...@@ -190,10 +195,20 @@ static void *memcpy(void *dest, const void *src, unsigned n);
static void putstr(const char *); static void putstr(const char *);
static unsigned long free_mem_ptr; #ifdef CONFIG_X86_64
static unsigned long free_mem_end_ptr; #define memptr long
#else
#define memptr unsigned
#endif
static memptr free_mem_ptr;
static memptr free_mem_end_ptr;
#ifdef CONFIG_X86_64
#define HEAP_SIZE 0x7000
#else
#define HEAP_SIZE 0x4000 #define HEAP_SIZE 0x4000
#endif
static char *vidmem = (char *)0xb8000; static char *vidmem = (char *)0xb8000;
static int vidport; static int vidport;
...@@ -234,7 +249,7 @@ static void gzip_mark(void **ptr) ...@@ -234,7 +249,7 @@ static void gzip_mark(void **ptr)
static void gzip_release(void **ptr) static void gzip_release(void **ptr)
{ {
free_mem_ptr = (unsigned long) *ptr; free_mem_ptr = (memptr) *ptr;
} }
static void scroll(void) static void scroll(void)
...@@ -251,8 +266,10 @@ static void putstr(const char *s) ...@@ -251,8 +266,10 @@ static void putstr(const char *s)
int x,y,pos; int x,y,pos;
char c; char c;
#ifdef CONFIG_X86_32
if (RM_SCREEN_INFO.orig_video_mode == 0 && lines == 0 && cols == 0) if (RM_SCREEN_INFO.orig_video_mode == 0 && lines == 0 && cols == 0)
return; return;
#endif
x = RM_SCREEN_INFO.orig_x; x = RM_SCREEN_INFO.orig_x;
y = RM_SCREEN_INFO.orig_y; y = RM_SCREEN_INFO.orig_y;
...@@ -348,7 +365,7 @@ static void error(char *x) ...@@ -348,7 +365,7 @@ static void error(char *x)
asm("hlt"); asm("hlt");
} }
asmlinkage void decompress_kernel(void *rmode, unsigned long heap, asmlinkage void decompress_kernel(void *rmode, memptr heap,
uch *input_data, unsigned long input_len, uch *input_data, unsigned long input_len,
uch *output) uch *output)
{ {
...@@ -372,6 +389,12 @@ asmlinkage void decompress_kernel(void *rmode, unsigned long heap, ...@@ -372,6 +389,12 @@ asmlinkage void decompress_kernel(void *rmode, unsigned long heap,
insize = input_len; insize = input_len;
inptr = 0; inptr = 0;
#ifdef CONFIG_X86_64
if ((ulg)output & (__KERNEL_ALIGN - 1))
error("Destination address not 2M aligned");
if ((ulg)output >= 0xffffffffffUL)
error("Destination address too large");
#else
if ((u32)output & (CONFIG_PHYSICAL_ALIGN -1)) if ((u32)output & (CONFIG_PHYSICAL_ALIGN -1))
error("Destination address not CONFIG_PHYSICAL_ALIGN aligned"); error("Destination address not CONFIG_PHYSICAL_ALIGN aligned");
if (heap > ((-__PAGE_OFFSET-(512<<20)-1) & 0x7fffffff)) if (heap > ((-__PAGE_OFFSET-(512<<20)-1) & 0x7fffffff))
...@@ -379,6 +402,7 @@ asmlinkage void decompress_kernel(void *rmode, unsigned long heap, ...@@ -379,6 +402,7 @@ asmlinkage void decompress_kernel(void *rmode, unsigned long heap,
#ifndef CONFIG_RELOCATABLE #ifndef CONFIG_RELOCATABLE
if ((u32)output != LOAD_PHYSICAL_ADDR) if ((u32)output != LOAD_PHYSICAL_ADDR)
error("Wrong destination address"); error("Wrong destination address");
#endif
#endif #endif
makecrc(); makecrc();
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment