From: "Kristian Høgsberg" <krh@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: "Kristian Høgsberg" <krh@redhat.com>
Subject: [PATCH 1/2] Use structs instead of hardcoded offsets in x86 boot decompressor.
Date: Fri, 23 May 2008 17:59:27 -0400 [thread overview]
Message-ID: <1211579968-15227-1-git-send-email-krh@redhat.com> (raw)
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
---
arch/x86/boot/compressed/misc.c | 26 +++++++++++---------------
1 files changed, 11 insertions(+), 15 deletions(-)
diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c
index 90456ce..0d03579 100644
--- a/arch/x86/boot/compressed/misc.c
+++ b/arch/x86/boot/compressed/misc.c
@@ -30,6 +30,7 @@
#include <asm/io.h>
#include <asm/page.h>
#include <asm/boot.h>
+#include <asm/bootparam.h>
/* WARNING!!
* This code is compiled with -fPIC and it is relocated dynamically
@@ -187,13 +188,8 @@ static void gzip_release(void **);
/*
* This is set up by the setup-routine at boot-time
*/
-static unsigned char *real_mode; /* Pointer to real-mode data */
-
-#define RM_EXT_MEM_K (*(unsigned short *)(real_mode + 0x2))
-#ifndef STANDARD_MEMORY_BIOS_CALL
-#define RM_ALT_MEM_K (*(unsigned long *)(real_mode + 0x1e0))
-#endif
-#define RM_SCREEN_INFO (*(struct screen_info *)(real_mode+0))
+static struct boot_params *real_mode; /* Pointer to real-mode data */
+static struct screen_info *rm_screen_info; /* Pointer to real-mode data */
extern unsigned char input_data[];
extern int input_len;
@@ -276,12 +272,12 @@ static void putstr(const char *s)
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;
#endif
- x = RM_SCREEN_INFO.orig_x;
- y = RM_SCREEN_INFO.orig_y;
+ x = rm_screen_info->orig_x;
+ y = rm_screen_info->orig_y;
while ((c = *s++) != '\0') {
if (c == '\n') {
@@ -302,8 +298,8 @@ static void putstr(const char *s)
}
}
- RM_SCREEN_INFO.orig_x = x;
- RM_SCREEN_INFO.orig_y = y;
+ rm_screen_info->orig_x = x;
+ rm_screen_info->orig_y = y;
pos = (x + cols * y) * 2; /* Update cursor position */
outb(14, vidport);
@@ -430,7 +426,7 @@ asmlinkage void decompress_kernel(void *rmode, memptr heap,
{
real_mode = rmode;
- if (RM_SCREEN_INFO.orig_video_mode == 7) {
+ if (rm_screen_info->orig_video_mode == 7) {
vidmem = (char *) 0xb0000;
vidport = 0x3b4;
} else {
@@ -438,8 +434,8 @@ asmlinkage void decompress_kernel(void *rmode, memptr heap,
vidport = 0x3d4;
}
- lines = RM_SCREEN_INFO.orig_video_lines;
- cols = RM_SCREEN_INFO.orig_video_cols;
+ lines = rm_screen_info->orig_video_lines;
+ cols = rm_screen_info->orig_video_cols;
window = output; /* Output buffer (Normally at 1M) */
free_mem_ptr = heap; /* Heap */
--
1.5.5.1
next reply other threads:[~2008-05-23 22:00 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-23 21:59 Kristian Høgsberg [this message]
2008-05-23 21:59 ` [PATCH 2/2] Only print "Decompressing Linux" etc when 'noisy' is passed Kristian Høgsberg
2008-05-23 22:42 ` Johannes Weiner
2008-05-24 9:25 ` Mikael Pettersson
2008-05-24 18:07 ` Diego Calleja
2008-05-24 1:07 ` [PATCH 1/2] Use structs instead of hardcoded offsets in x86 boot decompressor Rik van Riel
2008-05-24 6:17 ` H. Peter Anvin
2008-05-25 4:03 ` Rik van Riel
2008-05-25 4:06 ` H. Peter Anvin
2008-05-25 4:25 ` Kristian Høgsberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1211579968-15227-1-git-send-email-krh@redhat.com \
--to=krh@redhat.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®