2008-10-23 05:26:29 +00:00
|
|
|
#ifndef _ASM_X86_PAGE_H
|
|
|
|
#define _ASM_X86_PAGE_H
|
2008-01-30 12:32:41 +00:00
|
|
|
|
2009-02-13 12:23:02 +00:00
|
|
|
#include <linux/types.h>
|
|
|
|
|
2008-01-30 12:32:44 +00:00
|
|
|
#ifdef __KERNEL__
|
|
|
|
|
2009-02-09 06:52:14 +00:00
|
|
|
#include <asm/page_types.h>
|
2008-01-30 12:32:41 +00:00
|
|
|
|
|
|
|
#ifdef CONFIG_X86_64
|
2008-01-30 12:32:44 +00:00
|
|
|
#include <asm/page_64.h>
|
|
|
|
#else
|
|
|
|
#include <asm/page_32.h>
|
2008-01-30 12:32:41 +00:00
|
|
|
#endif /* CONFIG_X86_64 */
|
|
|
|
|
2008-01-30 12:32:42 +00:00
|
|
|
#ifndef __ASSEMBLY__
|
2008-01-30 12:34:06 +00:00
|
|
|
|
2008-01-30 12:32:42 +00:00
|
|
|
struct page;
|
|
|
|
|
x86: fix {clear,copy}_user_page() declarations in page.h
Clean up: eliminate some compiler noise on x86 when building with strict
warnings enabled, introduced by commit 345b904c.
In file included from include2/asm/thread_info_64.h:12,
from include2/asm/thread_info.h:4,
from
/home/cel/src/linux/nfs-2.6/include/linux/thread_info.h:35,
from
/home/cel/src/linux/nfs-2.6/include/linux/preempt.h:9,
from
/home/cel/src/linux/nfs-2.6/include/linux/spinlock.h:49,
from /home/cel/src/linux/nfs-2.6/include/linux/mmzone.h:7,
from /home/cel/src/linux/nfs-2.6/include/linux/gfp.h:4,
from /home/cel/src/linux/nfs-2.6/include/linux/slab.h:14,
from /home/cel/src/linux/nfs-2.6/fs/nfsd/nfs4acl.c:40:
include2/asm/page.h:55: warning: `inline' is not at beginning of
declaration
include2/asm/page.h:61: warning: `inline' is not at beginning of
declaration
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Cc: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2008-03-04 22:55:45 +00:00
|
|
|
static inline void clear_user_page(void *page, unsigned long vaddr,
|
2009-02-09 06:52:14 +00:00
|
|
|
struct page *pg)
|
2008-01-30 12:32:42 +00:00
|
|
|
{
|
|
|
|
clear_page(page);
|
|
|
|
}
|
|
|
|
|
x86: fix {clear,copy}_user_page() declarations in page.h
Clean up: eliminate some compiler noise on x86 when building with strict
warnings enabled, introduced by commit 345b904c.
In file included from include2/asm/thread_info_64.h:12,
from include2/asm/thread_info.h:4,
from
/home/cel/src/linux/nfs-2.6/include/linux/thread_info.h:35,
from
/home/cel/src/linux/nfs-2.6/include/linux/preempt.h:9,
from
/home/cel/src/linux/nfs-2.6/include/linux/spinlock.h:49,
from /home/cel/src/linux/nfs-2.6/include/linux/mmzone.h:7,
from /home/cel/src/linux/nfs-2.6/include/linux/gfp.h:4,
from /home/cel/src/linux/nfs-2.6/include/linux/slab.h:14,
from /home/cel/src/linux/nfs-2.6/fs/nfsd/nfs4acl.c:40:
include2/asm/page.h:55: warning: `inline' is not at beginning of
declaration
include2/asm/page.h:61: warning: `inline' is not at beginning of
declaration
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Cc: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2008-03-04 22:55:45 +00:00
|
|
|
static inline void copy_user_page(void *to, void *from, unsigned long vaddr,
|
2009-02-09 06:52:14 +00:00
|
|
|
struct page *topage)
|
2008-01-30 12:32:42 +00:00
|
|
|
{
|
|
|
|
copy_page(to, from);
|
|
|
|
}
|
|
|
|
|
|
|
|
#define __alloc_zeroed_user_highpage(movableflags, vma, vaddr) \
|
|
|
|
alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO | movableflags, vma, vaddr)
|
|
|
|
#define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE
|
|
|
|
|
2008-01-30 12:32:43 +00:00
|
|
|
#define __pa(x) __phys_addr((unsigned long)(x))
|
2008-10-03 15:54:25 +00:00
|
|
|
#define __pa_nodebug(x) __phys_addr_nodebug((unsigned long)(x))
|
2008-01-30 12:32:43 +00:00
|
|
|
/* __pa_symbol should be used for C visible symbols.
|
|
|
|
This seems to be the official gcc blessed way to do such arithmetic. */
|
2010-08-11 06:37:41 +00:00
|
|
|
/*
|
|
|
|
* We need __phys_reloc_hide() here because gcc may assume that there is no
|
|
|
|
* overflow during __pa() calculation and can optimize it unexpectedly.
|
|
|
|
* Newer versions of gcc provide -fno-strict-overflow switch to handle this
|
|
|
|
* case properly. Once all supported versions of gcc understand it, we can
|
|
|
|
* remove this Voodoo magic stuff. (i.e. once gcc3.x is deprecated)
|
|
|
|
*/
|
2008-01-30 12:32:43 +00:00
|
|
|
#define __pa_symbol(x) __pa(__phys_reloc_hide((unsigned long)(x)))
|
|
|
|
|
|
|
|
#define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET))
|
|
|
|
|
|
|
|
#define __boot_va(x) __va(x)
|
|
|
|
#define __boot_pa(x) __pa(x)
|
|
|
|
|
2008-10-03 15:54:25 +00:00
|
|
|
/*
|
|
|
|
* virt_to_page(kaddr) returns a valid pointer if and only if
|
|
|
|
* virt_addr_valid(kaddr) returns true.
|
|
|
|
*/
|
2008-01-30 12:32:43 +00:00
|
|
|
#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
|
|
|
|
#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT)
|
2008-10-03 15:54:25 +00:00
|
|
|
extern bool __virt_addr_valid(unsigned long kaddr);
|
|
|
|
#define virt_addr_valid(kaddr) __virt_addr_valid((unsigned long) (kaddr))
|
2008-01-30 12:32:43 +00:00
|
|
|
|
2008-01-30 12:32:42 +00:00
|
|
|
#endif /* __ASSEMBLY__ */
|
|
|
|
|
2008-01-30 12:32:44 +00:00
|
|
|
#include <asm-generic/memory_model.h>
|
2009-05-13 22:56:30 +00:00
|
|
|
#include <asm-generic/getorder.h>
|
2008-01-30 12:32:44 +00:00
|
|
|
|
|
|
|
#define __HAVE_ARCH_GATE_AREA 1
|
2008-01-30 12:32:42 +00:00
|
|
|
|
2008-01-30 12:32:44 +00:00
|
|
|
#endif /* __KERNEL__ */
|
2008-10-23 05:26:29 +00:00
|
|
|
#endif /* _ASM_X86_PAGE_H */
|