On Thu, 10 Jul 2008, Michael Ellerman wrote:
> Well yes :) But I think that's because you're thinking of
> "end-users" and I'm thinking of "users" like myself - ie. _I_ use
> Kconfig and I do expect myself to be able to type a 64-bit address.
That doesn't really answer my question, why you need this.
> > > --- .config.orig 2008-07-08 09:30:00.000000000 +1000
> > > +++ .config 2008-07-08 09:30:43.000000000 +1000
> > > @@ -370,9 +370,8 @@
> > > CONFIG_HOTPLUG_PCI_RPA=m
> > > CONFIG_HOTPLUG_PCI_RPA_DLPAR=m
> > > # CONFIG_HAS_RAPIDIO is not set
> > > -CONFIG_PAGE_OFFSET=0xc000000000000000
> > > -CONFIG_KERNEL_START=0xc000000002000000
> > > -CONFIG_PHYSICAL_START=0x02000000
> > > +CONFIG_PAGE_OFFSET=0xc0000000
> > > +CONFIG_PHYSICAL_START=0x2000000
> >
> > Why is this worse? These are constants, you're not supposed to change them
> > anyway.
> > The remaining values are generated in page.h and should be the same as
> > before. If that isn't the case and this patch produces a nonworking
> > kernel, I'd like to hear about it.
>
> You're right the built kernel is fine. So it's not a bug,
Good, could someone please ack whether the powerpc changes are acceptable?
Index: linux-2.6/include/asm-powerpc/page.h
===================================================================
--- linux-2.6.orig/include/asm-powerpc/page.h
+++ linux-2.6/include/asm-powerpc/page.h
@@ -67,9 +67,15 @@
* If you want to test if something's a kernel address, use is_kernel_addr().
*/
-#define KERNELBASE ASM_CONST(CONFIG_KERNEL_START)
+#ifdef CONFIG_PPC64
+#define PAGE_OFFSET (ASM_CONST(CONFIG_PAGE_OFFSET) << 32)
+#define KERNELBASE (PAGE_OFFSET+ASM_CONST(CONFIG_PHYSICAL_START))
+#define LOAD_OFFSET PAGE_OFFSET
+#else
+#define KERNELBASE ASM_CONST(CONFIG_KERNEL_START)
#define PAGE_OFFSET ASM_CONST(CONFIG_PAGE_OFFSET)
-#define LOAD_OFFSET ASM_CONST((CONFIG_KERNEL_START-CONFIG_PHYSICAL_START))
+#define LOAD_OFFSET (ASM_CONST(CONFIG_KERNEL_START)-ASM_CONST(CONFIG_PHYSICAL_START))
+#endif
#if defined(CONFIG_RELOCATABLE) && defined(CONFIG_FLATMEM)
#ifndef __ASSEMBLY__
> but I think it is nicer to have the real values in the .config.
Why?
config PINT3_ASSIGN
hex "PINT3_ASSIGN"
depends on PINTx_REASSIGN
- default 0x02020303
+ default 0x2020303
config IRAM_SIZE
hex "Internal memory size (hex)"
depends on (CHIP_M32700 || CHIP_M32102 || CHIP_VDEC2 || CHIP_OPSP || CHIP_M32104) && DISCONTIGMEM
- default "00080000" if CHIP_M32700
- default "00010000" if CHIP_M32102 || CHIP_OPSP || CHIP_M32104
- default "00008000" if CHIP_VDEC2
+ default "0x80000" if CHIP_M32700
+ default "0x10000" if CHIP_M32102 || CHIP_OPSP || CHIP_M32104
+ default "0x8000" if CHIP_VDEC2
On Tue, 8 Jul 2008, Sam Ravnborg wrote:...
> We use Kconfig for a mixture of user editable values and fixed
> configuration values.
> And I agree that asking the user to input a 64 bit number is not usefull.
>
> But keeping support for 64 bit values is what I would consider
> expected functionality.
> > This would also ease on any portability issues
> > (kconfig is compiled with the host compiler not the target compiler).
>
> We use strtol() in a few places in symbol.c already where we do an
> implicit conversion to int. Why did this not cause us problems before?
>
> Is it because these code paths are only triggered when we deal with ranges?
> If so we could 'fix' strdup_type() to not use strto{,u}l() so it
> is 64 bit clean and we are back to old behaviour.
Ranges are the primary reason I made it consistent with this.
If we really wanted to support 64bit numbers, it would create only more
problems. First you have to make sure that on every build host (i.e also
non-Linux) strtoll() is available. Then how it should these numbers be
represented? On 32bit these may need a 'll' postfix, but the powerpc
example already shows, that there are different requirements, so they use
ASM_CONST for that. How should this postprecessing be integrated into
kconfig?