Tenok
A Linux-like Real-Time Operating System for Robotics and Internet of Things
page.h
Go to the documentation of this file.
1 
4 #ifndef __PAGE_H__
5 #define __PAGE_H__
6 
7 #include "kconfig.h"
8 
9 #if PAGE_SIZE_SELECT == PAGE_SIZE_32K
10 #define PAGE_ORDER_MAX 4
11 #elif PAGE_SIZE_SELECT == PAGE_SIZE_64K
12 #define PAGE_ORDER_MAX 5
13 #endif
14 
15 #define PAGE_SIZE_MIN 256
16 
17 
18 unsigned long get_page_total_size(void);
19 unsigned long get_page_total_free_size(void);
20 
26 long size_to_page_order(unsigned long size);
27 
33 unsigned long page_order_to_size(long order);
34 
41 void *alloc_pages(unsigned long order);
42 
49 void free_pages(unsigned long addr, unsigned long order);
50 
51 #endif
unsigned long page_order_to_size(long order)
Calculate the page size by giving the page order.
Definition: page.c:70
void * alloc_pages(unsigned long order)
Allocate a new memory page.
Definition: page.c:159
void free_pages(unsigned long addr, unsigned long order)
Free an allocated memory page.
Definition: page.c:187
long size_to_page_order(unsigned long size)
Calculate the page order by giving the size of a memory.
Definition: page.c:60