2008-10-22 23:26:29 -06:00
|
|
|
#ifndef _ASM_X86_PAGE_H
|
|
|
|
#define _ASM_X86_PAGE_H
|
2008-01-30 05:32:41 -07:00
|
|
|
|
2008-01-30 05:32:44 -07:00
|
|
|
#ifdef __KERNEL__
|
|
|
|
|
2009-02-08 23:52:14 -07:00
|
|
|
#include <asm/page_types.h>
|
2008-01-30 05:32:41 -07:00
|
|
|
|
|
|
|
#ifdef CONFIG_X86_64
|
2008-01-30 05:32:44 -07:00
|
|
|
#include <asm/page_64.h>
|
|
|
|
#else
|
|
|
|
#include <asm/page_32.h>
|
2008-01-30 05:32:41 -07:00
|
|
|
#endif /* CONFIG_X86_64 */
|
|
|
|
|
2008-01-30 05:32:42 -07:00
|
|
|
#ifndef __ASSEMBLY__
|
2008-01-30 05:34:06 -07:00
|
|
|
|
2008-01-30 05:32:42 -07: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 15:55:45 -07:00
|
|
|
static inline void clear_user_page(void *page, unsigned long vaddr,
|
2009-02-08 23:52:14 -07:00
|
|
|
struct page *pg)
|
2008-01-30 05:32:42 -07: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 15:55:45 -07:00
|
|
|
static inline void copy_user_page(void *to, void *from, unsigned long vaddr,
|
2009-02-08 23:52:14 -07:00
|
|
|
struct page *topage)
|
2008-01-30 05:32:42 -07: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 05:32:43 -07:00
|
|
|
#define __pa(x) __phys_addr((unsigned long)(x))
|
2008-10-03 09:54:25 -06:00
|
|
|
#define __pa_nodebug(x) __phys_addr_nodebug((unsigned long)(x))
|
2008-01-30 05:32:43 -07:00
|
|
|
/* __pa_symbol should be used for C visible symbols.
|
|
|
|
This seems to be the official gcc blessed way to do such arithmetic. */
|
|
|
|
#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 09:54:25 -06:00
|
|
|
/*
|
|
|
|
* virt_to_page(kaddr) returns a valid pointer if and only if
|
|
|
|
* virt_addr_valid(kaddr) returns true.
|
|
|
|
*/
|
2008-01-30 05:32:43 -07: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 09:54:25 -06:00
|
|
|
extern bool __virt_addr_valid(unsigned long kaddr);
|
|
|
|
#define virt_addr_valid(kaddr) __virt_addr_valid((unsigned long) (kaddr))
|
2008-01-30 05:32:43 -07:00
|
|
|
|
2008-01-30 05:32:42 -07:00
|
|
|
#endif /* __ASSEMBLY__ */
|
|
|
|
|
2008-01-30 05:32:44 -07:00
|
|
|
#include <asm-generic/memory_model.h>
|
|
|
|
#include <asm-generic/page.h>
|
|
|
|
|
|
|
|
#define __HAVE_ARCH_GATE_AREA 1
|
2008-01-30 05:32:42 -07:00
|
|
|
|
2008-01-30 05:32:44 -07:00
|
|
|
#endif /* __KERNEL__ */
|
2008-10-22 23:26:29 -06:00
|
|
|
#endif /* _ASM_X86_PAGE_H */
|