Ignore:
File:
1 edited

Legend:

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

    rd70ebffe r560b81c  
    197197{
    198198        size_t index = (istate->tpc >> MMU_PAGE_WIDTH) % MMU_PAGES_PER_PAGE;
    199         pte_t *t;
    200 
    201         t = page_mapping_find(AS, istate->tpc, true);
    202         if (t && PTE_EXECUTABLE(t)) {
     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
    203205                /*
    204206                 * The mapping was found in the software page hash table.
    205207                 * Insert it into ITLB.
    206208                 */
    207                 t->a = true;
    208                 itlb_pte_copy(t, index);
     209                t.a = true;
     210                itlb_pte_copy(&t, index);
    209211#ifdef CONFIG_TSB
    210                 itsb_pte_copy(t, index);
    211 #endif
     212                itsb_pte_copy(&t, index);
     213#endif
     214                page_mapping_update(AS, istate->tpc, true, &t);
    212215        } else {
    213216                /*
     
    233236        uintptr_t page_16k;
    234237        size_t index;
    235         pte_t *t;
     238        pte_t t;
    236239        as_t *as = AS;
    237240
     
    253256        }
    254257
    255         t = page_mapping_find(as, page_16k, true);
    256         if (t) {
     258        bool found = page_mapping_find(as, page_16k, true, &t);
     259        if (found) {
     260                ASSERT(t.p);
     261
    257262                /*
    258263                 * The mapping was found in the software page hash table.
    259264                 * Insert it into DTLB.
    260265                 */
    261                 t->a = true;
    262                 dtlb_pte_copy(t, index, true);
     266                t.a = true;
     267                dtlb_pte_copy(&t, index, true);
    263268#ifdef CONFIG_TSB
    264                 dtsb_pte_copy(t, index, true);
    265 #endif
     269                dtsb_pte_copy(&t, index, true);
     270#endif
     271                page_mapping_update(as, page_16k, true, &t);
    266272        } else {
    267273                /*
     
    283289        uintptr_t page_16k;
    284290        size_t index;
    285         pte_t *t;
     291        pte_t t;
    286292        as_t *as = AS;
    287293
     
    293299                as = AS_KERNEL;
    294300
    295         t = page_mapping_find(as, page_16k, true);
    296         if (t && PTE_WRITABLE(t)) {
     301        bool found = page_mapping_find(as, page_16k, true, &t);
     302        if (found && PTE_WRITABLE(&t)) {
     303                ASSERT(t.p);
     304
    297305                /*
    298306                 * The mapping was found in the software page hash table and is
     
    300308                 * into DTLB.
    301309                 */
    302                 t->a = true;
    303                 t->d = true;
     310                t.a = true;
     311                t.d = true;
    304312                dtlb_demap(TLB_DEMAP_PAGE, TLB_DEMAP_SECONDARY,
    305313                    page_16k + index * MMU_PAGE_SIZE);
    306                 dtlb_pte_copy(t, index, false);
     314                dtlb_pte_copy(&t, index, false);
    307315#ifdef CONFIG_TSB
    308                 dtsb_pte_copy(t, index, false);
    309 #endif
     316                dtsb_pte_copy(&t, index, false);
     317#endif
     318                page_mapping_update(as, page_16k, true, &t);
    310319        } else {
    311320                /*
Note: See TracChangeset for help on using the changeset viewer.