]>
git.proxmox.com Git - rustc.git/blob - library/stdarch/crates/core_arch/src/riscv64/mod.rs
1 //! RISC-V RV64 specific intrinsics
8 /// Loads virtual machine memory by unsigned word integer
10 /// This instruction performs an explicit memory access as though `V=1`;
11 /// i.e., with the address translation and protection, and the endianness, that apply to memory
12 /// accesses in either VS-mode or VU-mode.
14 /// This operation is not available under RV32 base instruction set.
16 /// This function is unsafe for it accesses the virtual supervisor or user via a `HLV.WU`
17 /// instruction which is effectively a dereference to any memory address.
19 pub unsafe fn hlv_wu(src
: *const u32) -> u32 {
21 asm
!(".insn i 0x73, 0x4, {}, {}, 0x681", out(reg
) value
, in(reg
) src
, options(readonly
, nostack
));
25 /// Loads virtual machine memory by double integer
27 /// This instruction performs an explicit memory access as though `V=1`;
28 /// i.e., with the address translation and protection, and the endianness, that apply to memory
29 /// accesses in either VS-mode or VU-mode.
31 /// This operation is not available under RV32 base instruction set.
33 /// This function is unsafe for it accesses the virtual supervisor or user via a `HLV.D`
34 /// instruction which is effectively a dereference to any memory address.
36 pub unsafe fn hlv_d(src
: *const i64) -> i64 {
38 asm
!(".insn i 0x73, 0x4, {}, {}, 0x6C0", out(reg
) value
, in(reg
) src
, options(readonly
, nostack
));
42 /// Stores virtual machine memory by double integer
44 /// This instruction performs an explicit memory access as though `V=1`;
45 /// i.e., with the address translation and protection, and the endianness, that apply to memory
46 /// accesses in either VS-mode or VU-mode.
48 /// This function is unsafe for it accesses the virtual supervisor or user via a `HSV.D`
49 /// instruction which is effectively a dereference to any memory address.
51 pub unsafe fn hsv_d(dst
: *mut i64, src
: i64) {
52 asm
!(".insn r 0x73, 0x4, 0x37, x0, {}, {}", in(reg
) dst
, in(reg
) src
, options(nostack
));