* [PATCH] MIPS: Add dummy definitions of HPAGE_SHIFT et al.
@ 2011-11-22 19:42 David Daney
2011-11-24 12:17 ` Hillf Danton
2012-01-11 14:34 ` Ralf Baechle
0 siblings, 2 replies; 3+ messages in thread
From: David Daney @ 2011-11-22 19:42 UTC (permalink / raw)
To: linux-mips, ralf; +Cc: David Daney, Hillf Danton
From: David Daney <david.daney@cavium.com>
In the case of !CONFIG_HUGETLB_PAGE we need dummy definitions of
HPAGE_SHIFT, HPAGE_SIZE and HPAGE_MASK to be able to compile tlb-r4k.c
Add these with a BUILD_BUG() to properly flag situations where they
are improperly used.
Also conditionally define BUILD_BUG(), as the definition for this may
not have been merged by the time this patch is merged. Once a
BUILD_BUG() is defined in kernel.h, we can remove this one.
Cc: Hillf Danton <dhillf@gmail.com>
Signed-off-by: David Daney <david.daney@cavium.com>
---
arch/mips/include/asm/page.h | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h
index e59cd1a..d417909 100644
--- a/arch/mips/include/asm/page.h
+++ b/arch/mips/include/asm/page.h
@@ -38,6 +38,14 @@
#define HPAGE_SIZE (_AC(1,UL) << HPAGE_SHIFT)
#define HPAGE_MASK (~(HPAGE_SIZE - 1))
#define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT)
+#else /* !CONFIG_HUGETLB_PAGE */
+# ifndef BUILD_BUG
+# define BUILD_BUG() do { extern void __build_bug(void); __build_bug(); } while (0)
+# endif
+#define HPAGE_SHIFT ({BUILD_BUG(); 0; })
+#define HPAGE_SIZE ({BUILD_BUG(); 0; })
+#define HPAGE_MASK ({BUILD_BUG(); 0; })
+#define HUGETLB_PAGE_ORDER ({BUILD_BUG(); 0; })
#endif /* CONFIG_HUGETLB_PAGE */
#ifndef __ASSEMBLY__
--
1.7.2.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] MIPS: Add dummy definitions of HPAGE_SHIFT et al.
2011-11-22 19:42 [PATCH] MIPS: Add dummy definitions of HPAGE_SHIFT et al David Daney
@ 2011-11-24 12:17 ` Hillf Danton
2012-01-11 14:34 ` Ralf Baechle
1 sibling, 0 replies; 3+ messages in thread
From: Hillf Danton @ 2011-11-24 12:17 UTC (permalink / raw)
To: David Daney; +Cc: linux-mips, ralf, David Daney
On Wed, Nov 23, 2011 at 3:42 AM, David Daney <ddaney.cavm@gmail.com> wrote:
> From: David Daney <david.daney@cavium.com>
>
> In the case of !CONFIG_HUGETLB_PAGE we need dummy definitions of
> HPAGE_SHIFT, HPAGE_SIZE and HPAGE_MASK to be able to compile tlb-r4k.c
>
> Add these with a BUILD_BUG() to properly flag situations where they
> are improperly used.
>
> Also conditionally define BUILD_BUG(), as the definition for this may
> not have been merged by the time this patch is merged. Once a
> BUILD_BUG() is defined in kernel.h, we can remove this one.
>
> Cc: Hillf Danton <dhillf@gmail.com>
> Signed-off-by: David Daney <david.daney@cavium.com>
> ---
Acked-by: Hillf Danton <dhillf@gmail.com>
> arch/mips/include/asm/page.h | 8 ++++++++
> 1 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h
> index e59cd1a..d417909 100644
> --- a/arch/mips/include/asm/page.h
> +++ b/arch/mips/include/asm/page.h
> @@ -38,6 +38,14 @@
> #define HPAGE_SIZE (_AC(1,UL) << HPAGE_SHIFT)
> #define HPAGE_MASK (~(HPAGE_SIZE - 1))
> #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT)
> +#else /* !CONFIG_HUGETLB_PAGE */
> +# ifndef BUILD_BUG
> +# define BUILD_BUG() do { extern void __build_bug(void); __build_bug(); } while (0)
> +# endif
> +#define HPAGE_SHIFT ({BUILD_BUG(); 0; })
> +#define HPAGE_SIZE ({BUILD_BUG(); 0; })
> +#define HPAGE_MASK ({BUILD_BUG(); 0; })
> +#define HUGETLB_PAGE_ORDER ({BUILD_BUG(); 0; })
> #endif /* CONFIG_HUGETLB_PAGE */
>
> #ifndef __ASSEMBLY__
> --
> 1.7.2.3
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] MIPS: Add dummy definitions of HPAGE_SHIFT et al.
2011-11-22 19:42 [PATCH] MIPS: Add dummy definitions of HPAGE_SHIFT et al David Daney
2011-11-24 12:17 ` Hillf Danton
@ 2012-01-11 14:34 ` Ralf Baechle
1 sibling, 0 replies; 3+ messages in thread
From: Ralf Baechle @ 2012-01-11 14:34 UTC (permalink / raw)
To: David Daney; +Cc: linux-mips, David Daney, Hillf Danton
I've folded this fix into the original patch.
Thanks,
Ralf
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-01-11 14:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-22 19:42 [PATCH] MIPS: Add dummy definitions of HPAGE_SHIFT et al David Daney
2011-11-24 12:17 ` Hillf Danton
2012-01-11 14:34 ` Ralf Baechle
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.