mywiki:linux:page_allocation
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| mywiki:linux:page_allocation [2016/05/18 10:38] – created shaoguoh | mywiki:linux:page_allocation [2019/09/15 18:55] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| | Reference | | | | Reference | | | ||
| - | Linux Page Allocation | ||
| + | ====== Address Conversion ====== | ||
| + | ===== page to Virtual address ===== | ||
| + | < | ||
| + | struct page *page; | ||
| + | unsigned char *p; | ||
| + | p = page_address(page); | ||
| + | </ | ||
| + | |||
| + | Other APIs: | ||
| + | |||
| + | * kmap_atomic | ||
| + | * __kunmap_atomic | ||
| + | ====== Linux Page Allocation ====== | ||
| Allocate pages | Allocate pages | ||
| Line 8: | Line 20: | ||
| | | ||
| page = alloc_pages(gfp, | page = alloc_pages(gfp, | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | Allocate one page | ||
| + | < | ||
| + | | ||
| + | char *data=" | ||
| + | |||
| + | / | ||
| + | page = alloc_page(gfp_mask); | ||
| + | if (page) | ||
| + | memcpy(page_address(page), | ||
| + | |||
| + | / | ||
| + | | ||
| </ | </ | ||
mywiki/linux/page_allocation.1463539090.txt.gz · Last modified: (external edit)
