Re: [PATCH 2/7] Make __pa() aware of XKPHYS/CKSEG0 address mix for 64 bit kernels

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 13 Oct 2006 14:39:01 +0200, Franck Bui-Huu <vagabon.xyz@xxxxxxxxx> wrote:
> +#if defined(CONFIG_64BITS) && !defined(CONFIG_BUILD_ELF64)
> +#define __page_offset(x)	((unsigned long)(x) < CKSEG0 ? PAGE_OFFSET : CKSEG0)

CONFIG_64BIT, not CONFIG_64BITS.  Sorry, my mistake.

Also since CKSEG0 is defined with _LLCONST_ macro, the final type of
__page_offset(), __pa(), __pa_sym() will be "unsigned long long", not
"unsigned long".  This raise a "comparison of distinct pointer types
lacks a cast" warning on this line.

	reserved_end = max(init_initrd(), PFN_UP(__pa_symbol(&_end)));

A qiuck and non-intrusive hack would be cast CKSEG0 with "unsigned
long" here, but it might be preferred to change _LLCONST_ definition
like this.  What do you think?


Subject: Use "long" for _ATYPE64_ and _LLCONST_ on 64-bit kernel.

Signed-off-by: Atsushi Nemoto <anemo@xxxxxxxxxxxxx>

diff --git a/include/asm-mips/addrspace.h b/include/asm-mips/addrspace.h
index 45c706e..5005555 100644
--- a/include/asm-mips/addrspace.h
+++ b/include/asm-mips/addrspace.h
@@ -23,9 +23,14 @@ #define _LLCONST_(x)	x
 #else
 #define _ATYPE_		__PTRDIFF_TYPE__
 #define _ATYPE32_	int
+#ifdef CONFIG_64BIT
+#define _ATYPE64_	long
+#define _LLCONST_(x)	x ## L
+#else
 #define _ATYPE64_	long long
 #define _LLCONST_(x)	x ## LL
 #endif
+#endif
 
 /*
  *  32-bit MIPS address spaces


---
Atsushi Nemoto


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux