X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Fasm-sparc64%2Fpage.h;h=c543310b9b187bd7d8e31a5f99a0d27056c0610d;hb=2cf7311f007833d5818fc9241c09a372c0325a4a;hp=45ff8ed378d2d8a88d7ad201363ce47e6a8ef75b;hpb=a91482bdcc2e0f6035702e46f1b99043a0893346;p=linux-2.6.git diff --git a/include/asm-sparc64/page.h b/include/asm-sparc64/page.h index 45ff8ed37..c543310b9 100644 --- a/include/asm-sparc64/page.h +++ b/include/asm-sparc64/page.h @@ -14,11 +14,14 @@ #ifndef __ASSEMBLY__ +/* Sparc64 is slow at multiplication, we prefer to use some extra space. */ +#define WANT_PAGE_VIRTUAL 1 + extern void _clear_page(void *page); #define clear_page(X) _clear_page((void *)(X)) struct page; extern void clear_user_page(void *addr, unsigned long vaddr, struct page *page); -#define copy_page(X,Y) memcpy((void *)(X), (void *)(Y), PAGE_SIZE) +#define copy_page(X,Y) __memcpy((void *)(X), (void *)(Y), PAGE_SIZE) extern void copy_user_page(void *to, void *from, unsigned long vaddr, struct page *topage); /* GROSS, defining this makes gcc pass these types as aggregates, @@ -108,19 +111,17 @@ typedef unsigned long iopgprot_t; */ #define PAGE_OFFSET _AC(0xFFFFF80000000000,UL) -#ifndef __ASSEMBLY__ - #define __pa(x) ((unsigned long)(x) - PAGE_OFFSET) #define __va(x) ((void *)((unsigned long) (x) + PAGE_OFFSET)) /* PFNs are real physical page numbers. However, mem_map only begins to record * per-page information starting at pfn_base. This is to handle systems where - * the first physical page in the machine is at some huge physical address, - * such as 4GB. This is common on a partitioned E10000, for example. + * the first physical page in the machine is at some huge physical address, such + * as 4GB. This is common on a partitioned E10000, for example. */ -extern struct page *pfn_to_page(unsigned long pfn); -extern unsigned long page_to_pfn(struct page *); +#define pfn_to_page(pfn) (mem_map + ((pfn)-(pfn_base))) +#define page_to_pfn(page) ((unsigned long)(((page) - mem_map) + pfn_base)) #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr)>>PAGE_SHIFT) #define pfn_valid(pfn) (((pfn)-(pfn_base)) < max_mapnr) @@ -129,6 +130,8 @@ extern unsigned long page_to_pfn(struct page *); #define virt_to_phys __pa #define phys_to_virt __va +#ifndef __ASSEMBLY__ + /* The following structure is used to hold the physical * memory configuration of the machine. This is filled in * probe_memory() and is later used by mem_init() to set up @@ -165,8 +168,6 @@ static __inline__ int get_order(unsigned long size) #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) -#define devmem_is_allowed(x) 1 - #endif /* !(__KERNEL__) */ #endif /* !(_SPARC64_PAGE_H) */