git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
feat: better rtc framework which aims to remove single rtc restrictions.
[lunaix-os.git]
/
lunaix-os
/
includes
/
lunaix
/
mm
/
cake.h
diff --git
a/lunaix-os/includes/lunaix/mm/cake.h
b/lunaix-os/includes/lunaix/mm/cake.h
index 0312c45d381ac7854a802cb248eb792ac496cbf6..e05a6b2ab79d6cf37489cb07df41c00ad972670e 100644
(file)
--- a/
lunaix-os/includes/lunaix/mm/cake.h
+++ b/
lunaix-os/includes/lunaix/mm/cake.h
@@
-5,7
+5,11
@@
#define PILE_NAME_MAXLEN 20
#define PILE_NAME_MAXLEN 20
-#define PILE_CACHELINE 1
+#define PILE_ALIGN_CACHE 1
+
+struct cake_pile;
+
+typedef void (*pile_cb)(struct cake_pile*, void*);
struct cake_pile
{
struct cake_pile
{
@@
-13,18
+17,20
@@
struct cake_pile
struct llist_header full;
struct llist_header partial;
struct llist_header free;
struct llist_header full;
struct llist_header partial;
struct llist_header free;
- u
nsigned in
t offset;
- u
nsigned in
t piece_size;
- u
nsigned in
t cakes_count;
- u
nsigned in
t alloced_pieces;
- u
nsigned in
t pieces_per_cake;
- u
nsigned in
t pg_per_cake;
+ u
32_
t offset;
+ u
32_
t piece_size;
+ u
32_
t cakes_count;
+ u
32_
t alloced_pieces;
+ u
32_
t pieces_per_cake;
+ u
32_
t pg_per_cake;
char pile_name[PILE_NAME_MAXLEN];
char pile_name[PILE_NAME_MAXLEN];
+
+ pile_cb ctor;
};
typedef unsigned int piece_index_t;
};
typedef unsigned int piece_index_t;
-#define EO_FREE_PIECE (-1)
+#define EO_FREE_PIECE (
(u32_t)
-1)
struct cake_s
{
struct cake_s
{
@@
-49,6
+55,9
@@
cake_new_pile(char* name,
unsigned int pg_per_cake,
int options);
unsigned int pg_per_cake,
int options);
+void
+cake_set_constructor(struct cake_pile* pile, pile_cb ctor);
+
/**
* @brief 拿一块儿蛋糕
*
/**
* @brief 拿一块儿蛋糕
*
@@
-70,11
+79,12
@@
cake_release(struct cake_pile* pile, void* area);
void
cake_init();
void
cake_init();
-/**
- * @brief 统计蛋糕数量 - 问问Pinkie :D
- *
- */
void
void
-cake_stats();
+cake_export();
+
+/********** some handy constructor ***********/
+
+void
+cake_ctor_zeroing(struct cake_pile* pile, void* piece);
#endif /* __LUNAIX_VALLOC_H */
#endif /* __LUNAIX_VALLOC_H */