User Tools

Site Tools


mywiki:linux:page_allocation

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
mywiki:linux:page_allocation [2016/05/18 15:20] shaoguohmywiki: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 =====
 +<file>
 +struct page *page;
 +unsigned char *p;
 +p = page_address(page);
 +</file>
 +
 +Other APIs:
 +
 +  * kmap_atomic
 +  * __kunmap_atomic
 +====== Linux Page Allocation ======
  
 Allocate pages Allocate pages
Line 20: Line 32:
    page = alloc_page(gfp_mask);    page = alloc_page(gfp_mask);
    if (page)     if (page) 
-      memcpy(**page_address**(page),  data, strlen(data)+1 );+      memcpy(page_address(page),  data, strlen(data)+1 );
   
    /*free a page*/    /*free a page*/
mywiki/linux/page_allocation.1463556052.txt.gz · Last modified: (external edit)