From: Andrew Waterman Date: Tue, 1 Nov 2011 22:32:49 +0000 (-0700) Subject: Fixed tight coupling of host and target page size X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=069c07f440ac207a3bbe71f79c2834a9f0b919e5;p=riscv-isa-sim.git Fixed tight coupling of host and target page size --- diff --git a/riscv/mmu.cc b/riscv/mmu.cc index b2c8c98..489aeee 100644 --- a/riscv/mmu.cc +++ b/riscv/mmu.cc @@ -53,7 +53,7 @@ void* mmu_t::refill(reg_t addr, bool store, bool fetch) tlb_insn_tag[idx] = (pte_perm & PTE_UX) ? expected_tag : -1; tlb_data[idx] = (long)(pte >> PTE_PPN_SHIFT << PGSHIFT) + (long)mem; - return (void*)(((long)addr & (PGSIZE-1)) | tlb_data[idx]); + return (void*)(((long)addr & (PGSIZE-1)) + tlb_data[idx]); } pte_t mmu_t::walk(reg_t addr) diff --git a/riscv/mmu.h b/riscv/mmu.h index d9a1ce3..9d648ef 100644 --- a/riscv/mmu.h +++ b/riscv/mmu.h @@ -179,7 +179,7 @@ private: reg_t* tlb_tag = fetch ? tlb_insn_tag : store ? tlb_store_tag :tlb_load_tag; reg_t expected_tag = addr & ~(PGSIZE-1); if(likely(tlb_tag[idx] == expected_tag)) - return (void*)(((long)addr & (PGSIZE-1)) | tlb_data[idx]); + return (void*)(((long)addr & (PGSIZE-1)) + tlb_data[idx]); return refill(addr, store, fetch); }