]> err.no Git - linux-2.6/blobdiff - arch/x86/boot/compressed/misc_32.c
x86: unify whitespace and comments in arch/x86/boot/compressed/misc_??.c
[linux-2.6] / arch / x86 / boot / compressed / misc_32.c
index b74d60d1b2fa1329f6f28c434fc47445cb39ccb4..52fc214546e9e0f3110778376dc03f5399187e8f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * misc.c
- * 
- * This is a collection of several routines from gzip-1.0.3 
+ *
+ * This is a collection of several routines from gzip-1.0.3
  * adapted for Linux.
  *
  * malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994
@@ -9,6 +9,11 @@
  * High loaded stuff by Hans Lermen & Werner Almesberger, Feb. 1996
  */
 
+/*
+ * we have to be careful, because no indirections are allowed here, and
+ * paravirt_ops is a kind of one. As it will only run in baremetal anyway,
+ * we just keep it from happening
+ */
 #undef CONFIG_PARAVIRT
 #include <linux/linkage.h>
 #include <linux/vmalloc.h>
@@ -261,7 +266,7 @@ static void putstr(const char *s)
                                y--;
                        }
                } else {
-                       vidmem [ ( x + cols * y ) * 2 ] = c;
+                       vidmem [(x + cols * y) * 2] = c;
                        if ( ++x >= cols ) {
                                x = 0;
                                if ( ++y >= lines ) {
@@ -276,16 +281,16 @@ static void putstr(const char *s)
        RM_SCREEN_INFO.orig_y = y;
 
        pos = (x + cols * y) * 2;       /* Update cursor position */
-       outb_p(14, vidport);
-       outb_p(0xff & (pos >> 9), vidport+1);
-       outb_p(15, vidport);
-       outb_p(0xff & (pos >> 1), vidport+1);
+       outb(14, vidport);
+       outb(0xff & (pos >> 9), vidport+1);
+       outb(15, vidport);
+       outb(0xff & (pos >> 1), vidport+1);
 }
 
 static void* memset(void* s, int c, unsigned n)
 {
        int i;
-       char *ss = (char*)s;
+       char *ss = s;
 
        for (i=0;i<n;i++) ss[i] = c;
        return s;
@@ -294,7 +299,8 @@ static void* memset(void* s, int c, unsigned n)
 static void* memcpy(void* dest, const void* src, unsigned n)
 {
        int i;
-       char *d = (char *)dest, *s = (char *)src;
+       const char *s = src;
+       char *d = dest;
 
        for (i=0;i<n;i++) d[i] = s[i];
        return dest;
@@ -339,11 +345,13 @@ static void error(char *x)
        putstr(x);
        putstr("\n\n -- System halted");
 
-       while(1);       /* Halt */
+       while (1)
+               asm("hlt");
 }
 
 asmlinkage void decompress_kernel(void *rmode, unsigned long end,
-                       uch *input_data, unsigned long input_len, uch *output)
+                                 uch *input_data, unsigned long input_len,
+                                 uch *output)
 {
        real_mode = rmode;
 
@@ -358,10 +366,10 @@ asmlinkage void decompress_kernel(void *rmode, unsigned long end,
        lines = RM_SCREEN_INFO.orig_video_lines;
        cols = RM_SCREEN_INFO.orig_video_cols;
 
-       window = output;        /* Output buffer (Normally at 1M) */
-       free_mem_ptr     = end; /* Heap  */
+       window = output;                /* Output buffer (Normally at 1M) */
+       free_mem_ptr     = end;         /* Heap */
        free_mem_end_ptr = end + HEAP_SIZE;
-       inbuf  = input_data;    /* Input buffer */
+       inbuf  = input_data;            /* Input buffer */
        insize = input_len;
        inptr  = 0;
 
@@ -375,8 +383,8 @@ asmlinkage void decompress_kernel(void *rmode, unsigned long end,
 #endif
 
        makecrc();
-       putstr("Uncompressing Linux... ");
+       putstr("\nDecompressing Linux... ");
        gunzip();
-       putstr("Ok, booting the kernel.\n");
+       putstr("done.\nBooting the kernel.\n");
        return;
 }