Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc64/src/mm/sun4u/tlb.c

    r560b81c r59fb782  
    194194
    195195/** ITLB miss handler. */
    196 void fast_instruction_access_mmu_miss(unsigned int tt, istate_t *istate)
     196void fast_instruction_access_mmu_miss(sysarg_t unused, istate_t *istate)
    197197{
    198198        size_t index = (istate->tpc >> MMU_PAGE_WIDTH) % MMU_PAGES_PER_PAGE;
    199         pte_t t;
    200 
    201         bool found = page_mapping_find(AS, istate->tpc, true, &t);
    202         if (found && PTE_EXECUTABLE(&t)) {
    203                 ASSERT(t.p);
    204 
     199        pte_t *t;
     200
     201        t = page_mapping_find(AS, istate->tpc, true);
     202        if (t && PTE_EXECUTABLE(t)) {
    205203                /*
    206204                 * The mapping was found in the software page hash table.
    207205                 * Insert it into ITLB.
    208206                 */
    209                 t.a = true;
    210                 itlb_pte_copy(&t, index);
     207                t->a = true;
     208                itlb_pte_copy(t, index);
    211209#ifdef CONFIG_TSB
    212                 itsb_pte_copy(&t, index);
    213 #endif
    214                 page_mapping_update(AS, istate->tpc, true, &t);
     210                itsb_pte_copy(t, index);
     211#endif
    215212        } else {
    216213                /*
     
    227224 * low-level, assembly language part of the fast_data_access_mmu_miss handler.
    228225 *
    229  * @param tt            Trap type.
     226 * @param tag           Content of the TLB Tag Access register as it existed
     227 *                      when the trap happened. This is to prevent confusion
     228 *                      created by clobbered Tag Access register during a nested
     229 *                      DTLB miss.
    230230 * @param istate        Interrupted state saved on the stack.
    231231 */
    232 void fast_data_access_mmu_miss(unsigned int tt, istate_t *istate)
    233 {
    234         tlb_tag_access_reg_t tag;
     232void fast_data_access_mmu_miss(tlb_tag_access_reg_t tag, istate_t *istate)
     233{
    235234        uintptr_t page_8k;
    236235        uintptr_t page_16k;
    237236        size_t index;
    238         pte_t t;
     237        pte_t *t;
    239238        as_t *as = AS;
    240239
    241         tag.value = istate->tlb_tag_access;
    242240        page_8k = (uint64_t) tag.vpn << MMU_PAGE_WIDTH;
    243241        page_16k = ALIGN_DOWN(page_8k, PAGE_SIZE);
     
    256254        }
    257255
    258         bool found = page_mapping_find(as, page_16k, true, &t);
    259         if (found) {
    260                 ASSERT(t.p);
    261 
     256        t = page_mapping_find(as, page_16k, true);
     257        if (t) {
    262258                /*
    263259                 * The mapping was found in the software page hash table.
    264260                 * Insert it into DTLB.
    265261                 */
    266                 t.a = true;
    267                 dtlb_pte_copy(&t, index, true);
     262                t->a = true;
     263                dtlb_pte_copy(t, index, true);
    268264#ifdef CONFIG_TSB
    269                 dtsb_pte_copy(&t, index, true);
    270 #endif
    271                 page_mapping_update(as, page_16k, true, &t);
     265                dtsb_pte_copy(t, index, true);
     266#endif
    272267        } else {
    273268                /*
     
    281276/** DTLB protection fault handler.
    282277 *
    283  * @param tt            Trap type.
     278 * @param tag           Content of the TLB Tag Access register as it existed
     279 *                      when the trap happened. This is to prevent confusion
     280 *                      created by clobbered Tag Access register during a nested
     281 *                      DTLB miss.
    284282 * @param istate        Interrupted state saved on the stack.
    285283 */
    286 void fast_data_access_protection(unsigned int tt, istate_t *istate)
    287 {
    288         tlb_tag_access_reg_t tag;
     284void fast_data_access_protection(tlb_tag_access_reg_t tag, istate_t *istate)
     285{
    289286        uintptr_t page_16k;
    290287        size_t index;
    291         pte_t t;
     288        pte_t *t;
    292289        as_t *as = AS;
    293290
    294         tag.value = istate->tlb_tag_access;
    295291        page_16k = ALIGN_DOWN((uint64_t) tag.vpn << MMU_PAGE_WIDTH, PAGE_SIZE);
    296292        index = tag.vpn % MMU_PAGES_PER_PAGE;   /* 16K-page emulation */
     
    299295                as = AS_KERNEL;
    300296
    301         bool found = page_mapping_find(as, page_16k, true, &t);
    302         if (found && PTE_WRITABLE(&t)) {
    303                 ASSERT(t.p);
    304 
     297        t = page_mapping_find(as, page_16k, true);
     298        if (t && PTE_WRITABLE(t)) {
    305299                /*
    306300                 * The mapping was found in the software page hash table and is
     
    308302                 * into DTLB.
    309303                 */
    310                 t.a = true;
    311                 t.d = true;
     304                t->a = true;
     305                t->d = true;
    312306                dtlb_demap(TLB_DEMAP_PAGE, TLB_DEMAP_SECONDARY,
    313307                    page_16k + index * MMU_PAGE_SIZE);
    314                 dtlb_pte_copy(&t, index, false);
     308                dtlb_pte_copy(t, index, false);
    315309#ifdef CONFIG_TSB
    316                 dtsb_pte_copy(&t, index, false);
    317 #endif
    318                 page_mapping_update(as, page_16k, true, &t);
     310                dtsb_pte_copy(t, index, false);
     311#endif
    319312        } else {
    320313                /*
Note: See TracChangeset for help on using the changeset viewer.