Palmer Dabbelt
62effc6bfe
Allow the platform to disable HTIF
9 years ago
Palmer Dabbelt
9037b1d9f2
Add a platform interface
SiFive's pk fork is the second one I've had to maintain, and it's a huge
pain because people keep just leaving changes all over the tree. I want
to introduce an interface that the platform-specific details can live
behind so I don't have to keep doing these painful merges.
9 years ago
Andrew Waterman
57bb80fb7d
Fix emulation of misaligned RVC loads/stores
We were accidentally advancing the PC by 4, not 2.
9 years ago
Andrew Waterman
66701f82f8
FMV.X.S/FMV.S.X -> FMV.X.W/FMV.W.X
9 years ago
Andrew Waterman
5ca090ba6c
Use uint64_t, not uintptr_t, to represent FDT addresses/sizes
This fixes RV32 pk.
9 years ago
Andrew Waterman
770dcd9f1f
Fix RV32 compilation error
9 years ago
Andrew Waterman
5f736b9ab8
Always write sbadaddr on trap redirection
9 years ago
Andrew Waterman
3a3c1f5a1a
Load instructions as unsigned values, not signed
This matches the behavior of mbabaddr/mtval.
9 years ago
Wesley W. Terpstra
8197cad40c
mtrap: allow override of DISABLED_HART_MASK from CFLAGS
9 years ago
Andrew Waterman
a2c8937e63
Remove num_harts; use hart_mask exclusively
9 years ago
Andrew Waterman
dce2b7dd8e
Rename HART_MASK to DISABLED_HART_MASK to clarify polarity
9 years ago
Wesley W. Terpstra
31eab7e4dd
fdt: update the status length when masking cpus
9 years ago
Wesley W. Terpstra
8b4421bacb
bbl: prevent named cores from booting
9 years ago
Wesley W. Terpstra
91636ac463
fdt: redact clint, plic, and debug hardware
9 years ago
Wesley W. Terpstra
cd558016be
fdt: support redaction
9 years ago
Andrew Waterman
d1200e3a54
Remove SBI console printm to speed up PK simulation
9 years ago
Wesley W. Terpstra
733fae9216
clint: move hart wakeup till after all FDT parsing
The clint was wiping out information discovered by the plic.
Initialize hart stacks as they are discovered.
Then fill in clint+plic info
Then wake the harts.
9 years ago
Andrew Waterman
078ea399c6
New PMP encoding
9 years ago
Wesley W. Terpstra
52d46dd684
fdt: look for the phandle of a cpu's nested interrupt controller
9 years ago
Andrew Waterman
6f407a8d54
Attempt to read instruction from mbadaddr
9 years ago
Wesley W. Terpstra
75f1854cd9
plic: discovered via fdt
9 years ago
Wesley W. Terpstra
b394a92597
uart: find it using fdt
9 years ago
Wesley W. Terpstra
cfe60c100d
fdt: rewrite parser using a single design pattern
9 years ago
Wesley W. Terpstra
9fa7b30887
uart: add physical device driver
9 years ago
Andrew Waterman
3473915b3a
Separate page faults from physical memory access exceptions
9 years ago
Wesley W. Terpstra
a1a5cbcacb
fdt: add a size method
9 years ago
Andrew Waterman
fc1af65c15
Set up PMPs, permissively for now
9 years ago
Wesley W. Terpstra
23ab37ad78
SBI: a0+a1 hold hartid+dtb pointer between boot loader stages
9 years ago
Wesley W. Terpstra
316f85e9ae
machine: add FDT parser
9 years ago
Wesley W. Terpstra
db19d0d278
machine: remove configstring
9 years ago
Andrew Waterman
7d60c5904f
Allow PK access to user memory
9 years ago
Andrew Waterman
cfc4554bc6
Simplify interrupt-stack discipline
f2ed45b179
9 years ago
Andrew Waterman
36a5855d44
Don't rely on config string for basic functionality
9 years ago
Andrew Waterman
d203037851
PPNs are 44 bits in RV64
9 years ago
Andrew Waterman
410fb0384f
New counter-enable scheme
https://github.com/riscv/riscv-isa-manual/issues/10
9 years ago
Andrew Waterman
34979b9345
Fix PK boot
9 years ago
Andrew Waterman
f6bca6e35b
Don't block for acks on console writes
9 years ago
Andrew Waterman
59484c94e1
WIP on SBI
9 years ago
Andrew Waterman
66fda264c7
minor HTIF cleanup + use WFI
9 years ago
Andrew Waterman
7c47650298
Handle IPIs and timer interrupts more quickly
9 years ago
Andrew Waterman
926b360655
WIP towards ECALL interface for SBI
9 years ago
Andrew Waterman
611290ccde
Cleanly separate HTIF code; don't poll keyboard on timer interrupt
9 years ago
Andrew Waterman
15a111444d
Emulate RVFC instructions
9 years ago
Andrew Waterman
4678e84c04
Incorporate sptbr/sfence.vma changes
9 years ago
Andrew Waterman
6667bc4c42
Placate gcc7 about buffer sizes
9 years ago
Andrew Waterman
f6b2274af4
avoid non-standard predefined macros
9 years ago
Andrew Waterman
7a71068853
Acquire lock before attempting tohost/fromhost sequences
10 years ago
Andrew Waterman
d5e3e0d86a
Add spinlock_trylock routine; use it to implement spinlock_lock
10 years ago
Andrew Waterman
6c1d0604dc
Use __riscv_flen macro to detect FP support
10 years ago
sashimi-yzh
f892b43a2b
machine, mentry.S: fix not receiving IPI for other harts ( #38 )
* Before waiting for IPI by executing wfi instruction, MSIE bit
should be set in mie CSR for other harts, else they will get
stuck at the wfi instruction.
10 years ago