Home | History | Annotate | Download | only in asm
      1 /****************************************************************************
      2  ****************************************************************************
      3  ***
      4  ***   This header was automatically generated from a Linux kernel header
      5  ***   of the same name, to make information necessary for userspace to
      6  ***   call into the kernel available to libc.  It contains only constants,
      7  ***   structures, and macros generated from the original header, and thus,
      8  ***   contains no copyrightable information.
      9  ***
     10  ****************************************************************************
     11  ****************************************************************************/
     12 #ifndef __ASM_SH_PAGE_H
     13 #define __ASM_SH_PAGE_H
     14 
     15 #include <linux/const.h>
     16 
     17 #define PAGE_SHIFT 12
     18 
     19 #define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT)
     20 #define PAGE_MASK (~(PAGE_SIZE-1))
     21 #define PTE_MASK PAGE_MASK
     22 
     23 #ifndef __ASSEMBLY__
     24 
     25 struct page;
     26 struct vm_area_struct;
     27 
     28 #define __HAVE_ARCH_COPY_USER_HIGHPAGE
     29 
     30 typedef struct { unsigned long pte_low; } pte_t;
     31 typedef struct { unsigned long pgprot; } pgprot_t;
     32 typedef struct { unsigned long pgd; } pgd_t;
     33 #define pte_val(x) ((x).pte_low)
     34 #define __pte(x) ((pte_t) { (x) } )
     35 
     36 #define pgd_val(x) ((x).pgd)
     37 #define pgprot_val(x) ((x).pgprot)
     38 
     39 #define __pgd(x) ((pgd_t) { (x) } )
     40 #define __pgprot(x) ((pgprot_t) { (x) } )
     41 
     42 typedef struct page *pgtable_t;
     43 
     44 #endif
     45 
     46 #define __MEMORY_START CONFIG_MEMORY_START
     47 #define __MEMORY_SIZE CONFIG_MEMORY_SIZE
     48 
     49 #define PAGE_OFFSET CONFIG_PAGE_OFFSET
     50 
     51 #define __pa(x) ((unsigned long)(x)-PAGE_OFFSET)
     52 #define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET))
     53 
     54 #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT)
     55 #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
     56 
     57 #define PFN_START (__MEMORY_START >> PAGE_SHIFT)
     58 #define ARCH_PFN_OFFSET (PFN_START)
     59 #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
     60 #define pfn_valid(pfn) ((pfn) >= min_low_pfn && (pfn) < max_low_pfn)
     61 #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
     62 
     63 #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC |   VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
     64 
     65 #include <asm-generic/memory_model.h>
     66 
     67 #define __HAVE_ARCH_GATE_AREA
     68 
     69 #define ARCH_KMALLOC_MINALIGN L1_CACHE_BYTES
     70 
     71 #endif
     72