mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Kristian Høgsberg" <krh@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: "Kristian Høgsberg" <krh@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>
Subject: [PATCH 1/2 v3] Use structs instead of hardcoded offsets in x86 boot decompressor.
Date: Thu, 29 May 2008 13:27:11 -0400	[thread overview]
Message-ID: <1212082032-6167-1-git-send-email-krh@redhat.com> (raw)

Just a minor cleanup, making it easier to access the command line in
the following "Honor quiet in decompressor" patch.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>

---

Updated this one to be less intrusive; we just re-#define RM_SCREEN_INFO to
access the boot_params struct instead of using the hard-coded offset.

 arch/x86/boot/compressed/misc.c |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c
index 90456ce..102b68e 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 */
+#define RM_SCREEN_INFO (real_mode->screen_info)
 
 extern unsigned char input_data[];
 extern int input_len;
-- 
1.5.4.5


             reply	other threads:[~2008-05-29 17:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-29 17:27 Kristian Høgsberg [this message]
2008-05-29 17:27 ` [PATCH 2/2] Honor 'quiet' command line option in real mode " Kristian Høgsberg
2008-05-29 18:43   ` H. Peter Anvin
2008-05-29 19:55     ` Kristian Høgsberg
2008-05-29 20:30       ` H. Peter Anvin
2008-05-29 22:25         ` Kristian Høgsberg
2008-05-29 18:48 ` [PATCH 1/2 v3] Use structs instead of hardcoded offsets in x86 " H. Peter Anvin
2008-05-29 19:58   ` 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=1212082032-6167-1-git-send-email-krh@redhat.com \
    --to=krh@redhat.com \
    --cc=hpa@zytor.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®