XWOS API  4.0
XWOS C/C++ API参考手册
载入中...
搜索中...
未找到
page.h
浏览该文件的文档.
1
13#ifndef __xwos_mm_mempool_page_h__
14#define __xwos_mm_mempool_page_h__
15
16#include <xwos/standard.h>
17#include <xwos/lib/bclst.h>
18#include <xwos/lib/rbtree.h>
20#include <xwos/mm/common.h>
21
29
30#define XWMM_MEMPOOL_PAGE_ORDER_CMB (XWSQ_MAX)
31#define XWMM_MEMPOOL_PAGE_MAPPING_FREE (0U)
32#define XWMM_MEMPOOL_PAGE_MAPPING_INVAILD (XWPTR_MAX)
33
45 union {
46 struct {
49 } free;
50 struct {
51 struct xwlib_bclst_node node;
58
59 union {
60 void * pointer;
62 } data;
63};
64
66
77 struct xwos_sqlk lock;
78};
79
85 struct xwmm_zone zone;
86 const char * name;
91};
92
94 void * mem,
95 struct xwmm_mempool_page ** pgbuf);
97 const char * name,
98 xwptr_t origin, xwsz_t size, xwsz_t pgsize,
99 struct xwmm_mempool_page_odrbtree * odrbtree,
100 struct xwmm_mempool_page * pgarray);
103 struct xwmm_mempool_page ** pgbuf);
105 struct xwmm_mempool_page * pg);
106
111#endif /* xwos/mm/mempool/page.h */
XWOS通用库:双循环链表
xwer_t xwmm_mempool_page_free(struct xwmm_mempool_page_allocator *pa, struct xwmm_mempool_page *pg)
XWMM API:释放一页内存
Definition page.c:194
xwer_t xwmm_mempool_page_allocate(struct xwmm_mempool_page_allocator *pa, xwsq_t order, struct xwmm_mempool_page **pgbuf)
XWMM API:申请一页内存
Definition page.c:159
xwer_t xwmm_mempool_page_find(struct xwmm_mempool_page_allocator *pa, void *mem, struct xwmm_mempool_page **pgbuf)
依据内存地址查找页
Definition page.c:519
xwer_t xwmm_mempool_page_allocator_init(struct xwmm_mempool_page_allocator *pa, const char *name, xwptr_t origin, xwsz_t size, xwsz_t pgsize, struct xwmm_mempool_page_odrbtree *odrbtree, struct xwmm_mempool_page *pgarray)
XWMM API:初始化页分配器
Definition page.c:86
signed long xwer_t
Definition type.h:554
__xwcc_atomic xwlfq_t atomic_xwlfq_t
Definition type.h:594
unsigned long xwsz_t
Definition type.h:339
unsigned long xwsq_t
Definition type.h:445
unsigned long xwptr_t
Definition type.h:375
XWOS内存管理:内存池:分配器接口
操作系统抽象层:顺序锁
XWOS通用库:红黑树
双循环链表的节点
Definition bclst.h:27
红黑树节点
Definition rbtree.h:81
红黑树
Definition rbtree.h:95
interface:分配器
Definition i_allocator.h:27
struct xwmm_mempool_i_allocator i_a
Definition page.h:84
struct xwmm_mempool_page * pgarray
Definition page.h:90
struct xwmm_zone zone
Definition page.h:85
const char * name
Definition page.h:86
struct xwmm_mempool_page_odrbtree * odrbtree
Definition page.h:89
struct xwlib_rbtree tree
Definition page.h:73
struct xwmm_mempool_page * leftmost
Definition page.h:74
struct xwos_sqlk lock
Definition page.h:77
struct xwmm_mempool_page_allocator * owner
Definition page.h:76
内存页
Definition page.h:37
xwsq_t seq
Definition page.h:48
xwsq_t value
Definition page.h:61
struct xwlib_rbtree_node rbnode
Definition page.h:47
union xwmm_mempool_page::@1 attr
xwptr_t mapping
Definition page.h:40
union xwmm_mempool_page::@2 data
xwsq_t refcnt
Definition page.h:53
void * pointer
Definition page.h:60
atomic_xwlfq_t objhead
Definition page.h:52
struct xwmm_mempool_page::@1::@4 objcache
struct xwmm_mempool_page::@1::@3 free
xwsq_t order
Definition page.h:38
XWOS内存区域
Definition common.h:40
XWOS API:顺序锁
Definition seqlock.h:112
XWOS内存管理:通用定义
XWOS的标准头文件