Skip to content

Commit

Permalink
Workaround to allow UART I/O
Browse files Browse the repository at this point in the history
  • Loading branch information
lupyuen committed Mar 12, 2024
1 parent c0e6322 commit 18e8de5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions riscv_cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,13 @@ static int get_phys_addr(RISCVCPUState *s,
target_ulong *ppaddr, target_ulong vaddr,
int access)
{
//// Begin Test: Support Global PTE
// TODO: Allow UART I/O only for Supervisor Mode
if (vaddr >= 0x30000000 && vaddr < 0x40000000) {
*ppaddr = vaddr;
return 0;
}
//// End Test: Support Global PTE
int mode, levels, pte_bits, pte_idx, pte_mask, pte_size_log2, xwr, priv;
int need_write, vaddr_shift, i, pte_addr_bits;
target_ulong pte_addr, pte, vaddr_mask, paddr;
Expand Down

0 comments on commit 18e8de5

Please sign in to comment.