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 Original line Diff line number Diff line
@@ -9,6 +9,13 @@
 */
 */


#include <asm-generic/vmlinux.lds.h>
#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;
jiffies = jiffies_64;
SECTIONS
SECTIONS
@@ -17,18 +24,19 @@ SECTIONS
	dram_start = .;
	dram_start = .;
	ebp_start = .;
	ebp_start = .;


	/* The boot section is only necessary until the VCS top level testbench */
	/* The boot section is only necessary until the VCS top */
	/* includes both flash and DRAM. */
	/* level testbench includes both flash and DRAM. */
	.boot : { *(.boot) }
	.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 = .;		/* Text and read-only data. */
	text_start = .;		/* Lots of aliases. */
	text_start = .;		/* Lots of aliases. */
	_stext = .;
	_stext = .;
	__stext = .;
	__stext = .;
	.text : {
	.text : {
		*(.text)
		TEXT_TEXT
		SCHED_TEXT
		SCHED_TEXT
		LOCK_TEXT
		LOCK_TEXT
		*(.fixup)
		*(.fixup)
@@ -54,10 +62,10 @@ SECTIONS
	__edata = . ;		/* End of data section. */
	__edata = . ;		/* End of data section. */
	_edata = . ;
	_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) }
	.data.init_task : { *(.data.init_task) }


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


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


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


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

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


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


	__data_end = . ;	/* Move to _edata? */
	__data_end = . ;	/* Move to _edata? */
@@ -129,5 +129,5 @@ SECTIONS
		*(.exitcall.exit)
		*(.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;
}
}