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
F92975711: D25183.id72808.diff
Thu, Sep 5, 9:26 PM
Unknown Object (File)
Sun, Sep 1, 6:14 AM
Unknown Object (File)
Sun, Sep 1, 1:15 AM
Unknown Object (File)
Jul 28 2024, 9:35 AM
Unknown Object (File)
May 15 2024, 10:16 AM
Unknown Object (File)
Apr 29 2024, 10:29 PM
Unknown Object (File)
Apr 29 2024, 10:29 PM
Unknown Object (File)
Apr 29 2024, 10:08 PM
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.