#include "kconfig.h"
Go to the source code of this file.
|
|
#define | PAGE_ORDER_MAX 4 |
| |
|
#define | PAGE_SIZE_MIN 256 |
| |
|
|
unsigned long | get_page_total_size (void) |
| |
|
unsigned long | get_page_total_free_size (void) |
| |
| long | size_to_page_order (unsigned long size) |
| | Calculate the page order by giving the size of a memory. More...
|
| |
| unsigned long | page_order_to_size (long order) |
| | Calculate the page size by giving the page order. More...
|
| |
| void * | alloc_pages (unsigned long order) |
| | Allocate a new memory page. More...
|
| |
| void | free_pages (unsigned long addr, unsigned long order) |
| | Free an allocated memory page. More...
|
| |
◆ alloc_pages()
| void* alloc_pages |
( |
unsigned long |
order | ) |
|
Allocate a new memory page.
- Parameters
-
- Return values
-
| void | *: The function returns NULL if the allocation failed; otherwise it returns the address of the allocated memory page. |
◆ free_pages()
| void free_pages |
( |
unsigned long |
addr, |
|
|
unsigned long |
order |
|
) |
| |
Free an allocated memory page.
- Parameters
-
| addr | Pointer to the memory page. |
| order | The order of the memory page. |
- Return values
-
◆ page_order_to_size()
| unsigned long page_order_to_size |
( |
long |
order | ) |
|
Calculate the page size by giving the page order.
- Parameters
-
- Return values
-
| unsigned | long: The memory size of page in bytes. |
◆ size_to_page_order()
| long size_to_page_order |
( |
unsigned long |
size | ) |
|
Calculate the page order by giving the size of a memory.
- Parameters
-
| size | The memory size in bytes. |
- Return values
-