X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Fasm-cris%2Fpage.h;h=c99c478c482f77d4568206a15952435b11e0d887;hb=987b0145d94eecf292d8b301228356f44611ab7c;hp=d50197df906873b490d7bfa67dc00ed654a43a5b;hpb=3944158a6d33f94668dbd6bdc32ff5c67bb53ec2;p=linux-2.6.git diff --git a/include/asm-cris/page.h b/include/asm-cris/page.h index d50197df9..c99c478c4 100644 --- a/include/asm-cris/page.h +++ b/include/asm-cris/page.h @@ -1,8 +1,7 @@ #ifndef _CRIS_PAGE_H #define _CRIS_PAGE_H -#ifdef __KERNEL__ - +#include #include /* PAGE_SHIFT determines the page size */ @@ -14,6 +13,8 @@ #endif #define PAGE_MASK (~(PAGE_SIZE-1)) +#ifdef __KERNEL__ + #define clear_page(page) memset((void *)(page), 0, PAGE_SIZE) #define copy_page(to,from) memcpy((void *)(to), (void *)(from), PAGE_SIZE) @@ -42,7 +43,8 @@ typedef struct { unsigned long pgprot; } pgprot_t; /* On CRIS the PFN numbers doesn't start at 0 so we have to compensate */ /* for that before indexing into the page table starting at mem_map */ -#define ARCH_PFN_OFFSET (PAGE_OFFSET >> PAGE_SHIFT) +#define pfn_to_page(pfn) (mem_map + ((pfn) - (PAGE_OFFSET >> PAGE_SHIFT))) +#define page_to_pfn(page) ((unsigned long)((page) - mem_map) + (PAGE_OFFSET >> PAGE_SHIFT)) #define pfn_valid(pfn) (((pfn) - (PAGE_OFFSET >> PAGE_SHIFT)) < max_mapnr) /* to index into the page map. our pages all start at physical addr PAGE_OFFSET so @@ -73,12 +75,9 @@ typedef struct { unsigned long pgprot; } pgprot_t; #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) -#include -#include - -#define devmem_is_allowed(x) 1 - #endif /* __KERNEL__ */ +#include + #endif /* _CRIS_PAGE_H */