linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] IP27: Fix spaces.h to prevent a build error
@ 2017-01-29  4:32 Joshua Kinard
  2017-02-13 22:39 ` James Hogan
  0 siblings, 1 reply; 2+ messages in thread
From: Joshua Kinard @ 2017-01-29  4:32 UTC (permalink / raw)
  To: Ralf Baechle, Maciej W. Rozycki; +Cc: Linux/MIPS

From: Joshua Kinard <kumba@gentoo.org>

Fix IP27's spaces.h file to avoid the below build error:

    CC      arch/mips/vdso/gettimeofday-o32.o
  In file included from ./arch/mips/include/asm/mach-ip27/spaces.h:29:0,
                   from ./arch/mips/include/asm/page.h:12,
                   from arch/mips/vdso/vdso.h:26,
                   from arch/mips/vdso/gettimeofday.c:11:
  ./arch/mips/include/asm/mach-generic/spaces.h:28:0: error: "CAC_BASE" redefined [-Werror]
   #define CAC_BASE  _AC(0x80000000, UL)
  
  In file included from ./arch/mips/include/asm/page.h:12:0,
                   from arch/mips/vdso/vdso.h:26,
                   from arch/mips/vdso/gettimeofday.c:11:
  ./arch/mips/include/asm/mach-ip27/spaces.h:22:0: note: this is the location of the previous definition
   #define CAC_BASE  0xa800000000000000
  
  cc1: all warnings being treated as errors
  make[2]: *** [arch/mips/vdso/Makefile:117: arch/mips/vdso/gettimeofday-o32.o] Error 1
  make[1]: *** [scripts/Makefile.build:551: arch/mips/vdso] Error 2
  make[1]: *** Waiting for unfinished jobs....

Fixes include using the _AC() constant to protect addresses if used in
assembly and wrapping the addresses with a CONFIG_64BIT ifdef.

Signed-off-by: Joshua Kinard <kumba@gentoo.org>
---
 arch/mips/include/asm/mach-ip27/spaces.h |   15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

linux-mips-4.10-ip27-fix-spaces_h.patch
diff --git a/arch/mips/include/asm/mach-ip27/spaces.h b/arch/mips/include/asm/mach-ip27/spaces.h
index 4775a1136a5b..27d32da8442c 100644
--- a/arch/mips/include/asm/mach-ip27/spaces.h
+++ b/arch/mips/include/asm/mach-ip27/spaces.h
@@ -10,21 +10,24 @@
 #ifndef _ASM_MACH_IP27_SPACES_H
 #define _ASM_MACH_IP27_SPACES_H
 
+#include <linux/const.h>
+
 /*
  * IP27 uses the R10000's uncached attribute feature.  Attribute 3 selects
  * uncached memory addressing.
  */
-
-#define HSPEC_BASE		0x9000000000000000
-#define IO_BASE			0x9200000000000000
-#define MSPEC_BASE		0x9400000000000000
-#define UNCAC_BASE		0x9600000000000000
-#define CAC_BASE		0xa800000000000000
+#ifdef CONFIG_64BIT
+#define HSPEC_BASE		_AC(0x9000000000000000, UL)
+#define IO_BASE			_AC(0x9200000000000000, UL)
+#define MSPEC_BASE		_AC(0x9400000000000000, UL)
+#define UNCAC_BASE		_AC(0x9600000000000000, UL)
+#define CAC_BASE		_AC(0xa800000000000000, UL)
 
 #define TO_MSPEC(x)		(MSPEC_BASE | ((x) & TO_PHYS_MASK))
 #define TO_HSPEC(x)		(HSPEC_BASE | ((x) & TO_PHYS_MASK))
 
 #define HIGHMEM_START		(~0UL)
+#endif /* CONFIG_64BIT */
 
 #include <asm/mach-generic/spaces.h>
 

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

* Re: [PATCH] IP27: Fix spaces.h to prevent a build error
  2017-01-29  4:32 [PATCH] IP27: Fix spaces.h to prevent a build error Joshua Kinard
@ 2017-02-13 22:39 ` James Hogan
  0 siblings, 0 replies; 2+ messages in thread
From: James Hogan @ 2017-02-13 22:39 UTC (permalink / raw)
  To: Joshua Kinard; +Cc: Ralf Baechle, Maciej W. Rozycki, Linux/MIPS

