ARC: Fundamental ARCH data-types/defines
* L1_CACHE_SHIFT
* PAGE_SIZE, PAGE_OFFSET
* struct pt_regs, struct user_regs_struct
* struct thread_struct, cpu_relax(), task_pt_regs(), start_thread(), ...
* struct thread_info, THREAD_SIZE, INIT_THREAD_INFO(), TIF_*, ...
* BUG()
* ELF_*
* Elf_*
To disallow user-space visibility into some of the core kernel data-types
such as struct pt_regs, #ifdef __KERNEL__ which also makes the UAPI header
spit (further patch in the series) to NOT export it to asm/uapi/ptrace.h
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Cc: Jonas Bonn <jonas.bonn@gmail.com>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Acked-by: Arnd Bergmann <arnd@arndb.de>
2013-01-18 13:42:17 +04:00
/*
* Copyright ( C ) 2004 , 2007 - 2010 , 2011 - 2012 Synopsys , Inc . ( www . synopsys . com )
*
* This program is free software ; you can redistribute it and / or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation .
*/
# ifndef __ASM_ARC_PAGE_H
# define __ASM_ARC_PAGE_H
2013-02-11 18:25:33 +04:00
# include <uapi/asm/page.h>
ARC: Fundamental ARCH data-types/defines
* L1_CACHE_SHIFT
* PAGE_SIZE, PAGE_OFFSET
* struct pt_regs, struct user_regs_struct
* struct thread_struct, cpu_relax(), task_pt_regs(), start_thread(), ...
* struct thread_info, THREAD_SIZE, INIT_THREAD_INFO(), TIF_*, ...
* BUG()
* ELF_*
* Elf_*
To disallow user-space visibility into some of the core kernel data-types
such as struct pt_regs, #ifdef __KERNEL__ which also makes the UAPI header
spit (further patch in the series) to NOT export it to asm/uapi/ptrace.h
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Cc: Jonas Bonn <jonas.bonn@gmail.com>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Acked-by: Arnd Bergmann <arnd@arndb.de>
2013-01-18 13:42:17 +04:00
2013-01-18 13:42:19 +04:00
# ifndef __ASSEMBLY__
# define clear_page(paddr) memset((paddr), 0, PAGE_SIZE)
# define copy_page(to, from) memcpy((to), (from), PAGE_SIZE)
2013-05-09 20:24:51 +04:00
struct vm_area_struct ;
struct page ;
# define __HAVE_ARCH_COPY_USER_HIGHPAGE
void copy_user_highpage ( struct page * to , struct page * from ,
unsigned long u_vaddr , struct vm_area_struct * vma ) ;
void clear_user_page ( void * to , unsigned long u_vaddr , struct page * page ) ;
2013-01-18 13:42:19 +04:00
# undef STRICT_MM_TYPECHECKS
# ifdef STRICT_MM_TYPECHECKS
/*
* These are used to make use of C type - checking . .
*/
typedef struct {
unsigned long pte ;
} pte_t ;
typedef struct {
unsigned long pgd ;
} pgd_t ;
typedef struct {
unsigned long pgprot ;
} pgprot_t ;
# define pte_val(x) ((x).pte)
# define pgd_val(x) ((x).pgd)
# define pgprot_val(x) ((x).pgprot)
# define __pte(x) ((pte_t) { (x) })
# define __pgd(x) ((pgd_t) { (x) })
# define __pgprot(x) ((pgprot_t) { (x) })
2013-01-22 15:18:45 +04:00
# define pte_pgprot(x) __pgprot(pte_val(x))
2013-01-18 13:42:19 +04:00
# else /* !STRICT_MM_TYPECHECKS */
2015-02-06 18:44:57 +03:00
# ifdef CONFIG_ARC_HAS_PAE40
typedef unsigned long long pte_t ;
# else
2013-01-18 13:42:19 +04:00
typedef unsigned long pte_t ;
2015-02-06 18:44:57 +03:00
# endif
2013-01-18 13:42:19 +04:00
typedef unsigned long pgd_t ;
typedef unsigned long pgprot_t ;
# define pte_val(x) (x)
# define pgd_val(x) (x)
# define pgprot_val(x) (x)
# define __pte(x) (x)
2014-07-08 17:13:47 +04:00
# define __pgd(x) (x)
2013-01-18 13:42:19 +04:00
# define __pgprot(x) (x)
2013-01-22 15:18:45 +04:00
# define pte_pgprot(x) (x)
2013-01-18 13:42:19 +04:00
# endif
2015-08-28 06:09:57 +03:00
typedef pte_t * pgtable_t ;
2015-12-18 11:27:41 +03:00
# define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT)
# define ARCH_PFN_OFFSET virt_to_pfn(CONFIG_LINUX_LINK_BASE)
2013-01-18 13:42:19 +04:00
2015-12-18 11:27:41 +03:00
# define pfn_valid(pfn) (((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
2013-01-18 13:42:19 +04:00
/*
* __pa , __va , virt_to_page ( ALERT : deprecated , don ' t use them )
*
* These macros have historically been misnamed
* virt here means link - address / program - address as embedded in object code .
2015-12-18 11:27:41 +03:00
* And for ARC , link - addr = physical address
2013-01-18 13:42:19 +04:00
*/
# define __pa(vaddr) ((unsigned long)vaddr)
# define __va(paddr) ((void *)((unsigned long)(paddr)))
# define virt_to_page(kaddr) \
2015-12-18 11:27:41 +03:00
( mem_map + virt_to_pfn ( ( kaddr ) - CONFIG_LINUX_LINK_BASE ) )
2013-01-18 13:42:19 +04:00
2015-12-18 11:27:41 +03:00
# define virt_addr_valid(kaddr) pfn_valid(virt_to_pfn(kaddr))
2013-01-18 13:42:19 +04:00
2013-06-05 16:19:14 +04:00
/* Default Permissions for stack/heaps pages (Non Executable) */
2013-01-18 13:42:19 +04:00
# define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE)
# define WANT_PAGE_VIRTUAL 1
# include <asm-generic/memory_model.h> /* page_to_pfn, pfn_to_page */
# include <asm-generic/getorder.h>
ARC: Fundamental ARCH data-types/defines
* L1_CACHE_SHIFT
* PAGE_SIZE, PAGE_OFFSET
* struct pt_regs, struct user_regs_struct
* struct thread_struct, cpu_relax(), task_pt_regs(), start_thread(), ...
* struct thread_info, THREAD_SIZE, INIT_THREAD_INFO(), TIF_*, ...
* BUG()
* ELF_*
* Elf_*
To disallow user-space visibility into some of the core kernel data-types
such as struct pt_regs, #ifdef __KERNEL__ which also makes the UAPI header
spit (further patch in the series) to NOT export it to asm/uapi/ptrace.h
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Cc: Jonas Bonn <jonas.bonn@gmail.com>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Acked-by: Arnd Bergmann <arnd@arndb.de>
2013-01-18 13:42:17 +04:00
# endif /* !__ASSEMBLY__ */
# endif