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)
Tue, Nov 26, 7:48 AM
Unknown Object (File)
Tue, Nov 26, 7:05 AM
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
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

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 31555
Build 29156: arc lint + arc unit

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.