mstatus
RISC-V's machine-mode status register, home of the global interrupt switch and the memory of which mode the core came from.
The three fields firmware touches most are MIE (bit 3), which enables or disables all M-mode interrupts; MPIE, which holds the previous value of MIE across a trap; and MPP, two bits recording the privilege level before the trap. Taking a trap copies MIE into MPIE and clears MIE, so handlers start with interrupts off; mret does the reverse.
A critical section on RISC-V is therefore often nothing more than csrrci mstatus, 8 on the way in and csrsi on the way out. The register also carries the FPU state field (FS), which lets an RTOS skip saving floating-point registers for tasks that never touched them.