cputlb.c (71ccd47ba5509f36a3dee54fe009529b67ccbd7c) cputlb.c (5c948e3175e87620f5330e18873e1f8190f10ec0)
1/*
2 * Common CPU TLB handling
3 *
4 * Copyright (c) 2003 Fabrice Bellard
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either

--- 216 unchanged lines hidden (view full) ---

225 g_free(desc->iotlb);
226 fast->table = g_try_new(CPUTLBEntry, new_size);
227 desc->iotlb = g_try_new(CPUIOTLBEntry, new_size);
228 }
229}
230
231static void tlb_flush_one_mmuidx_locked(CPUArchState *env, int mmu_idx)
232{
1/*
2 * Common CPU TLB handling
3 *
4 * Copyright (c) 2003 Fabrice Bellard
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either

--- 216 unchanged lines hidden (view full) ---

225 g_free(desc->iotlb);
226 fast->table = g_try_new(CPUTLBEntry, new_size);
227 desc->iotlb = g_try_new(CPUIOTLBEntry, new_size);
228 }
229}
230
231static void tlb_flush_one_mmuidx_locked(CPUArchState *env, int mmu_idx)
232{
233 tlb_mmu_resize_locked(&env_tlb(env)->d[mmu_idx], &env_tlb(env)->f[mmu_idx]);
234 env_tlb(env)->d[mmu_idx].n_used_entries = 0;
235 env_tlb(env)->d[mmu_idx].large_page_addr = -1;
236 env_tlb(env)->d[mmu_idx].large_page_mask = -1;
237 env_tlb(env)->d[mmu_idx].vindex = 0;
238 memset(env_tlb(env)->f[mmu_idx].table, -1,
239 sizeof_tlb(&env_tlb(env)->f[mmu_idx]));
240 memset(env_tlb(env)->d[mmu_idx].vtable, -1,
241 sizeof(env_tlb(env)->d[0].vtable));
233 CPUTLBDesc *desc = &env_tlb(env)->d[mmu_idx];
234 CPUTLBDescFast *fast = &env_tlb(env)->f[mmu_idx];
235
236 tlb_mmu_resize_locked(desc, fast);
237 desc->n_used_entries = 0;
238 desc->large_page_addr = -1;
239 desc->large_page_mask = -1;
240 desc->vindex = 0;
241 memset(fast->table, -1, sizeof_tlb(fast));
242 memset(desc->vtable, -1, sizeof(desc->vtable));
242}
243
244static inline void tlb_n_used_entries_inc(CPUArchState *env, uintptr_t mmu_idx)
245{
246 env_tlb(env)->d[mmu_idx].n_used_entries++;
247}
248
249static inline void tlb_n_used_entries_dec(CPUArchState *env, uintptr_t mmu_idx)

--- 2030 unchanged lines hidden ---
243}
244
245static inline void tlb_n_used_entries_inc(CPUArchState *env, uintptr_t mmu_idx)
246{
247 env_tlb(env)->d[mmu_idx].n_used_entries++;
248}
249
250static inline void tlb_n_used_entries_dec(CPUArchState *env, uintptr_t mmu_idx)

--- 2030 unchanged lines hidden ---