只是为了我的学习,我正在尝试在 ARM Linux 上实现从虚拟地址转换为物理地址的例程。
我正在从下面的材料中查看规格。 http://homepages.wmich.edu/~grantner/ece6050/ARM7100vA_3.pdf
我正在内核模块中实现例程,第一步我可以阅读 TTBR0。但我意识到我必须使用 TTBR0 和目标虚拟地址访问物理地址 P。我不知道如何访问物理地址 P,并尝试使用 ioremap() 来获取该物理地址 P 的虚拟地址 V。
但是,当我调用 ioremap() 时,它不起作用并转储回溯如下。有谁知道如何访问物理地址的正确方法?
[255075.566078] ------------[ cut here ]------------
[255075.570816] WARNING: at arch/arm/mm/ioremap.c:208 __arm_ioremap_pfn_caller+)
[255075.578806] Modules linked in: tv_driver(+) mtk_stp_gps mtk_fm_priv(P) mt66]
[255075.595096] Backtrace:
[255075.597590] [<c004df38>] (dump_backtrace+0x0/0x10c) from [<c057c8c4>] (dump)
[255075.606186] r7:00000009 r6:000000d0 r5:c005546c r4:00000000
[255075.611800] [<c057c8ac>] (dump_stack+0x0/0x1c) from [<c00817e0>] (warn_slow)
[255075.621378] [<c008178c>] (warn_slowpath_common+0x0/0x6c) from [<c008181c>] )
[255075.630390] r9:ca466000 r8:00000000 r7:4a25b000 r6:00000001 r5:00000004
[255075.636883] r4:00000290
[255075.639616] [<c00817f8>] (warn_slowpath_null+0x0/0x2c) from [<c005546c>] (_)
[255075.649740] [<c005537c>] (__arm_ioremap_pfn_caller+0x0/0x104) from [<c00554)
[255075.660186] [<c00554a0>] (__arm_ioremap_caller+0x0/0x64) from [<c0055518>] )
[255075.669115] r5:00000000 r4:4a25b290
[255075.672730] [<c0055504>] (__arm_ioremap+0x0/0x18) from [<bf144794>] (cl)
[255075.682695] [<bf144720>] (client_init+0x0/0x288 [driver]) from [<c00)
[255075.692774] r7:00022451 r6:00000000 r5:c07834c0 r4:4018a008
[255075.698458] [<c0043628>] (do_one_initcall+0x0/0x1a4) from [<c00bf150>] (sys)
[255075.707624] [<c00bf0c4>] (sys_init_module+0x0/0x1a4) from [<c0049b80>] (ret)
[255075.716673] r7:00000080 r6:40043d6c r5:00022451 r4:4018a008
[255075.722272] ---[ end trace bffd4c38629759a2 ]---