Re: [PATCH 11/27] asm-generic: add generic page.h

From: Geert Uytterhoeven
Date: Mon May 04 2009 - 03:11:47 EST


On Wed, Apr 29, 2009 at 16:55, Arnd Bergmann <arnd@xxxxxxxx> wrote:
> Architectures that have no mmu should not have to
> describe their page tables. This adds a new page.h
> file based on the existing nommu architectures
> that adds a lot of dummy definitions to let you
> correctly compile a nommu kernel.
>
> Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
> ---
> Âinclude/asm-generic/page.h | Â 99 ++++++++++++++++++++++++++++++++++++++++++++
> Â1 files changed, 99 insertions(+), 0 deletions(-)
> Âcreate mode 100644 include/asm-generic/page.h
>
> diff --git a/include/asm-generic/page.h b/include/asm-generic/page.h
> new file mode 100644
> index 0000000..75fec18
> --- /dev/null
> +++ b/include/asm-generic/page.h
> @@ -0,0 +1,99 @@
> +#ifndef __ASM_GENERIC_PAGE_H
> +#define __ASM_GENERIC_PAGE_H
> +/*
> + * Generic page.h implementation, for NOMMU architectures.
> + * This provides the dummy definitions for the memory management.
> + */
> +
> +#ifdef CONFIG_MMU
> +#error need to prove a real asm/page.h
> +#endif
> +
> +
> +/* PAGE_SHIFT determines the page size */
> +
> +#define PAGE_SHIFT Â Â 12
> +#ifdef __ASSEMBLY__
> +#define PAGE_SIZE Â Â Â(1 << PAGE_SHIFT)
> +#else
> +#define PAGE_SIZE Â Â Â(1UL << PAGE_SHIFT)
> +#endif

#include <linux/const.h> and use (_AC(1, UL) << PAGE_SHIFT)

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/