i386/x86-64: Consolidate arch/{i386,x86_64}/boot/compressed/misc.c
PATCH 39/82 i386/x86-64: Consolidate arch/{i386,x86_64}/boot/compressed/misc.c
From: Carl-Daniel Hailfinger <[email protected]>
Clean up arch/{i386,x86_64}/boot/compressed/misc.c a bit to reduce their
Signed-off-by Andi Kleen <[email protected]>
differences. Should have zero effect on code generation.
Signed-off-by Carl-Daniel Hailfinger <[email protected]>
--- arch/i386/boot/compressed/misc.c | 32 +++++++++---------------- arch/x86_64/boot/compressed/misc.c | 46 ++++++++++++++++++------------------- 2 files changed, 35 insertions(+), 43 deletions(-)
arch/i386/boot/compressed/misc.c +12 -20
@@ -24,14 +24,6 @@#undef memset#undef memcpy - -/* -* Why do we do this? Don't ask me.. -* -* Incomprehensible are the ways of bootloaders. -*/ -static void *memset (void *,int ,size_t ); -static void* memcpy(void *, __const void *, size_t);#define memzero (s, n) memset ((s), 0, (n))typedef unsigned char uch ;
@@ -93,7 +85,7 @@ static unsigned char *real_mode; /* Poin#endif #define RM_SCREEN_INFO (*(struct screen_info *)(real_mode+0)) -extern char input_data[]; +extern unsigned char input_data[];extern int input_len;static long bytes_out =0 ;
@@ -103,6 +95,9 @@ static unsigned long output_ptr = 0;static void *malloc (int size);static void free (void *where); +static void *memset (void *s,int c,unsigned n); +static void *memcpy (void *dest,const void *src,unsigned n); +static void putstr (const char *);extern int end;
@@ -205,7 +200,7 @@ static void putstr(const char *s)outb_p (0xff & (pos >>1 ), vidport+1 ); } -static void *memset (void * s,int c,size_t n) +static void *memset (void * s,int c,unsigned n) {int i;char *ss = (char *)s;
@@ -214,14 +209,13 @@ static void* memset(void* s, int c, sizereturn s; } -static void* memcpy(void* __dest, __const void* __src, -size_t __n) +static void *memcpy (void * dest,const void * src,unsigned n) {int i; -char *d = (char *)__dest, *s = (char *)__src; +char *d = (char *)dest, *s = (char *)src; -for (i=0 ;i<__n;i++) d[i] = s[i]; -return __dest; +for (i=0 ;i<n;i++) d[i] = s[i]; +return dest; }/* ===========================================================================
@@ -309,7 +303,7 @@ static void setup_normal_output_buffer(v#else if ((RM_ALT_MEM_K >RM_EXT_MEM_K ?RM_ALT_MEM_K :RM_EXT_MEM_K ) <1024 )error ("Less than 2MB of memory" );#endif - output_data = (char *)__PHYSICAL_START;/* Normally Points to 1M */ + output_data = (unsigned char *)__PHYSICAL_START;/* Normally Points to 1M */ free_mem_end_ptr = (long )real_mode; }
@@ -324,11 +318,9 @@ static void setup_output_buffer_if_we_ru#ifdef STANDARD_MEMORY_BIOS_CALL if (RM_EXT_MEM_K < (3 *1024 ))error ("Less than 4MB of memory" );#else -if ((RM_ALT_MEM_K >RM_EXT_MEM_K ?RM_ALT_MEM_K :RM_EXT_MEM_K ) < - (3 *1024 )) -error ("Less than 4MB of memory" ); +if ((RM_ALT_MEM_K >RM_EXT_MEM_K ?RM_ALT_MEM_K :RM_EXT_MEM_K ) < (3 *1024 ))error ("Less than 4MB of memory" );#endif - mv->low_buffer_start = output_data = (char *)LOW_BUFFER_START ; + mv->low_buffer_start = output_data = (unsigned char *)LOW_BUFFER_START ; low_buffer_end = ((unsigned int )real_mode >LOW_BUFFER_MAX ?LOW_BUFFER_MAX : (unsigned int )real_mode) & ~0xfff ; low_buffer_size = low_buffer_end -LOW_BUFFER_START ;
arch/x86_64/boot/compressed/misc.c +23 -23
123 lines not on this page · raw message