PAGE_ALIGN()
来源:互联网 发布:软件关键性等级 编辑:程序博客网 时间:2024/04/28 04:08
将物理地址addr修整为页边界地址(页的上边界)
#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
|------------|<-- PAGE_ALGN(addr)
| |
| |
| |
| |<-- addr
| |
| |
| |
| |
|------------|
one page(4K)
#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
|------------|<-- PAGE_ALGN(addr)
| |
| |
| |
| |<-- addr
| |
| |
| |
| |
|------------|
one page(4K)
#define PAGE_SIZE (1UL << PAGE_SHIFT)
#define PAGE_MASK (~(PAGE_SIZE-1))
PAGE_MASK = ~(1 0000 0000 0000 - 1) = ~(1111 1111 1111) = 0000 0000 0000
PAGE_SIZE = 1 0000 0000 0000 = 2^12 = 4K
如addr为0x22000001 。。PAGE_ALIGN(addr)=(0x22000001+4096-1)&0xfffff000
=(0x22000001+0xfff)&0xfffff000=0x22001000&0xfffff000
=0x22001000;
同样,比如addr为0x22000003,PAGE_ALIGN(addr)后仍然是0x22001000;
就是和下一个页对齐,一个页为4k。起始地址为0x xxxxx 000;
- PAGE_ALIGN()
- PAGE_ALIGN()
- PAGE_ALIGN()
- PAGE_ALIGN()
- PAGE_ALIGN()
- PAGE_ALIGN()
- Linux内核 ALIGN PAGE_ALIGN
- linux内核- PAGE_ALIGN()
- PAGE_ALIGN 详解 纯属原创 转载注明出处
- route
- 无
- su
- 桥接模式(Bride Pattern):
- MyEclipse Android 开发环境搭建
- PAGE_ALIGN()
- 杭电hdu 1754 i hate it 线段树
- umask
- chgrp
- chmod
- 赵雅智_java.方法
- 字符型指针变量与字符数组的区别
- js_prototype
- chown