Skip to content
Navigation Menu
Toggle navigation
Sign in
In this repository
All GitHub Enterprise
↵
Jump to
↵
No suggested jump to results
In this repository
All GitHub Enterprise
↵
Jump to
↵
In this organization
All GitHub Enterprise
↵
Jump to
↵
In this repository
All GitHub Enterprise
↵
Jump to
↵
Sign in
Reseting focus
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
mariux64
/
linux
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
1
Pull requests
0
Actions
Projects
0
Wiki
Security
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security
Insights
Files
6bc19fb
Documentation
arch
alpha
arc
boot
configs
include
asm
Kbuild
arcregs.h
asm-offsets.h
atomic.h
barrier.h
bitops.h
bug.h
cache.h
cacheflush.h
checksum.h
clk.h
cmpxchg.h
current.h
defines.h
delay.h
disasm.h
dma-mapping.h
dma.h
elf.h
entry.h
exec.h
futex.h
io.h
irq.h
irqflags.h
kdebug.h
kgdb.h
kprobes.h
linkage.h
mach_desc.h
mmu.h
mmu_context.h
module.h
mutex.h
page.h
perf_event.h
pgalloc.h
pgtable.h
processor.h
prom.h
ptrace.h
sections.h
segment.h
serial.h
setup.h
shmparam.h
smp.h
spinlock.h
spinlock_types.h
string.h
switch_to.h
syscall.h
syscalls.h
thread_info.h
timex.h
tlb-mmu1.h
tlb.h
tlbflush.h
uaccess.h
unaligned.h
unwind.h
uapi
kernel
lib
mm
oprofile
plat-arcfpga
plat-tb10x
Kbuild
Kconfig
Kconfig.debug
Makefile
arm
arm64
avr32
blackfin
c6x
cris
frv
h8300
hexagon
ia64
m32r
m68k
metag
microblaze
mips
mn10300
openrisc
parisc
powerpc
s390
score
sh
sparc
tile
um
unicore32
x86
xtensa
.gitignore
Kconfig
block
crypto
drivers
firmware
fs
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
tools
usr
virt
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README
REPORTING-BUGS
Breadcrumbs
linux
/
arch
/
arc
/
include
/
asm
/
page.h
Copy path
Blame
Blame
Latest commit
History
History
114 lines (87 loc) · 3.18 KB
Breadcrumbs
linux
/
arch
/
arc
/
include
/
asm
/
page.h
Top
File metadata and controls
Code
Blame
114 lines (87 loc) · 3.18 KB
Raw
/* * 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 #include <uapi/asm/page.h> #ifndef __ASSEMBLY__ #define get_user_page(vaddr) __get_free_page(GFP_KERNEL) #define free_user_page(page, addr) free_page(addr) #define clear_page(paddr) memset((paddr), 0, PAGE_SIZE) #define copy_page(to, from) memcpy((to), (from), PAGE_SIZE) 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); #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; typedef unsigned long pgtable_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) }) #define pte_pgprot(x) __pgprot(pte_val(x)) #else /* !STRICT_MM_TYPECHECKS */ typedef unsigned long pte_t; typedef unsigned long pgd_t; typedef unsigned long pgprot_t; typedef unsigned long pgtable_t; #define pte_val(x) (x) #define pgd_val(x) (x) #define pgprot_val(x) (x) #define __pte(x) (x) #define __pgprot(x) (x) #define pte_pgprot(x) (x) #endif #define ARCH_PFN_OFFSET (CONFIG_LINUX_LINK_BASE >> PAGE_SHIFT) #define pfn_valid(pfn) (((pfn) - ARCH_PFN_OFFSET) < max_mapnr) /* * __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. * So if kernel img is linked at 0x8000_0000 onwards, 0x8010_0000 will be * 128th page, and virt_to_page( ) will return the struct page corresp to it. * mem_map[ ] is an array of struct page for each page frame in the system * * Independent of where linux is linked at, link-addr = physical address * So the old macro __pa = vaddr + PAGE_OFFSET - CONFIG_LINUX_LINK_BASE * would have been wrong in case kernel is not at 0x8zs */ #define __pa(vaddr) ((unsigned long)vaddr) #define __va(paddr) ((void *)((unsigned long)(paddr))) #define virt_to_page(kaddr) \ (mem_map + ((__pa(kaddr) - CONFIG_LINUX_LINK_BASE) >> PAGE_SHIFT)) #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) /* Default Permissions for page, used in mmap.c */ #ifdef CONFIG_ARC_STACK_NONEXEC #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE) #else #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) #endif #define WANT_PAGE_VIRTUAL 1 #include <asm-generic/memory_model.h> /* page_to_pfn, pfn_to_page */ #include <asm-generic/getorder.h> #endif /* !__ASSEMBLY__ */ #endif
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
You can’t perform that action at this time.