Commit Graph

12 Commits

Author SHA1 Message Date
mio
b8e19b6eef CI(release): Bump 2.1.2 2025-02-10 22:11:12 +08:00
Martin Atkins
7d8fe2ab11 riscv: Expose privilege level as pseudo-register PRIV (#1989)
Unlike some other architectures, RISC-V does not expose the current
privilege mode in any architecturally-defined register. That is intentional
to make it easier to implement virtualization in software, but a Unicorn
caller operates outside of the emulated hart and so it can and should be
able to observe and change the current privilege mode in order to properly
emulate certain behaviors of a real CPU.

The current privilege level is therefore now exposed as a new
pseudo-register using the name "priv", which matches the name of the
virtual register used by RISC-V's debug extension to allow the debugger
to read and change the privilege mode while the hart is halted. Unicorn's
use of it is conceptually similar to a debugger.

The bit encoding of this register is the same as specified in RISC-V Debug
Specification v1.0-rc3 Section 4.10.1. It's defined as a "virtual"
register exposing a subset of fields from the dcsr register, although here
it's implemented directly inside the Unicorn code because QEMU doesn't
currently have explicit support for the CSRs from the debug specification.
If it supports "dcsr" in a future release then this implementation could
change to wrap reading and writing that CSR and then projecting the "prv"
and "v" bitfields into the correct locations for the virtual register.
2024-11-11 21:09:45 +08:00
mio
867770c7ef Tag and release 2.1.1 2024-09-26 18:44:51 +08:00
mio
67f08b1c27 Bump version and generate bindings 2024-09-21 23:00:57 +08:00
Mio
9c01d23ed3 Update bindings const 2023-03-28 14:20:55 +02:00
Choongwoo Han
b4b6caf57c [dotnet] Support HookDel with native bindings call 2023-03-11 08:51:01 -08:00
Choongwoo Han
03a793e934 [dotnet] Fix garbage collected hooks and wrong signature 2023-02-28 19:35:38 -08:00
Choongwoo Han
b961ebc9cb [dotnet] Set begin > end address for hooks 2023-02-26 08:41:01 -08:00
mio
9c9356da6c Bump to 2.0.2-rc1 for csharp 2023-02-07 10:40:30 +01:00
mio
3af2775039 Merge branch 'cs_dev' into dev 2023-02-07 10:08:09 +01:00
TSR Berry
2e6a888052 dotnet: Add native unicorn libraries to nuget package 2022-11-05 02:40:50 +01:00
TSR Berry
1d12e8778b bindings: Rename dotnet project to UnicornEngine
Add a few more properties to prepare a nuget package
2022-11-02 14:46:08 +01:00