Lines Matching refs:id

28 #define IS_PERSISTENT(id) (This->pstcache_fd[id] > 0)  argument
43 cache_rebuild_bmpcache_linked_list(RDPCLIENT * This, uint8 id, sint16 * idx, int count) in cache_rebuild_bmpcache_linked_list() argument
49 while (--n >= 0 && This->cache.bmpcache[id][idx[n]].bitmap == NULL); in cache_rebuild_bmpcache_linked_list()
52 This->cache.bmpcache_mru[id] = This->cache.bmpcache_lru[id] = NOT_SET; in cache_rebuild_bmpcache_linked_list()
56 This->cache.bmpcache_mru[id] = idx[n]; in cache_rebuild_bmpcache_linked_list()
57 This->cache.bmpcache[id][idx[n]].next = NOT_SET; in cache_rebuild_bmpcache_linked_list()
65 while (--n >= 0 && This->cache.bmpcache[id][idx[n]].bitmap == NULL); in cache_rebuild_bmpcache_linked_list()
70 This->cache.bmpcache[id][n_idx].previous = idx[n]; in cache_rebuild_bmpcache_linked_list()
71 This->cache.bmpcache[id][idx[n]].next = n_idx; in cache_rebuild_bmpcache_linked_list()
76 This->cache.bmpcache[id][n_idx].previous = NOT_SET; in cache_rebuild_bmpcache_linked_list()
77 This->cache.bmpcache_lru[id] = n_idx; in cache_rebuild_bmpcache_linked_list()
79 if (c != This->cache.bmpcache_count[id]) in cache_rebuild_bmpcache_linked_list()
82 This->cache.bmpcache_count[id]); in cache_rebuild_bmpcache_linked_list()
89 cache_bump_bitmap(RDPCLIENT * This, uint8 id, uint16 idx, int bump) in cache_bump_bitmap() argument
93 if (!IS_PERSISTENT(id)) in cache_bump_bitmap()
96 if (This->cache.bmpcache_mru[id] == idx) in cache_bump_bitmap()
99 DEBUG_RDP5(("bump bitmap: id=%d, idx=%d, bump=%d\n", id, idx, bump)); in cache_bump_bitmap()
101 n_idx = This->cache.bmpcache[id][idx].next; in cache_bump_bitmap()
102 p_idx = This->cache.bmpcache[id][idx].previous; in cache_bump_bitmap()
107 --This->cache.bmpcache_count[id]; in cache_bump_bitmap()
109 This->cache.bmpcache[id][p_idx].next = n_idx; in cache_bump_bitmap()
111 This->cache.bmpcache_lru[id] = n_idx; in cache_bump_bitmap()
113 This->cache.bmpcache[id][n_idx].previous = p_idx; in cache_bump_bitmap()
115 This->cache.bmpcache_mru[id] = p_idx; in cache_bump_bitmap()
120 n_idx = This->cache.bmpcache_lru[id]; in cache_bump_bitmap()
128 n_idx = This->cache.bmpcache[id][p_idx].next; in cache_bump_bitmap()
133 p_idx = This->cache.bmpcache_mru[id]; in cache_bump_bitmap()
138 ++This->cache.bmpcache_count[id]; in cache_bump_bitmap()
139 This->cache.bmpcache[id][idx].previous = p_idx; in cache_bump_bitmap()
140 This->cache.bmpcache[id][idx].next = n_idx; in cache_bump_bitmap()
143 This->cache.bmpcache[id][p_idx].next = idx; in cache_bump_bitmap()
145 This->cache.bmpcache_lru[id] = idx; in cache_bump_bitmap()
148 This->cache.bmpcache[id][n_idx].previous = idx; in cache_bump_bitmap()
150 This->cache.bmpcache_mru[id] = idx; in cache_bump_bitmap()
155 cache_evict_bitmap(RDPCLIENT * This, uint8 id) in cache_evict_bitmap() argument
160 if (!IS_PERSISTENT(id)) in cache_evict_bitmap()
163 idx = This->cache.bmpcache_lru[id]; in cache_evict_bitmap()
164 n_idx = This->cache.bmpcache[id][idx].next; in cache_evict_bitmap()
165 DEBUG_RDP5(("evict bitmap: id=%d idx=%d n_idx=%d bmp=0x%x\n", id, idx, n_idx, in cache_evict_bitmap()
166 This->cache.bmpcache[id][idx].bitmap)); in cache_evict_bitmap()
168 ui_destroy_bitmap(This, This->cache.bmpcache[id][idx].bitmap); in cache_evict_bitmap()
169 --This->cache.bmpcache_count[id]; in cache_evict_bitmap()
170 This->cache.bmpcache[id][idx].bitmap = 0; in cache_evict_bitmap()
172 This->cache.bmpcache_lru[id] = n_idx; in cache_evict_bitmap()
173 This->cache.bmpcache[id][n_idx].previous = NOT_SET; in cache_evict_bitmap()
175 pstcache_touch_bitmap(This, id, idx, 0); in cache_evict_bitmap()
180 cache_get_bitmap(RDPCLIENT * This, uint8 id, uint16 idx) in cache_get_bitmap() argument
182 if ((id < NUM_ELEMENTS(This->cache.bmpcache)) && (idx < NUM_ELEMENTS(This->cache.bmpcache[0]))) in cache_get_bitmap()
184 if (This->cache.bmpcache[id][idx].bitmap || pstcache_load_bitmap(This, id, idx)) in cache_get_bitmap()
186 if (IS_PERSISTENT(id)) in cache_get_bitmap()
187 cache_bump_bitmap(This, id, idx, BUMP_COUNT); in cache_get_bitmap()
189 return This->cache.bmpcache[id][idx].bitmap; in cache_get_bitmap()
192 else if ((id < NUM_ELEMENTS(This->cache.volatile_bc)) && (idx == 0x7fff)) in cache_get_bitmap()
194 return This->cache.volatile_bc[id]; in cache_get_bitmap()
197 error("get bitmap %d:%d\n", id, idx); in cache_get_bitmap()
203 cache_put_bitmap(RDPCLIENT * This, uint8 id, uint16 idx, HBITMAP bitmap) in cache_put_bitmap() argument
207 if ((id < NUM_ELEMENTS(This->cache.bmpcache)) && (idx < NUM_ELEMENTS(This->cache.bmpcache[0]))) in cache_put_bitmap()
209 old = This->cache.bmpcache[id][idx].bitmap; in cache_put_bitmap()
212 This->cache.bmpcache[id][idx].bitmap = bitmap; in cache_put_bitmap()
214 if (IS_PERSISTENT(id)) in cache_put_bitmap()
217 This->cache.bmpcache[id][idx].previous = This->cache.bmpcache[id][idx].next = NOT_SET; in cache_put_bitmap()
219 cache_bump_bitmap(This, id, idx, TO_TOP); in cache_put_bitmap()
220 if (This->cache.bmpcache_count[id] > BMPCACHE2_C2_CELLS) in cache_put_bitmap()
221 cache_evict_bitmap(This, id); in cache_put_bitmap()
224 else if ((id < NUM_ELEMENTS(This->cache.volatile_bc)) && (idx == 0x7fff)) in cache_put_bitmap()
226 old = This->cache.volatile_bc[id]; in cache_put_bitmap()
229 This->cache.volatile_bc[id] = bitmap; in cache_put_bitmap()
233 error("put bitmap %d:%d\n", id, idx); in cache_put_bitmap()
241 uint32 id = 0, t = 0; in cache_save_state() local
244 for (id = 0; id < NUM_ELEMENTS(This->cache.bmpcache); id++) in cache_save_state()
245 if (IS_PERSISTENT(id)) in cache_save_state()
247 DEBUG_RDP5(("Saving cache state for bitmap cache %d...", id)); in cache_save_state()
248 idx = This->cache.bmpcache_lru[id]; in cache_save_state()
251 pstcache_touch_bitmap(This, id, idx, ++t); in cache_save_state()
252 idx = This->cache.bmpcache[id][idx].next; in cache_save_state()