Skip to content

Commit

Permalink
Update PMP comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
wyfcyx committed Feb 6, 2022
1 parent 2ce707f commit 9dadb7a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rustsbi-qemu/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,14 +187,14 @@ fn set_pmp() {
// aligned address range {0x1000_0000, 0x2000}
pmpcfg0 |= 0b11011;
let pmpaddr0 = calc_pmpaddr(0x1000_0000, 0x2000);
// pmp region 2: RW, A=NAPOT, address range {0x200_0000, 0x1_0000}, VIRT_CLINT
// pmp region 1: RW, A=NAPOT, address range {0x200_0000, 0x1_0000}, VIRT_CLINT
pmpcfg0 |= 0b11011 << 8;
let pmpaddr1 = calc_pmpaddr(0x200_0000, 0x1_0000);
// pmp region 3: RW, A=NAPOT, address range {0xC00_0000, 0x40_0000}, VIRT_PLIC
// pmp region 2: RW, A=NAPOT, address range {0xC00_0000, 0x40_0000}, VIRT_PLIC
// VIRT_PLIC_SIZE = 0x20_0000 + 0x1000 * harts, thus supports up to 512 harts
pmpcfg0 |= 0b11011 << 16;
let pmpaddr2 = calc_pmpaddr(0xC00_0000, 0x40_0000);
// pmp region 4: RWX, A=NAPOT, address range {0x8000_0000, 0x1000_0000}, VIRT_DRAM
// pmp region 3: RWX, A=NAPOT, address range {0x8000_0000, 0x1000_0000}, VIRT_DRAM
pmpcfg0 |= 0b11111 << 24;
let pmpaddr3 = calc_pmpaddr(0x8000_0000, 0x1000_0000);
unsafe {
Expand Down

0 comments on commit 9dadb7a

Please sign in to comment.