Changeset f35749e in mainline for uspace/srv/system/system.c
- Timestamp:
- 2025-02-28T23:38:26Z (4 days ago)
- Branches:
- master
- Children:
- 8300c72
- Parents:
- 4285f384
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/system/system.c
r4285f384 rf35749e 48 48 #include <str.h> 49 49 #include <loc.h> 50 #include <shutdown.h> 50 51 #include <str_error.h> 51 52 #include <config.h> … … 84 85 85 86 static void system_srv_conn(ipc_call_t *, void *); 86 static errno_t system_srv_shutdown(void *); 87 static errno_t system_srv_poweroff(void *); 88 static errno_t system_srv_restart(void *); 87 89 88 90 system_ops_t system_srv_ops = { 89 .shutdown = system_srv_shutdown 91 .poweroff = system_srv_poweroff, 92 .restart = system_srv_restart 90 93 }; 91 94 … … 609 612 } 610 613 611 /** System shutdownrequest.614 /** System poweroff request. 612 615 * 613 616 * @param arg Argument (sys_srv_t *) 614 617 */ 615 static errno_t system_srv_ shutdown(void *arg)618 static errno_t system_srv_poweroff(void *arg) 616 619 { 617 620 sys_srv_t *syssrv = (sys_srv_t *)arg; 618 621 errno_t rc; 619 622 620 log_msg(LOG_DEFAULT, LVL_NOTE, "system_srv_ shutdown");623 log_msg(LOG_DEFAULT, LVL_NOTE, "system_srv_poweroff"); 621 624 622 625 rc = system_sys_shutdown(); 623 626 if (rc != EOK) { 624 log_msg(LOG_DEFAULT, LVL_NOTE, "system_srv_ shutdownfailed");627 log_msg(LOG_DEFAULT, LVL_NOTE, "system_srv_poweroff failed"); 625 628 system_srv_shutdown_failed(&syssrv->srv); 626 629 } 627 630 628 log_msg(LOG_DEFAULT, LVL_NOTE, "system_srv_shutdown complete"); 631 log_msg(LOG_DEFAULT, LVL_NOTE, "system_srv_poweroff complete"); 632 system_srv_shutdown_complete(&syssrv->srv); 633 return EOK; 634 } 635 636 /** System restart request. 637 * 638 * @param arg Argument (sys_srv_t *) 639 */ 640 static errno_t system_srv_restart(void *arg) 641 { 642 sys_srv_t *syssrv = (sys_srv_t *)arg; 643 errno_t rc; 644 645 log_msg(LOG_DEFAULT, LVL_NOTE, "system_srv_restart"); 646 647 rc = system_sys_shutdown(); 648 if (rc != EOK) { 649 log_msg(LOG_DEFAULT, LVL_NOTE, "system_srv_restart failed"); 650 system_srv_shutdown_failed(&syssrv->srv); 651 } 652 653 sys_reboot(); 654 655 log_msg(LOG_DEFAULT, LVL_NOTE, "system_srv_restart complete"); 629 656 system_srv_shutdown_complete(&syssrv->srv); 630 657 return EOK;
Note:
See TracChangeset
for help on using the changeset viewer.