Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 273355
b: refs/heads/master
c: e66ac3f
h: refs/heads/master
i:
  273353: 65a2976
  273351: 694a807
v: v3
  • Loading branch information
Simon Horman authored and Paul Mundt committed Oct 28, 2011
1 parent e483c1d commit 1e673fb
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d11584a0449f881181dc94dd697d3f3896c15c73
refs/heads/master: e66ac3f26aef131f5ca60350d25fba95f43acd0d
13 changes: 12 additions & 1 deletion trunk/arch/sh/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ config CRASH_DUMP
a specially reserved region and then later executed after
a crash by kdump/kexec. The crash dump kernel must be compiled
to a memory address not used by the main kernel using
MEMORY_START.
PHYSICAL_START.

For more details see Documentation/kdump/kdump.txt

Expand All @@ -656,6 +656,17 @@ config KEXEC_JUMP
Jump between original kernel and kexeced kernel and invoke
code via KEXEC

config PHYSICAL_START
hex "Physical address where the kernel is loaded" if (EXPERT || CRASH_DUMP)
default MEMORY_START
---help---
This gives the physical address where the kernel is loaded
and is ordinarily the same as MEMORY_START.

Different values are primarily used in the case of kexec on panic
where the fail safe kernel needs to run at a different address
than the panic-ed kernel.

config SECCOMP
bool "Enable seccomp to safely compute untrusted bytecode"
depends on PROC_FS
Expand Down
6 changes: 4 additions & 2 deletions trunk/arch/sh/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ CONFIG_MEMORY_START ?= 0x0c000000
CONFIG_BOOT_LINK_OFFSET ?= 0x00800000
CONFIG_ZERO_PAGE_OFFSET ?= 0x00001000
CONFIG_ENTRY_OFFSET ?= 0x00001000
CONFIG_PHYSICAL_START ?= $(CONFIG_MEMORY_START)

suffix-y := bin
suffix-$(CONFIG_KERNEL_GZIP) := gz
Expand Down Expand Up @@ -48,7 +49,7 @@ $(obj)/romimage/vmlinux: $(obj)/zImage FORCE
$(Q)$(MAKE) $(build)=$(obj)/romimage $@

KERNEL_MEMORY := $(shell /bin/bash -c 'printf "0x%08x" \
$$[$(CONFIG_MEMORY_START) & 0x1fffffff]')
$$[$(CONFIG_PHYSICAL_START) & 0x1fffffff]')

KERNEL_LOAD := $(shell /bin/bash -c 'printf "0x%08x" \
$$[$(CONFIG_PAGE_OFFSET) + \
Expand Down Expand Up @@ -114,4 +115,5 @@ $(obj)/uImage: $(obj)/uImage.$(suffix-y)
@echo ' Image $@ is ready'

export CONFIG_PAGE_OFFSET CONFIG_MEMORY_START CONFIG_BOOT_LINK_OFFSET \
CONFIG_ZERO_PAGE_OFFSET CONFIG_ENTRY_OFFSET KERNEL_MEMORY suffix-y
CONFIG_PHYSICAL_START CONFIG_ZERO_PAGE_OFFSET CONFIG_ENTRY_OFFSET \
KERNEL_MEMORY suffix-y
10 changes: 10 additions & 0 deletions trunk/arch/sh/include/asm/page.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,16 @@ typedef struct page *pgtable_t;
#define __MEMORY_START CONFIG_MEMORY_START
#define __MEMORY_SIZE CONFIG_MEMORY_SIZE

/*
* PHYSICAL_OFFSET is the offset in physical memory where the base
* of the kernel is loaded.
*/
#ifdef CONFIG_PHYSICAL_START
#define PHYSICAL_OFFSET (CONFIG_PHYSICAL_START - __MEMORY_START)
#else
#define PHYSICAL_OFFSET 0
#endif

/*
* PAGE_OFFSET is the virtual address of the start of kernel address
* space.
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/sh/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ OUTPUT_ARCH(sh)
ENTRY(_start)
SECTIONS
{
. = PAGE_OFFSET + MEMORY_OFFSET + CONFIG_ZERO_PAGE_OFFSET;
. = PAGE_OFFSET + MEMORY_OFFSET + PHYSICAL_OFFSET + CONFIG_ZERO_PAGE_OFFSET;

_text = .; /* Text and read-only data */

Expand Down
8 changes: 4 additions & 4 deletions trunk/arch/sh/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,8 @@ static void __init do_init_bootmem(void)
static void __init early_reserve_mem(void)
{
unsigned long start_pfn;
u32 zero_base = (u32)__MEMORY_START + (u32)PHYSICAL_OFFSET;
u32 start = zero_base + (u32)CONFIG_ZERO_PAGE_OFFSET;

/*
* Partially used pages are not usable - thus
Expand All @@ -300,15 +302,13 @@ static void __init early_reserve_mem(void)
* this catches the (definitely buggy) case of us accidentally
* initializing the bootmem allocator with an invalid RAM area.
*/
memblock_reserve(__MEMORY_START + CONFIG_ZERO_PAGE_OFFSET,
(PFN_PHYS(start_pfn) + PAGE_SIZE - 1) -
(__MEMORY_START + CONFIG_ZERO_PAGE_OFFSET));
memblock_reserve(start, (PFN_PHYS(start_pfn) + PAGE_SIZE - 1) - start);

/*
* Reserve physical pages below CONFIG_ZERO_PAGE_OFFSET.
*/
if (CONFIG_ZERO_PAGE_OFFSET != 0)
memblock_reserve(__MEMORY_START, CONFIG_ZERO_PAGE_OFFSET);
memblock_reserve(zero_base, CONFIG_ZERO_PAGE_OFFSET);

/*
* Handle additional early reservations
Expand Down

0 comments on commit 1e673fb

Please sign in to comment.