admin管理员组文章数量:1190403
I am trying to write a FIQ handler that writes to a memory mapped register. The challenge is that I need virtual address, corresponding to the physical address of that register (because if I am not wrong, I cannot write directly to the physical addresses in FIQ mode, just like normal mode).
I was skimming through the kernel source code for some reference implementation and I came across this : .6.67/source/arch/arm/mach-omap1/ams-delta-fiq-handler.S#L258.
omap_ih1_base:
.word OMAP1_IO_ADDRESS(OMAP_IH1_BASE)
deferred_fiq_ih_base:
.word OMAP1_IO_ADDRESS(DEFERRED_FIQ_IH_BASE)
omap1510_gpio_base:
.word OMAP1_IO_ADDRESS(OMAP1510_GPIO_BASE)
qwerty_fiqin_end:
where macros are defined like this :
#define OMAP1_IO_OFFSET 0x00f00000 /* Virtual IO = 0xff0b0000 */
#define OMAP1_IO_ADDRESS(pa) IOMEM((pa) - OMAP1_IO_OFFSET)
They are doing exactly same as what I may require. But this confused me how they are able to generate virtual addresses at compile time? And won't this go for a toss if KASLR (address space randomization) is enabled?
本文标签: Generating virtual addresses for iomem at compile time in linux kernelStack Overflow
版权声明:本文标题:Generating virtual addresses for iomem at compile time in linux kernel - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738429474a2086314.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论