2005-04-17 00:20:36 +02:00
|
|
|
/*
|
2008-08-02 11:55:55 +02:00
|
|
|
* arch/arm/include/asm/page.h
|
2005-04-17 00:20:36 +02:00
|
|
|
*
|
|
|
|
* Copyright (C) 1995-2003 Russell King
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*/
|
|
|
|
#ifndef _ASMARM_PAGE_H
|
|
|
|
#define _ASMARM_PAGE_H
|
|
|
|
|
|
|
|
/* PAGE_SHIFT determines the page size */
|
|
|
|
#define PAGE_SHIFT 12
|
2009-06-25 00:38:56 +02:00
|
|
|
#define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT)
|
2005-04-17 00:20:36 +02:00
|
|
|
#define PAGE_MASK (~(PAGE_SIZE-1))
|
|
|
|
|
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
|
2006-06-20 21:46:52 +02:00
|
|
|
#ifndef CONFIG_MMU
|
|
|
|
|
|
|
|
#include "page-nommu.h"
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
2005-04-17 00:20:36 +02:00
|
|
|
#include <asm/glue.h>
|
|
|
|
|
|
|
|
/*
|
|
|
|
* User Space Model
|
|
|
|
* ================
|
|
|
|
*
|
|
|
|
* This section selects the correct set of functions for dealing with
|
|
|
|
* page-based copying and clearing for user space for the particular
|
|
|
|
* processor(s) we're building for.
|
|
|
|
*
|
|
|
|
* We have the following to choose from:
|
|
|
|
* v3 - ARMv3
|
|
|
|
* v4wt - ARMv4 with writethrough cache, without minicache
|
|
|
|
* v4wb - ARMv4 with writeback cache, without minicache
|
|
|
|
* v4_mc - ARMv4 with minicache
|
|
|
|
* xscale - Xscale
|
2006-03-28 22:00:40 +02:00
|
|
|
* xsc3 - XScalev3
|
2005-04-17 00:20:36 +02:00
|
|
|
*/
|
|
|
|
#undef _USER
|
|
|
|
#undef MULTI_USER
|
|
|
|
|
|
|
|
#ifdef CONFIG_CPU_COPY_V3
|
|
|
|
# ifdef _USER
|
|
|
|
# define MULTI_USER 1
|
|
|
|
# else
|
|
|
|
# define _USER v3
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef CONFIG_CPU_COPY_V4WT
|
|
|
|
# ifdef _USER
|
|
|
|
# define MULTI_USER 1
|
|
|
|
# else
|
|
|
|
# define _USER v4wt
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef CONFIG_CPU_COPY_V4WB
|
|
|
|
# ifdef _USER
|
|
|
|
# define MULTI_USER 1
|
|
|
|
# else
|
|
|
|
# define _USER v4wb
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
2008-04-24 07:31:45 +02:00
|
|
|
#ifdef CONFIG_CPU_COPY_FEROCEON
|
|
|
|
# ifdef _USER
|
|
|
|
# define MULTI_USER 1
|
|
|
|
# else
|
|
|
|
# define _USER feroceon
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
2009-03-25 12:10:01 +01:00
|
|
|
#ifdef CONFIG_CPU_COPY_FA
|
|
|
|
# ifdef _USER
|
|
|
|
# define MULTI_USER 1
|
|
|
|
# else
|
|
|
|
# define _USER fa
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
2005-04-17 00:20:36 +02:00
|
|
|
#ifdef CONFIG_CPU_SA1100
|
|
|
|
# ifdef _USER
|
|
|
|
# define MULTI_USER 1
|
|
|
|
# else
|
|
|
|
# define _USER v4_mc
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef CONFIG_CPU_XSCALE
|
|
|
|
# ifdef _USER
|
|
|
|
# define MULTI_USER 1
|
|
|
|
# else
|
|
|
|
# define _USER xscale_mc
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
2006-03-28 22:00:40 +02:00
|
|
|
#ifdef CONFIG_CPU_XSC3
|
|
|
|
# ifdef _USER
|
|
|
|
# define MULTI_USER 1
|
|
|
|
# else
|
|
|
|
# define _USER xsc3_mc
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
2005-04-17 00:20:36 +02:00
|
|
|
#ifdef CONFIG_CPU_COPY_V6
|
|
|
|
# define MULTI_USER 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(_USER) && !defined(MULTI_USER)
|
|
|
|
#error Unknown user operations model
|
|
|
|
#endif
|
|
|
|
|
2008-10-31 16:08:35 +01:00
|
|
|
struct page;
|
2009-10-05 16:17:45 +02:00
|
|
|
struct vm_area_struct;
|
2008-10-31 16:08:35 +01:00
|
|
|
|
2005-04-17 00:20:36 +02:00
|
|
|
struct cpu_user_fns {
|
2008-10-31 17:32:19 +01:00
|
|
|
void (*cpu_clear_user_highpage)(struct page *page, unsigned long vaddr);
|
2008-10-31 16:08:35 +01:00
|
|
|
void (*cpu_copy_user_highpage)(struct page *to, struct page *from,
|
2009-10-05 16:17:45 +02:00
|
|
|
unsigned long vaddr, struct vm_area_struct *vma);
|
2005-04-17 00:20:36 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef MULTI_USER
|
|
|
|
extern struct cpu_user_fns cpu_user;
|
|
|
|
|
2008-10-31 17:32:19 +01:00
|
|
|
#define __cpu_clear_user_highpage cpu_user.cpu_clear_user_highpage
|
2008-10-31 16:08:35 +01:00
|
|
|
#define __cpu_copy_user_highpage cpu_user.cpu_copy_user_highpage
|
2005-04-17 00:20:36 +02:00
|
|
|
|
|
|
|
#else
|
|
|
|
|
2008-10-31 17:32:19 +01:00
|
|
|
#define __cpu_clear_user_highpage __glue(_USER,_clear_user_highpage)
|
2008-10-31 16:08:35 +01:00
|
|
|
#define __cpu_copy_user_highpage __glue(_USER,_copy_user_highpage)
|
2005-04-17 00:20:36 +02:00
|
|
|
|
2008-10-31 17:32:19 +01:00
|
|
|
extern void __cpu_clear_user_highpage(struct page *page, unsigned long vaddr);
|
2008-10-31 16:08:35 +01:00
|
|
|
extern void __cpu_copy_user_highpage(struct page *to, struct page *from,
|
2009-10-05 16:17:45 +02:00
|
|
|
unsigned long vaddr, struct vm_area_struct *vma);
|
2005-04-17 00:20:36 +02:00
|
|
|
#endif
|
|
|
|
|
2008-10-31 17:32:19 +01:00
|
|
|
#define clear_user_highpage(page,vaddr) \
|
|
|
|
__cpu_clear_user_highpage(page, vaddr)
|
2008-10-31 16:08:35 +01:00
|
|
|
|
|
|
|
#define __HAVE_ARCH_COPY_USER_HIGHPAGE
|
|
|
|
#define copy_user_highpage(to,from,vaddr,vma) \
|
2009-10-05 16:17:45 +02:00
|
|
|
__cpu_copy_user_highpage(to, from, vaddr, vma)
|
2005-04-17 00:20:36 +02:00
|
|
|
|
2008-10-27 12:24:09 +01:00
|
|
|
#define clear_page(page) memset((void *)(page), 0, PAGE_SIZE)
|
2005-04-17 00:20:36 +02:00
|
|
|
extern void copy_page(void *to, const void *from);
|
|
|
|
|
|
|
|
#undef STRICT_MM_TYPECHECKS
|
|
|
|
|
|
|
|
#ifdef STRICT_MM_TYPECHECKS
|
|
|
|
/*
|
|
|
|
* These are used to make use of C type-checking..
|
|
|
|
*/
|
|
|
|
typedef struct { unsigned long pte; } pte_t;
|
|
|
|
typedef struct { unsigned long pmd; } pmd_t;
|
|
|
|
typedef struct { unsigned long pgd[2]; } pgd_t;
|
|
|
|
typedef struct { unsigned long pgprot; } pgprot_t;
|
|
|
|
|
|
|
|
#define pte_val(x) ((x).pte)
|
|
|
|
#define pmd_val(x) ((x).pmd)
|
|
|
|
#define pgd_val(x) ((x).pgd[0])
|
|
|
|
#define pgprot_val(x) ((x).pgprot)
|
|
|
|
|
|
|
|
#define __pte(x) ((pte_t) { (x) } )
|
|
|
|
#define __pmd(x) ((pmd_t) { (x) } )
|
|
|
|
#define __pgprot(x) ((pgprot_t) { (x) } )
|
|
|
|
|
|
|
|
#else
|
|
|
|
/*
|
|
|
|
* .. while these make it easier on the compiler
|
|
|
|
*/
|
|
|
|
typedef unsigned long pte_t;
|
|
|
|
typedef unsigned long pmd_t;
|
|
|
|
typedef unsigned long pgd_t[2];
|
|
|
|
typedef unsigned long pgprot_t;
|
|
|
|
|
|
|
|
#define pte_val(x) (x)
|
|
|
|
#define pmd_val(x) (x)
|
|
|
|
#define pgd_val(x) ((x)[0])
|
|
|
|
#define pgprot_val(x) (x)
|
|
|
|
|
|
|
|
#define __pte(x) (x)
|
|
|
|
#define __pmd(x) (x)
|
|
|
|
#define __pgprot(x) (x)
|
|
|
|
|
|
|
|
#endif /* STRICT_MM_TYPECHECKS */
|
|
|
|
|
2006-06-20 21:46:52 +02:00
|
|
|
#endif /* CONFIG_MMU */
|
|
|
|
|
2008-05-23 08:16:52 +02:00
|
|
|
typedef struct page *pgtable_t;
|
|
|
|
|
2009-09-07 16:06:42 +02:00
|
|
|
#ifndef CONFIG_SPARSEMEM
|
|
|
|
extern int pfn_valid(unsigned long);
|
|
|
|
#endif
|
|
|
|
|
2005-04-17 00:20:36 +02:00
|
|
|
#include <asm/memory.h>
|
|
|
|
|
|
|
|
#endif /* !__ASSEMBLY__ */
|
|
|
|
|
2008-09-07 18:16:54 +02:00
|
|
|
#define VM_DATA_DEFAULT_FLAGS \
|
|
|
|
(((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0) | \
|
|
|
|
VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
|
2005-04-17 00:20:36 +02:00
|
|
|
|
2009-05-14 00:56:30 +02:00
|
|
|
#include <asm-generic/getorder.h>
|
2005-09-04 00:54:30 +02:00
|
|
|
|
2005-04-17 00:20:36 +02:00
|
|
|
#endif
|