Path: blob/master/arch/unicore32/include/asm/page.h
10820 views
/*1* linux/arch/unicore32/include/asm/page.h2*3* Code specific to PKUnity SoC and UniCore ISA4*5* Copyright (C) 2001-2010 GUAN Xue-tao6*7* This program is free software; you can redistribute it and/or modify8* it under the terms of the GNU General Public License version 2 as9* published by the Free Software Foundation.10*/11#ifndef __UNICORE_PAGE_H__12#define __UNICORE_PAGE_H__1314/* PAGE_SHIFT determines the page size */15#define PAGE_SHIFT 1216#define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT)17#define PAGE_MASK (~(PAGE_SIZE-1))1819#ifndef __ASSEMBLY__2021struct page;22struct vm_area_struct;2324#define clear_page(page) memset((void *)(page), 0, PAGE_SIZE)25extern void copy_page(void *to, const void *from);2627#define clear_user_page(page, vaddr, pg) clear_page(page)28#define copy_user_page(to, from, vaddr, pg) copy_page(to, from)2930#undef STRICT_MM_TYPECHECKS3132#ifdef STRICT_MM_TYPECHECKS33/*34* These are used to make use of C type-checking..35*/36typedef struct { unsigned long pte; } pte_t;37typedef struct { unsigned long pgd; } pgd_t;38typedef struct { unsigned long pgprot; } pgprot_t;3940#define pte_val(x) ((x).pte)41#define pgd_val(x) ((x).pgd)42#define pgprot_val(x) ((x).pgprot)4344#define __pte(x) ((pte_t) { (x) })45#define __pgd(x) ((pgd_t) { (x) })46#define __pgprot(x) ((pgprot_t) { (x) })4748#else49/*50* .. while these make it easier on the compiler51*/52typedef unsigned long pte_t;53typedef unsigned long pgd_t;54typedef unsigned long pgprot_t;5556#define pte_val(x) (x)57#define pgd_val(x) (x)58#define pgprot_val(x) (x)5960#define __pte(x) (x)61#define __pgd(x) (x)62#define __pgprot(x) (x)6364#endif /* STRICT_MM_TYPECHECKS */6566typedef struct page *pgtable_t;6768extern int pfn_valid(unsigned long);6970#include <asm/memory.h>7172#endif /* !__ASSEMBLY__ */7374#define VM_DATA_DEFAULT_FLAGS \75(VM_READ | VM_WRITE | VM_EXEC | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)7677#include <asm-generic/getorder.h>7879#endif808182