[-- Attachment #1: Type: text/plain, Size: 3045 bytes --]

Hi Joshua,

On Sat, Jan 28, 2017 at 11:32:10PM -0500, Joshua Kinard wrote:
> From: Joshua Kinard <kumba@gentoo.org>
> 
> Fix IP27's spaces.h file to avoid the below build error:
> 
>     CC      arch/mips/vdso/gettimeofday-o32.o
>   In file included from ./arch/mips/include/asm/mach-ip27/spaces.h:29:0,
>                    from ./arch/mips/include/asm/page.h:12,
>                    from arch/mips/vdso/vdso.h:26,
>                    from arch/mips/vdso/gettimeofday.c:11:
>   ./arch/mips/include/asm/mach-generic/spaces.h:28:0: error: "CAC_BASE" redefined [-Werror]
>    #define CAC_BASE  _AC(0x80000000, UL)
>   
>   In file included from ./arch/mips/include/asm/page.h:12:0,
>                    from arch/mips/vdso/vdso.h:26,
>                    from arch/mips/vdso/gettimeofday.c:11:
>   ./arch/mips/include/asm/mach-ip27/spaces.h:22:0: note: this is the location of the previous definition
>    #define CAC_BASE  0xa800000000000000
>   
>   cc1: all warnings being treated as errors
>   make[2]: *** [arch/mips/vdso/Makefile:117: arch/mips/vdso/gettimeofday-o32.o] Error 1
>   make[1]: *** [scripts/Makefile.build:551: arch/mips/vdso] Error 2
>   make[1]: *** Waiting for unfinished jobs....
> 
> Fixes include using the _AC() constant to protect addresses if used in
> assembly and wrapping the addresses with a CONFIG_64BIT ifdef.
> 
> Signed-off-by: Joshua Kinard <kumba@gentoo.org>

FYI, this similar patch is already applied:

https://patchwork.linux-mips.org/patch/15039/

If you need _AC around them for assembly use, please submit a new patch.

Thanks
James

> ---
>  arch/mips/include/asm/mach-ip27/spaces.h |   15 +++++++++------
>  1 file changed, 9 insertions(+), 6 deletions(-)
> 
> linux-mips-4.10-ip27-fix-spaces_h.patch
> diff --git a/arch/mips/include/asm/mach-ip27/spaces.h b/arch/mips/include/asm/mach-ip27/spaces.h
> index 4775a1136a5b..27d32da8442c 100644
> --- a/arch/mips/include/asm/mach-ip27/spaces.h
> +++ b/arch/mips/include/asm/mach-ip27/spaces.h
> @@ -10,21 +10,24 @@
>  #ifndef _ASM_MACH_IP27_SPACES_H
>  #define _ASM_MACH_IP27_SPACES_H
>  
> +#include <linux/const.h>
> +
>  /*
>   * IP27 uses the R10000's uncached attribute feature.  Attribute 3 selects
>   * uncached memory addressing.
>   */
> -
> -#define HSPEC_BASE		0x9000000000000000
> -#define IO_BASE			0x9200000000000000
> -#define MSPEC_BASE		0x9400000000000000
> -#define UNCAC_BASE		0x9600000000000000
> -#define CAC_BASE		0xa800000000000000
> +#ifdef CONFIG_64BIT
> +#define HSPEC_BASE		_AC(0x9000000000000000, UL)
> +#define IO_BASE			_AC(0x9200000000000000, UL)
> +#define MSPEC_BASE		_AC(0x9400000000000000, UL)
> +#define UNCAC_BASE		_AC(0x9600000000000000, UL)
> +#define CAC_BASE		_AC(0xa800000000000000, UL)
>  
>  #define TO_MSPEC(x)		(MSPEC_BASE | ((x) & TO_PHYS_MASK))
>  #define TO_HSPEC(x)		(HSPEC_BASE | ((x) & TO_PHYS_MASK))
>  
>  #define HIGHMEM_START		(~0UL)
> +#endif /* CONFIG_64BIT */
>  
>  #include <asm/mach-generic/spaces.h>
>  
> 

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

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

end of thread, other threads:[~2017-02-13 22:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-29  4:32 [PATCH] IP27: Fix spaces.h to prevent a build error Joshua Kinard
2017-02-13 22:39 ` James Hogan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).