All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nikita Ermakov <arei@altlinux.org>
To: GRUB development mailing list <grub-devel@gnu.org>
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>,
	Atish Patra <Atish.Patra@wdc.com>,
	Daniel Kiper <dkiper@net-space.pl>,
	Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Leif Lindholm <leif.lindholm@linaro.org>,
	Nikita Ermakov <arei@altlinux.org>,
	Atish Patra <atish.patra@wdc.com>
Subject: [PATCH 6/8] RISC-V: Update image header
Date: Fri, 28 May 2021 16:04:55 +0300	[thread overview]
Message-ID: <20210528130457.13501-7-arei@altlinux.org> (raw)
In-Reply-To: <20210528130457.13501-1-arei@altlinux.org>

From: Atish Patra <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 512b777c8..de0dbdcd1 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 3630c30fb..7c28bc922 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.31.1



  parent reply	other threads:[~2021-05-28 13:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-28 13:04 [PATCH 0/8] Add LoadFile2 and riscv Linux loader Nikita Ermakov
2021-05-28 13:04 ` [PATCH 1/8] loader/linux: permit NULL argument for argv[] in grub_initrd_load() Nikita Ermakov
2021-05-28 19:17   ` Heinrich Schuchardt
2021-05-28 13:04 ` [PATCH 2/8] efi: add definition of LoadFile2 protocol Nikita Ermakov
2021-05-28 19:27   ` Heinrich Schuchardt
2021-05-28 13:04 ` [PATCH 3/8] efi: implemented LoadFile2 initrd loading protocol for Linux Nikita Ermakov
2021-05-28 19:49   ` Heinrich Schuchardt
2021-05-28 13:04 ` [PATCH 4/8] linux: ignore FDT unless we need to modify it Nikita Ermakov
2021-05-28 13:04 ` [PATCH 5/8] loader: Move arm64 linux loader to common code Nikita Ermakov
2021-05-28 13:04 ` Nikita Ermakov [this message]
2021-05-28 13:04 ` [PATCH 7/8] RISC-V: Use common linux loader Nikita Ermakov
2021-05-28 13:04 ` [PATCH 8/8] linux: Make load_file2_guid and device_path_guid static Nikita Ermakov
2021-05-28 19: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=20210528130457.13501-7-arei@altlinux.org \
    --to=arei@altlinux.org \
    --cc=Atish.Patra@wdc.com \
    --cc=ard.biesheuvel@arm.com \
    --cc=dkiper@net-space.pl \
    --cc=grub-devel@gnu.org \
    --cc=leif.lindholm@linaro.org \
    --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.