Skip to content

Commit c772568

Browse files
author
Russell King
committed
ARM: add additional table to compressed kernel
Add an additional extendable table to the compressed kernel so that we can provide further information to boot loaders regarding the properties of the image contained within. This is necessary for correct behaviour of kexec. Tested-by: Tony Lindgren <[email protected]> Tested-by: Keerthy <[email protected]> Signed-off-by: Russell King <[email protected]>
1 parent 429f7a0 commit c772568

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

arch/arm/boot/compressed/head.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ start:
143143
.word _magic_start @ absolute load/run zImage address
144144
.word _magic_end @ zImage end address
145145
.word 0x04030201 @ endianness flag
146+
.word 0x45454545 @ another magic number to indicate
147+
.word _magic_table @ additional data table
146148

147149
__EFI_HEADER
148150
1:

arch/arm/boot/compressed/vmlinux.lds.S

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,22 @@ SECTIONS
4444
*(.glue_7t)
4545
*(.glue_7)
4646
}
47+
.table : ALIGN(4) {
48+
_table_start = .;
49+
LONG(ZIMAGE_MAGIC(2))
50+
LONG(ZIMAGE_MAGIC(0x5a534c4b))
51+
LONG(ZIMAGE_MAGIC(__piggy_size_addr - _start))
52+
LONG(ZIMAGE_MAGIC(_kernel_bss_size))
53+
LONG(0)
54+
_table_end = .;
55+
}
4756
.rodata : {
4857
*(.rodata)
4958
*(.rodata.*)
5059
}
5160
.piggydata : {
5261
*(.piggydata)
62+
__piggy_size_addr = . - 4;
5363
}
5464

5565
. = ALIGN(4);
@@ -88,6 +98,7 @@ SECTIONS
8898
_magic_sig = ZIMAGE_MAGIC(0x016f2818);
8999
_magic_start = ZIMAGE_MAGIC(_start);
90100
_magic_end = ZIMAGE_MAGIC(_edata);
101+
_magic_table = ZIMAGE_MAGIC(_table_start - _start);
91102

92103
. = BSS_START;
93104
__bss_start = .;

0 commit comments

Comments
 (0)