如何保护页面使其无法写入?

问题描述 投票:0回答:1

我想使用 pte_wrportect 函数来保护 ioremap 返回的地址。

char * addr;
addr = ioremap(0x207f700000,PAGE_SIZE);

接下来怎么办?

memory-management linux-kernel
1个回答
0
投票

使用功能

int set_memory_ro(unsigned long addr, int numpages)

使用

#include <linux/set_memory.h>

© www.soinside.com 2019 - 2024. All rights reserved.