Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
da06b8d0
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 3 年多
通知
13
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
da06b8d0
编写于
11月 09, 2007
作者:
P
Paul Mundt
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sh: Add SH-5 support to io.h.
Signed-off-by:
N
Paul Mundt
<
lethal@linux-sh.org
>
上级
3b9e7886
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
22 addition
and
16 deletion
+22
-16
include/asm-sh/io.h
include/asm-sh/io.h
+22
-16
未找到文件。
include/asm-sh/io.h
浏览文件 @
da06b8d0
...
...
@@ -243,12 +243,20 @@ static inline void ctrl_outl(unsigned int b, unsigned long addr)
static
inline
void
ctrl_delay
(
void
)
{
#ifdef P2SEG
ctrl_inw
(
P2SEG
);
#endif
}
#define IO_SPACE_LIMIT 0xffffffff
#ifdef CONFIG_MMU
#if !defined(CONFIG_MMU)
#define virt_to_phys(address) ((unsigned long)(address))
#define phys_to_virt(address) ((void *)(address))
#elif defined(CONFIG_SUPERH64)
#define virt_to_phys(address) (__pa(address))
#define phys_to_virt(address) (__va(address))
#else
/*
* Change virtual addresses to physical addresses and vv.
* These are trivial on the 1:1 Linux/SuperH mapping
...
...
@@ -262,28 +270,24 @@ static inline void *phys_to_virt(unsigned long address)
{
return
(
void
*
)
P1SEGADDR
(
address
);
}
#else
#define phys_to_virt(address) ((void *)(address))
#define virt_to_phys(address) ((unsigned long)(address))
#endif
/*
* readX/writeX() are used to access memory mapped devices. On some
* architectures the memory mapped IO stuff needs to be accessed
* differently. On the x86 architecture, we just read/write the
* memory location directly.
* On 32-bit SH, we traditionally have the whole physical address space
* mapped at all times (as MIPS does), so "ioremap()" and "iounmap()" do
* not need to do anything but place the address in the proper segment.
* This is true for P1 and P2 addresses, as well as some P3 ones.
* However, most of the P3 addresses and newer cores using extended
* addressing need to map through page tables, so the ioremap()
* implementation becomes a bit more complicated.
*
* On SH, we traditionally have the whole physical address space mapped
* at all times (as MIPS does), so "ioremap()" and "iounmap()" do not
* need to do anything but place the address in the proper segment. This
* is true for P1 and P2 addresses, as well as some P3 ones. However,
* most of the P3 addresses and newer cores using extended addressing
* need to map through page tables, so the ioremap() implementation
* becomes a bit more complicated. See arch/sh/mm/ioremap.c for
* additional notes on this.
* See arch/sh/mm/ioremap.c for additional notes on this.
*
* We cheat a bit and always return uncachable areas until we've fixed
* the drivers to handle caching properly.
*
* On the SH-5 the concept of segmentation in the 1:1 PXSEG sense simply
* doesn't exist, so everything must go through page tables.
*/
#ifdef CONFIG_MMU
void
__iomem
*
__ioremap
(
unsigned
long
offset
,
unsigned
long
size
,
...
...
@@ -297,6 +301,7 @@ void __iounmap(void __iomem *addr);
static
inline
void
__iomem
*
__ioremap_mode
(
unsigned
long
offset
,
unsigned
long
size
,
unsigned
long
flags
)
{
#ifdef CONFIG_SUPERH32
unsigned
long
last_addr
=
offset
+
size
-
1
;
/*
...
...
@@ -311,6 +316,7 @@ __ioremap_mode(unsigned long offset, unsigned long size, unsigned long flags)
return
(
void
__iomem
*
)
P2SEGADDR
(
offset
);
}
#endif
return
__ioremap
(
offset
,
size
,
flags
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录