Rev 886 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
859 | serge | 1 | |
2 | link_t link; |
||
3 | count_t busy; /**< Count of full slots in magazine */ |
||
4 | count_t size; /**< Number of slots in magazine */ |
||
5 | void *objs[]; /**< Slots in magazine */ |
||
6 | } slab_magazine_t; |
||
7 | |||
8 | |||
9 | slab_magazine_t *current; |
||
10 | slab_magazine_t *last; |
||
11 | SPINLOCK_DECLARE(lock); |
||
12 | } slab_mag_cache_t; |
||
13 | |||
14 | |||
15 | |||
16 | |||
17 | |||
18 | |||
19 | /** Size of slab position - align_up(sizeof(obj)) */ |
||
20 | size_t size; |
||
21 | |||
22 | |||
23 | // int (*destructor)(void *obj); |
||
24 | |||
25 | |||
26 | int flags; |
||
27 | |||
28 | |||
29 | u32_t order; /**< Order of frames to be allocated */ |
||
30 | unsigned int objects; /**< Number of objects that fit in */ |
||
31 | |||
32 | |||
33 | atomic_t allocated_slabs; |
||
34 | atomic_t allocated_objs; |
||
35 | atomic_t cached_objs; |
||
36 | /** How many magazines in magazines list */ |
||
37 | atomic_t magazine_counter; |
||
38 | |||
39 | |||
40 | link_t full_slabs; /**< List of full slabs */ |
||
41 | link_t partial_slabs; /**< List of partial slabs */ |
||
42 | SPINLOCK_DECLARE(slablock); |
||
43 | /* Magazines */ |
||
44 | link_t magazines; /**< List o full magazines */ |
||
45 | SPINLOCK_DECLARE(maglock); |
||
46 | |||
47 | |||
48 | slab_mag_cache_t *mag_cache; |
||
49 | } slab_cache_t; |
||
50 | |||
51 | |||
52 | link_t link; /**< List of full/partial slabs. */ |
||
53 | slab_cache_t *cache; /**< Pointer to parent cache. */ |
||
54 | count_t available; /**< Count of available items in this slab. */ |
||
55 | void *start; /**< Start address of first item. */ |
||
56 | void *nextavail; /**< The index of next available item. */ |
||
57 | } slab_t; |
||
58 | |||
59 | |||
60 | |||
61 | |||
62 | #define SLAB_MAX_BADNESS(cache) (((size_t) PAGE_SIZE << (cache)->order) >> 2) |
||
63 | |||
64 | |||
65 | #define SLAB_CACHE_NOMAGAZINE 0x1 |
||
66 | /** Have control structure inside SLAB */ |
||
67 | #define SLAB_CACHE_SLINSIDE 0x2 |
||
68 | /** We add magazine cache later, if we have this flag */ |
||
69 | #define SLAB_CACHE_MAGDEFERRED (0x4 | SLAB_CACHE_NOMAGAZINE) |
||
70 | |||
71 | |||
72 | |||
73 | size_t size, |
||
74 | size_t align, |
||
75 | int (*constructor)(void *obj, int kmflag), |
||
76 | int (*destructor)(void *obj), |
||
77 | int flags); |
||
78 | |||
79 | |||
80 | void __fastcall slab_free(slab_cache_t *cache, void *obj); |
||
886 | serge | 81 | |
82 | |||
2971 | Serge | 83 | |
84 | { |
||
85 | int left; |
||
86 | int top; |
||
87 | int right; |
||
88 | int bottom; |
||
89 | }rect_t; |
||
90 | |||
91 | |||
92 | { |
||
93 | link_t link; |
||
94 | rect_t wrect; |
||
95 | rect_t crect; |
||
96 | rect_t hrect; |
||
97 | |||
98 | |||
99 | color_t clr_titlebar; |
||
100 | color_t clr_frames; |
||
101 | |||
102 | |||
103 | u32_t state; |
||
104 | |||
105 | |||
106 | |||
107 | |||
108 | u32_t qflags; |
||
109 | |||
110 | |||
111 | }window_t;><>>>>>>>>>>>>>> |
||
112 |