How to get linux kernel page size programmatically

前端 未结 7 1433
悲哀的现实
悲哀的现实 2021-01-31 07:56

I am working on a Linux module for IA64. My current problem is that the driver uses the PAGE_SIZE and PAGE_SHIFT macros for dma page allocation. The problem I am having is tha

7条回答
  •  北恋
    北恋 (楼主)
    2021-01-31 08:41

    If you are trying to build a kernel module, you will need to have at least the kernel headers that are configured for the kernel the module will run on. Those will define the page size macros you need. If you don't have the correctly configured headers, the kernel will refuse to load your module.

    And there is nothing wrong with compiling a module on one machine to run on another, even if it's a different architecture. You just need to build against the correct kernel source.

提交回复
热议问题