public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] FRV: Permit the memory to be located elsewhere in NOMMU mode
@ 2007-10-29 15:20 David Howells
  2007-10-29 16:28 ` Linus Torvalds
  0 siblings, 1 reply; 3+ messages in thread
From: David Howells @ 2007-10-29 15:20 UTC (permalink / raw)
  To: torvalds, akpm, rpjday; +Cc: linux-kernel, dhowells

From: David Howells <dhowells@redhat.com>

Permit the memory to be located somewhere other than address 0xC0000000 in
NOMMU mode.  The configuration options are already present, it just requires
wiring up in the linker script.

Note that only a limited set of locations of runtime addresses are available
because of the way the CPU protection registers work.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 arch/frv/kernel/vmlinux.lds.S |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/arch/frv/kernel/vmlinux.lds.S b/arch/frv/kernel/vmlinux.lds.S
index 3b71e0c..7dd9996 100644
--- a/arch/frv/kernel/vmlinux.lds.S
+++ b/arch/frv/kernel/vmlinux.lds.S
@@ -13,7 +13,21 @@ ENTRY(_start)
 
 jiffies = jiffies_64 + 4;
 
-__page_offset = 0xc0000000;		/* start of area covered by struct pages */
+/* start of area covered by struct pages */
+#if defined(CONFIG_UCPAGE_OFFSET_20000000)
+__page_offset = 0x20000000;
+#elif defined(CONFIG_UCPAGE_OFFSET_40000000)
+__page_offset = 0x40000000;
+#elif defined(CONFIG_UCPAGE_OFFSET_60000000)
+__page_offset = 0x60000000;
+#elif defined(CONFIG_UCPAGE_OFFSET_80000000)
+__page_offset = 0x80000000;
+#elif defined(CONFIG_UCPAGE_OFFSET_A0000000)
+__page_offset = 0xa0000000;
+#else
+__page_offset = 0xc0000000;
+#endif
+
 __kernel_image_start = __page_offset;	/* address at which kernel image resides */
 
 SECTIONS


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] FRV: Permit the memory to be located elsewhere in NOMMU mode
  2007-10-29 15:20 [PATCH] FRV: Permit the memory to be located elsewhere in NOMMU mode David Howells
@ 2007-10-29 16:28 ` Linus Torvalds
  2007-10-29 16:38   ` David Howells
  0 siblings, 1 reply; 3+ messages in thread
From: Linus Torvalds @ 2007-10-29 16:28 UTC (permalink / raw)
  To: David Howells; +Cc: akpm, rpjday, linux-kernel



On Mon, 29 Oct 2007, David Howells wrote:
>  
> -__page_offset = 0xc0000000;		/* start of area covered by struct pages */
> +/* start of area covered by struct pages */
> +#if defined(CONFIG_UCPAGE_OFFSET_20000000)
> +__page_offset = 0x20000000;
> +#elif defined(CONFIG_UCPAGE_OFFSET_40000000)
> +__page_offset = 0x40000000;
...

Please don't do these kinds of things in the source code.

Do them in the Kconfig language where it belongs, and where it makes much 
more sense.

See, for example, arch/x86/Kconfig.i386:

	config PAGE_OFFSET
	        hex
	        default 0xB0000000 if VMSPLIT_3G_OPT
	        default 0x80000000 if VMSPLIT_2G
	        default 0x78000000 if VMSPLIT_2G_OPT
	        default 0x40000000 if VMSPLIT_1G
	        default 0xC0000000

Notice? Even the syntax is much cleaner!

		Linus

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] FRV: Permit the memory to be located elsewhere in NOMMU mode
  2007-10-29 16:28 ` Linus Torvalds
@ 2007-10-29 16:38   ` David Howells
  0 siblings, 0 replies; 3+ messages in thread
From: David Howells @ 2007-10-29 16:38 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: dhowells, akpm, rpjday, linux-kernel

Linus Torvalds <torvalds@linux-foundation.org> wrote:

> Do them in the Kconfig language where it belongs, and where it makes much 
> more sense.

That's what I wanted to do, I just didn't realise I could do it.

David

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-10-29 16:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-29 15:20 [PATCH] FRV: Permit the memory to be located elsewhere in NOMMU mode David Howells
2007-10-29 16:28 ` Linus Torvalds
2007-10-29 16:38   ` David Howells

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox