Page MenuHomeFreeBSD

riscv: Use SBI shutdown call to implement RB_POWEROFF
ClosedPublic

Authored by jrtc27 on Jun 7 2020, 11:57 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 3, 1:19 AM
Unknown Object (File)
Oct 6 2024, 6:34 PM
Unknown Object (File)
Sep 18 2024, 11:20 PM
Unknown Object (File)
Sep 5 2024, 9:26 PM
Unknown Object (File)
Sep 1 2024, 6:14 AM
Unknown Object (File)
Sep 1 2024, 1:15 AM
Unknown Object (File)
Jul 28 2024, 9:35 AM
Unknown Object (File)
May 15 2024, 10:16 AM
Subscribers

Details

Summary

Currently we only call sbi_shutdown in cpu_reset, which means we reach
"Please press any key to reboot." even when RB_POWEROFF is set, and only
once the user presses a key do we then shutdown. Instead, register a
shutdown_final event handler and make an SBI shutdown call if
RB_POWEROFF is set.

Test Plan

On QEMU, poweroff would previously print "Please press any key to reboot." and
only exit QEMU once a key was pressed, but now causes QEMU to exit immediately.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jrtc27 created this revision.
This revision is now accepted and ready to land.Jun 8 2020, 8:15 AM

looks good.
per style(9) you can insert an empty line if the function has no local variables.

FWIW, we've made that style rule optional, and the rest of this file doesn't use a blank line, so I think it is fine as-is.