mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-17 16:51:33 -04:00
Add optional parameter to syscall reboot/shutdown
Added a optional parameter to tlib::shutdown and tlib::reboot that waits the number of seconds, to enable timed shutdowns/reboots
This commit is contained in:
parent
9a305950a2
commit
f88706d6db
@ -99,7 +99,8 @@ std::expected<size_t> tlib::exec_and_wait(const char* executable, const std::vec
|
||||
return std::move(result);
|
||||
}
|
||||
|
||||
void tlib::reboot(){
|
||||
void tlib::reboot(int delay=0) {
|
||||
tlib::sleep_ms(1000*delay);
|
||||
asm volatile("mov rax, 0x50; int 50"
|
||||
: //No outputs
|
||||
: //No inputs
|
||||
@ -108,7 +109,8 @@ void tlib::reboot(){
|
||||
__builtin_unreachable();
|
||||
}
|
||||
|
||||
void tlib::shutdown(){
|
||||
void tlib::shutdown(int delay=0){
|
||||
tlib::sleep_ms(1000* delay);
|
||||
asm volatile("mov rax, 0x51; int 50"
|
||||
: //No outputs
|
||||
: //No inputs
|
||||
|
Loading…
x
Reference in New Issue
Block a user