Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit baa69b12 authored by Jesper Nilsson's avatar Jesper Nilsson
Browse files

CRIS v32: Fix startup oops and replace hardcoded pagesize in vmlinux.lds.S

- Move alignment of init data to page size outside define CONFIG_BLK_DEV_INITRD
  This avoids oops due to memory on the same page as init data being freed.
- Change hardcoded page size to use macro from asm/page.h
- Add reserved memory via CONFIG_ETRAX_VMEM_SIZE.
- Use available defines for TEXT_TEXT and INITCALLS.
- Cleanup whitespace.
parent 52d82ef1
Loading
Loading
Loading
Loading
+37 −37
Original line number Diff line number Diff line
@@ -9,6 +9,13 @@
 */

#include <asm-generic/vmlinux.lds.h>
#include <asm/page.h>

#ifdef CONFIG_ETRAX_VMEM_SIZE
#define __CONFIG_ETRAX_VMEM_SIZE CONFIG_ETRAX_VMEM_SIZE
#else
#define __CONFIG_ETRAX_VMEM_SIZE 0
#endif

jiffies = jiffies_64;
SECTIONS
@@ -17,18 +24,19 @@ SECTIONS
	dram_start = .;
	ebp_start = .;

	/* The boot section is only necessary until the VCS top level testbench */
	/* includes both flash and DRAM. */
	/* The boot section is only necessary until the VCS top */
	/* level testbench includes both flash and DRAM. */
	.boot : { *(.boot) }

	. = DRAM_VIRTUAL_BASE + 0x4000;		/* See head.S and pages reserved at the start. */
	/* See head.S and pages reserved at the start. */
	. = DRAM_VIRTUAL_BASE + 0x4000;

	_text = .;		/* Text and read-only data. */
	text_start = .;		/* Lots of aliases. */
	_stext = .;
	__stext = .;
	.text : {
		*(.text)
		TEXT_TEXT
		SCHED_TEXT
		LOCK_TEXT
		*(.fixup)
@@ -54,10 +62,10 @@ SECTIONS
	__edata = . ;		/* End of data section. */
	_edata = . ;

	. = ALIGN(8192);	/* init_task and stack, must be aligned. */
	. = ALIGN(PAGE_SIZE);	/* init_task and stack, must be aligned. */
	.data.init_task : { *(.data.init_task) }

  	. = ALIGN(8192);	/* Init code and data. */
	. = ALIGN(PAGE_SIZE);	/* Init code and data. */
	__init_begin = .;
	.init.text : {
		   _sinittext = .;
@@ -74,13 +82,7 @@ SECTIONS
	__stop___param = .;
	.initcall.init : {
		__initcall_start = .;
		*(.initcall1.init);
		*(.initcall2.init);
		*(.initcall3.init);
		*(.initcall4.init);
		*(.initcall5.init);
		*(.initcall6.init);
		*(.initcall7.init);
		INITCALLS
		__initcall_end = .;
	}

@@ -91,24 +93,22 @@ SECTIONS
	}
	SECURITY_INIT

	PERCPU(8192)
	__vmlinux_end = .;	/* Last address of the physical file. */
	PERCPU(PAGE_SIZE)

#ifdef CONFIG_BLK_DEV_INITRD
	.init.ramfs : {
		__initramfs_start = .;
		*(.init.ramfs)
		__initramfs_end = .;
	}

	/*
	 * We fill to the next page, so we can discard all init
	 * pages without needing to consider what payload might be
	 * appended to the kernel image.
	 */
		FILL (0);
		. = ALIGN (8192);
	}
#endif
	. = ALIGN (PAGE_SIZE);

	__vmlinux_end = .;	/* Last address of the physical file. */
	__init_end = .;

	__data_end = . ;	/* Move to _edata? */
@@ -129,5 +129,5 @@ SECTIONS
		*(.exitcall.exit)
        }

	dram_end = dram_start + CONFIG_ETRAX_DRAM_SIZE*1024*1024;
	dram_end = dram_start + (CONFIG_ETRAX_DRAM_SIZE - __CONFIG_ETRAX_VMEM_SIZE)*1024*1024;
}