Is it a normal user-mode instruction?
No. DRET is defined only in D-mode and not when executing from the Program Buffer; it is not a user-mode assembly instruction.
Debug-mode return: PC<-dpc and resume with the dcsr-recorded prv/v state (and pelp where applicable). It is defined only in D-mode and not when executing from the Program Buffer.
DRET is used by the Debug Module to resume normal execution. Its recommended encoding is 0x7b200073; execution restores PC from dpc and resumes normally at the privilege indicated by dcsr.prv and dcsr.v, restoring ELP from pelp where applicable. DRET is defined only in D-mode and not when executing from the Program Buffer; this page does not present undefined contexts as xRET behavior, illegal instructions, or fixed platform behavior.
DRET is a system-level instruction defined by the debug specification. This page covers architectural semantics only, not platform firmware policy.
Understand this scenario with real code like «dret».
Understand this scenario with real code like «dret».
No. DRET is defined only in D-mode and not when executing from the Program Buffer; it is not a user-mode assembly instruction.
PC is restored from dpc; normal execution resumes according to dcsr.prv and dcsr.v, with ELP restored from pelp where applicable. The specification does not define it as the interrupt-enable restoration sequence of mret or sret.