Commit Graph

9 Commits

Author SHA1 Message Date
Amaan Qureshi
3a7bde03b8 feat(arm): add an ESR register (#2155)
This allows users to read/write from the ARM syndrome value like in
AArch64.
2025-04-12 21:46:37 +08:00
mio
df75effba3 Generate m68k consts 2025-03-10 11:32:14 +08:00
mio
8dcaa33c66 Bump 2.1.3 2025-02-17 20:26:31 +08:00
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
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
mio
3af2775039 Merge branch 'cs_dev' into dev 2023-02-07 10:08:09 +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