/* Updates the persistent bitmap cache MRU information on exit */ void cache_save_state(void) { uint32 id = 0, t = 0; int idx; for (id = 0; id < NUM_ELEMENTS(g_bmpcache); id++) if (IS_PERSISTENT(id)) { DEBUG_RDP5(("Saving cache state for bitmap cache %d...", id)); idx = g_bmpcache_lru[id]; while (idx >= 0) { pstcache_touch_bitmap((uint8) id, (uint16) idx, ++t); idx = g_bmpcache[id][idx].next; } DEBUG_RDP5((" %d stamps written.\n", t)); } }
/* Updates the persistent bitmap cache MRU information on exit */ void cache_save_state(rdcConnection conn) { uint32 id = 0, t = 0; int idx; for (id = 0; id < NUM_ELEMENTS(conn->bmpcache); id++) if (IS_PERSISTENT(id)) { DEBUG_RDP5(("Saving cache state for bitmap cache %d...", id)); idx = conn->bmpcacheLru[id]; while (idx >= 0) { pstcache_touch_bitmap(conn, id, idx, ++t); idx = conn->bmpcache[id][idx].next; } DEBUG_RDP5((" %d stamps written.\n", t)); } }
/* Evict the least-recently used bitmap from the cache */ void cache_evict_bitmap(uint8 id) { uint16 idx; int n_idx; if (!IS_PERSISTENT(id)) return; idx = g_bmpcache_lru[id]; n_idx = g_bmpcache[id][idx].next; DEBUG_RDP5(("evict bitmap: id=%d idx=%d n_idx=%d bmp=0x%x\n", id, idx, n_idx, g_bmpcache[id][idx].bitmap)); ui_destroy_bitmap(g_bmpcache[id][idx].bitmap); --g_bmpcache_count[id]; g_bmpcache[id][idx].bitmap = 0; g_bmpcache_lru[id] = n_idx; g_bmpcache[id][n_idx].previous = NOT_SET; pstcache_touch_bitmap(id, idx, 0); }
/* Evict the least-recently used bitmap from the cache */ static void cache_evict_bitmap(rdcConnection conn, uint8 id) { uint16 idx; int n_idx; if (!IS_PERSISTENT(id)) return; idx = conn->bmpcacheLru[id]; n_idx = conn->bmpcache[id][idx].next; DEBUG_RDP5(("evict bitmap: id=%d idx=%d n_idx=%d bmp=0x%x\n", id, idx, n_idx, conn->bmpcache[id][idx].bitmap)); ui_destroy_bitmap(conn->bmpcache[id][idx].bitmap); --conn->bmpcacheCount[id]; conn->bmpcache[id][idx].bitmap = 0; conn->bmpcacheLru[id] = n_idx; conn->bmpcache[id][n_idx].previous = NOT_SET; pstcache_touch_bitmap(conn, id, idx, 0); }
/* Evict the least-recently used bitmap from the cache */ void cache_evict_bitmap(RDPCLIENT * This, uint8 id) { uint16 idx; int n_idx; if (!IS_PERSISTENT(id)) return; idx = This->cache.bmpcache_lru[id]; n_idx = This->cache.bmpcache[id][idx].next; DEBUG_RDP5(("evict bitmap: id=%d idx=%d n_idx=%d bmp=0x%x\n", id, idx, n_idx, This->cache.bmpcache[id][idx].bitmap)); ui_destroy_bitmap(This, This->cache.bmpcache[id][idx].bitmap); --This->cache.bmpcache_count[id]; This->cache.bmpcache[id][idx].bitmap = 0; This->cache.bmpcache_lru[id] = n_idx; This->cache.bmpcache[id][n_idx].previous = NOT_SET; pstcache_touch_bitmap(This, id, idx, 0); }