Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是这个主题的新手,我已经映射了 3 页。我如何阅读每个内容?我知道我必须使用 PAGE_SHIFT 但我不知道如何。
unsigned int* address = mmap(...)
类似于以下的东西...
#define PAGE_SIZE 4096 unsigned int * address = mmap(...) unsigned int * page0 = &address[ 0 * PAGE_SIZE / sizeof(int) ]; unsigned int * page1 = &address[ 1 * PAGE_SIZE / sizeof(int) ]; unsigned int * page2 = &address[ 2 * PAGE_SIZE / sizeof(int) ];