All of lore.kernel.org
 help / color / mirror / Atom feed
From: Atish Patra <atish.patra@wdc.com>
To: grub-devel@gnu.org
Cc: Atish Patra <atish.patra@wdc.com>,
	Ard Biesheuvel <ardb@kernel.org>,
	David Abdurachmanov <david.abdurachmanov@sifive.com>,
	leif@nuviainc.com, Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Alexander Graf <agraf@csgraf.de>,
	Daniel Kiper <dkiper@net-space.pl>, Chester Lin <clin@suse.com>
Subject: [PATCH RFC/RFT 2/3] RISC-V: Update image header
Date: Sun, 26 Apr 2020 12:40:06 -0700	[thread overview]
Message-ID: <20200426194007.382925-3-atish.patra@wdc.com> (raw)
In-Reply-To: <20200426194007.382925-1-atish.patra@wdc.com>

Update the RISC-V Linux kernel image headers as per the current header.

Reference:
<Linux kernel source>/Documentation/riscv/boot-image-header.rst

Signed-off-by: Atish Patra <atish.patra@wdc.com>
---
 include/grub/riscv32/linux.h | 15 ++++++++-------
 include/grub/riscv64/linux.h | 15 ++++++++-------
 2 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/include/grub/riscv32/linux.h b/include/grub/riscv32/linux.h
index 512b777c8a41..de0dbdcd1be5 100644
--- a/include/grub/riscv32/linux.h
+++ b/include/grub/riscv32/linux.h
@@ -19,20 +19,21 @@
 #ifndef GRUB_RISCV32_LINUX_HEADER
 #define GRUB_RISCV32_LINUX_HEADER 1
 
-#define GRUB_LINUX_RISCV_MAGIC_SIGNATURE 0x52534356 /* 'RSCV' */
+#define GRUB_LINUX_RISCV_MAGIC_SIGNATURE 0x05435352 /* 'RSC\0x5' */
 
-/* From linux/Documentation/riscv/booting.txt */
+/* From linux/Documentation/riscv/boot-image-header.rst */
 struct linux_riscv_kernel_header
 {
   grub_uint32_t code0;		/* Executable code */
   grub_uint32_t code1;		/* Executable code */
-  grub_uint64_t text_offset;	/* Image load offset */
-  grub_uint64_t res0;		/* reserved */
-  grub_uint64_t res1;		/* reserved */
+  grub_uint64_t text_offset;	/* Image load offset, little endian */
+  grub_uint64_t image_size;	/* Effective Image size, little endian */
+  grub_uint64_t flags;		/* kernel flags, little endian */
+  grub_uint32_t version;	/* Version of this header */
+  grub_uint32_t res1;		/* reserved */
   grub_uint64_t res2;		/* reserved */
   grub_uint64_t res3;		/* reserved */
-  grub_uint64_t res4;		/* reserved */
-  grub_uint32_t magic;		/* Magic number, little endian, "RSCV" */
+  grub_uint32_t magic;		/* Magic number, little endian, "RSC\x05" */
   grub_uint32_t hdr_offset;	/* Offset of PE/COFF header */
 };
 
diff --git a/include/grub/riscv64/linux.h b/include/grub/riscv64/linux.h
index 3630c30fbf1a..7c28bc92278e 100644
--- a/include/grub/riscv64/linux.h
+++ b/include/grub/riscv64/linux.h
@@ -19,22 +19,23 @@
 #ifndef GRUB_RISCV64_LINUX_HEADER
 #define GRUB_RISCV64_LINUX_HEADER 1
 
-#define GRUB_LINUX_RISCV_MAGIC_SIGNATURE 0x52534356 /* 'RSCV' */
+#define GRUB_LINUX_RISCV_MAGIC_SIGNATURE 0x05435352 /* 'RSC\0x5' */
 
 #define GRUB_EFI_PE_MAGIC	0x5A4D
 
-/* From linux/Documentation/riscv/booting.txt */
+/* From linux/Documentation/riscv/boot-image-header.rst */
 struct linux_riscv_kernel_header
 {
   grub_uint32_t code0;		/* Executable code */
   grub_uint32_t code1;		/* Executable code */
-  grub_uint64_t text_offset;	/* Image load offset */
-  grub_uint64_t res0;		/* reserved */
-  grub_uint64_t res1;		/* reserved */
+  grub_uint64_t text_offset;	/* Image load offset, little endian */
+  grub_uint64_t image_size;	/* Effective Image size, little endian */
+  grub_uint64_t flags;		/* kernel flags, little endian */
+  grub_uint32_t version;	/* Version of this header */
+  grub_uint32_t res1;		/* reserved */
   grub_uint64_t res2;		/* reserved */
   grub_uint64_t res3;		/* reserved */
-  grub_uint64_t res4;		/* reserved */
-  grub_uint32_t magic;		/* Magic number, little endian, "RSCV" */
+  grub_uint32_t magic;		/* Magic number, little endian, "RSC\x05" */
   grub_uint32_t hdr_offset;	/* Offset of PE/COFF header */
 };
 
-- 
2.25.1



  parent reply	other threads:[~2020-04-26 19:41 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-26 19:40 [PATCH RFC/RFT 0/3] Add grub loader support for RISC-V Linux Atish Patra
2020-04-26 19:40 ` [PATCH RFC/RFT 1/3] loader: Move arm64 linux loader to common code Atish Patra
2020-04-26 23:01   ` Heinrich Schuchardt
2020-04-26 19:40 ` Atish Patra [this message]
2020-04-26 23:02   ` [PATCH RFC/RFT 2/3] RISC-V: Update image header Heinrich Schuchardt
2020-04-26 19:40 ` [PATCH RFC/RFT 3/3] RISC-V: Use common linux loader Atish Patra
2020-04-26 23:02   ` Heinrich Schuchardt
2020-04-27  6:15 ` [PATCH RFC/RFT 0/3] Add grub loader support for RISC-V Linux Ard Biesheuvel
2020-04-27 11:01   ` Daniel Kiper
2020-04-27 19:35     ` Heinrich Schuchardt
2020-04-27 19:39       ` Ard Biesheuvel
2020-04-27 20:47         ` Heinrich Schuchardt
2020-04-27 20:47           ` Ard Biesheuvel
2020-04-27 20:52             ` Ard Biesheuvel
2020-04-27 20:58               ` Heinrich Schuchardt
2020-04-27 21:15                 ` Heinrich Schuchardt
2020-04-27 22:10                   ` Ard Biesheuvel
2020-04-28 18:21                     ` Atish Patra
2020-04-29 11:22                       ` Leif Lindholm
2020-04-30  6:07                         ` Atish Patra
2020-04-27 20:54             ` Heinrich Schuchardt

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=20200426194007.382925-3-atish.patra@wdc.com \
    --to=atish.patra@wdc.com \
    --cc=agraf@csgraf.de \
    --cc=ardb@kernel.org \
    --cc=clin@suse.com \
    --cc=david.abdurachmanov@sifive.com \
    --cc=dkiper@net-space.pl \
    --cc=grub-devel@gnu.org \
    --cc=leif@nuviainc.com \
    --cc=xypron.glpk@gmx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.