Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
c2ff5cf2
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
c2ff5cf2
编写于
12月 18, 2015
作者:
V
Vineet Gupta
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ARC: mm: Use virt_to_pfn() for addr >> PAGE_SHIFT pattern
Signed-off-by:
N
Vineet Gupta
<
vgupta@synopsys.com
>
上级
0b291635
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
11 addition
and
17 deletion
+11
-17
arch/arc/include/asm/page.h
arch/arc/include/asm/page.h
+7
-12
arch/arc/include/asm/pgtable.h
arch/arc/include/asm/pgtable.h
+4
-5
未找到文件。
arch/arc/include/asm/page.h
浏览文件 @
c2ff5cf2
...
...
@@ -10,7 +10,6 @@
#include <uapi/asm/page.h>
#ifndef __ASSEMBLY__
#define get_user_page(vaddr) __get_free_page(GFP_KERNEL)
...
...
@@ -76,30 +75,26 @@ typedef unsigned long pgprot_t;
typedef
pte_t
*
pgtable_t
;
#define ARCH_PFN_OFFSET (CONFIG_LINUX_LINK_BASE >> PAGE_SHIFT)
#define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT)
#define ARCH_PFN_OFFSET virt_to_pfn(CONFIG_LINUX_LINK_BASE)
#define pfn_valid(pfn)
(((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
#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
* And for ARC, link-addr = physical address
*/
#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
))
(mem_map +
virt_to_pfn((kaddr) - CONFIG_LINUX_LINK_BASE
))
#define virt_addr_valid(kaddr) pfn_valid(
__pa(kaddr) >> PAGE_SHIFT
)
#define virt_addr_valid(kaddr) pfn_valid(
virt_to_pfn(kaddr)
)
/* Default Permissions for stack/heaps pages (Non Executable) */
#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE)
...
...
arch/arc/include/asm/pgtable.h
浏览文件 @
c2ff5cf2
...
...
@@ -278,15 +278,14 @@ static inline void pmd_set(pmd_t *pmdp, pte_t *ptep)
#define pmd_present(x) (pmd_val(x))
#define pmd_clear(xp) do { pmd_val(*(xp)) = 0; } while (0)
#define pte_page(x) (mem_map + \
(unsigned long)(((pte_val(x) - CONFIG_LINUX_LINK_BASE) >> \
PAGE_SHIFT)))
#define pte_page(pte) \
(mem_map + virt_to_pfn(pte_val(pte) - CONFIG_LINUX_LINK_BASE))
#define mk_pte(page, prot) pfn_pte(page_to_pfn(page), prot)
#define pte_pfn(pte)
(pte_val(pte) >> PAGE_SHIFT
)
#define pte_pfn(pte)
virt_to_pfn(pte_val(pte)
)
#define pfn_pte(pfn, prot) (__pte(((pte_t)(pfn) << PAGE_SHIFT) | \
pgprot_val(prot)))
#define __pte_index(addr) (
((addr) >> PAGE_SHIFT
) & (PTRS_PER_PTE - 1))
#define __pte_index(addr) (
virt_to_pfn(addr
) & (PTRS_PER_PTE - 1))
/*
* pte_offset gets a @ptr to PMD entry (PGD in our 2-tier paging system)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录