/proc/iomem的内容 [英] Content of /proc/iomem

查看:511
本文介绍了/proc/iomem的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

1)是否可以访问/proc/iomem中未定义的物理地址?

1) Is it possible to access a physical address which is not defined in /proc/iomem?

2)如果设备的物理地址范围未出现在/proc/iomem中,是否表示该设备尚未被使用/初始化?

2) If the physical address range of a device does not appear in /proc/iomem, does it mean that the device has not been utilized/initialized yet?

推荐答案

1)是否可以访问/proc/iomem中未定义的物理地址?

1) Is it possible to access a physical address which is not defined in /proc/iomem?

是的
假定内存映射所有直接连接的外围设备的ARM处理器,驱动程序可以执行ioremap()操作以将物理内存映射到虚拟内存以进行访问.
但是正确编写的驱动程序将首先调用request_mem_region()以确保其可以使用(并声明拥有)该物理地址空间.
/proc/iomem中的信息来自调用request_mem_region()的驱动程序.

Yes.
Assuming an ARM processor which memory maps all directly-connected periperals, the driver could perform an ioremap() operation to map the physical memory to virtual memory for access.
But a properly written driver would first call request_mem_region() to ensure that it can use (and lay claim to) that physical address space.
The information in /proc/iomem comes from drivers calling request_mem_region().

2)如果设备的物理地址范围未出现在/proc/iomem中,是否表示该设备尚未被使用/初始化?

2) If the physical address range of a device does not appear in /proc/iomem, does it mean that the device has not been utilized/initialized yet?

您必须检查驱动程序代码,以确定驱动程序的编写方式.
ioremap()之前是否有request_mem_region()?
使用dmesg命令检查系统日志;也许驱动程序初始化失败.

You would have to inspect the driver code to determine how well written the driver is.
Is there a request_mem_region() before the ioremap()?
Check the system log using the dmesg command; perhaps driver initialization failed.

假定这是一个静态链接的驱动程序,而不是可加载的模块,则由于每个内核设备驱动程序都有其init()例程,因此您可以通过在内核命令行上添加选项"initcall_debug"来获取跟踪输出.如果使用的是U-Boot,则应将此选项添加到"bootargs"变量(用于内核命令行).

Assuming that this is a statically-linked driver rather than a loadable module, then as each kernel device driver has its init() routine called you can get trace output by having added the option "initcall_debug" on the kernel command line. If you are using U-Boot, then this option should be added to the "bootargs" variable (which is used for the kernel command line).

这篇关于/proc/iomem的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