Changes in uspace/srv/system/system.c [77a0119:4285f384] in mainline
- File:
-
- 1 edited
-
uspace/srv/system/system.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/system/system.c
r77a0119 r4285f384 35 35 */ 36 36 37 #include <devman.h>38 37 #include <fibril.h> 39 38 #include <futil.h> … … 49 48 #include <str.h> 50 49 #include <loc.h> 51 #include <shutdown.h>52 50 #include <str_error.h> 53 51 #include <config.h> … … 86 84 87 85 static void system_srv_conn(ipc_call_t *, void *); 88 static errno_t system_srv_poweroff(void *); 89 static errno_t system_srv_restart(void *); 86 static errno_t system_srv_shutdown(void *); 90 87 91 88 system_ops_t system_srv_ops = { 92 .poweroff = system_srv_poweroff, 93 .restart = system_srv_restart 89 .shutdown = system_srv_shutdown 94 90 }; 95 91 … … 523 519 /* Eject all volumes. */ 524 520 525 log_msg(LOG_DEFAULT, LVL_NOTE, "Ejecting volumes.");526 527 521 rc = vol_create(&vol); 528 522 if (rc != EOK) { … … 549 543 free(part_ids); 550 544 vol_destroy(vol); 551 552 545 return EOK; 553 546 error: … … 616 609 } 617 610 618 /** System poweroffrequest.611 /** System shutdown request. 619 612 * 620 613 * @param arg Argument (sys_srv_t *) 621 614 */ 622 static errno_t system_srv_ poweroff(void *arg)615 static errno_t system_srv_shutdown(void *arg) 623 616 { 624 617 sys_srv_t *syssrv = (sys_srv_t *)arg; 625 618 errno_t rc; 626 619 627 log_msg(LOG_DEFAULT, LVL_NOTE, "system_srv_ poweroff");620 log_msg(LOG_DEFAULT, LVL_NOTE, "system_srv_shutdown"); 628 621 629 622 rc = system_sys_shutdown(); 630 623 if (rc != EOK) { 631 log_msg(LOG_DEFAULT, LVL_NOTE, "system_srv_ powerofffailed");624 log_msg(LOG_DEFAULT, LVL_NOTE, "system_srv_shutdown failed"); 632 625 system_srv_shutdown_failed(&syssrv->srv); 633 626 } 634 627 635 log_msg(LOG_DEFAULT, LVL_NOTE, "system_srv_poweroff complete"); 636 system_srv_shutdown_complete(&syssrv->srv); 637 return EOK; 638 } 639 640 /** System restart request. 641 * 642 * @param arg Argument (sys_srv_t *) 643 */ 644 static errno_t system_srv_restart(void *arg) 645 { 646 sys_srv_t *syssrv = (sys_srv_t *)arg; 647 errno_t rc; 648 649 log_msg(LOG_DEFAULT, LVL_NOTE, "system_srv_restart"); 650 651 rc = system_sys_shutdown(); 652 if (rc != EOK) { 653 log_msg(LOG_DEFAULT, LVL_NOTE, "system_srv_restart failed"); 654 system_srv_shutdown_failed(&syssrv->srv); 655 } 656 657 /* Quiesce the device tree. */ 658 659 log_msg(LOG_DEFAULT, LVL_NOTE, "Quiescing devices."); 660 661 rc = devman_quiesce_devices("/hw"); 662 if (rc != EOK) { 663 log_msg(LOG_DEFAULT, LVL_ERROR, 664 "Failed to quiesce device tree."); 665 return rc; 666 } 667 668 sys_reboot(); 669 670 log_msg(LOG_DEFAULT, LVL_NOTE, "system_srv_restart complete"); 628 log_msg(LOG_DEFAULT, LVL_NOTE, "system_srv_shutdown complete"); 671 629 system_srv_shutdown_complete(&syssrv->srv); 672 630 return EOK;
Note:
See TracChangeset
for help on using the changeset viewer.
