Subversion Repositories HelenOS

Rev

Rev 2227 | Rev 2721 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2227 Rev 2275
Line 90... Line 90...
90
    .description = "Reboot.",
90
    .description = "Reboot.",
91
    .func = cmd_reboot,
91
    .func = cmd_reboot,
92
    .argc = 0
92
    .argc = 0
93
};
93
};
94
 
94
 
-
 
95
static int cmd_uptime(cmd_arg_t *argv);
-
 
96
static cmd_info_t uptime_info = {
-
 
97
    .name = "uptime",
-
 
98
    .description = "Print uptime information.",
-
 
99
    .func = cmd_uptime,
-
 
100
    .argc = 0
-
 
101
};
-
 
102
 
95
static int cmd_continue(cmd_arg_t *argv);
103
static int cmd_continue(cmd_arg_t *argv);
96
static cmd_info_t continue_info = {
104
static cmd_info_t continue_info = {
97
    .name = "continue",
105
    .name = "continue",
98
    .description = "Return console back to userspace.",
106
    .description = "Return console back to userspace.",
99
    .func = cmd_continue,
107
    .func = cmd_continue,
Line 437... Line 445...
437
    &continue_info,
445
    &continue_info,
438
    &cpus_info,
446
    &cpus_info,
439
    &desc_info,
447
    &desc_info,
440
    &exit_info,
448
    &exit_info,
441
    &reboot_info,
449
    &reboot_info,
-
 
450
    &uptime_info,
442
    &halt_info,
451
    &halt_info,
443
    &help_info,
452
    &help_info,
444
    &ipc_task_info,
453
    &ipc_task_info,
445
    &set4_info,
454
    &set4_info,
446
    &slabs_info,
455
    &slabs_info,
Line 527... Line 536...
527
   
536
   
528
    /* Not reached */
537
    /* Not reached */
529
    return 1;
538
    return 1;
530
}
539
}
531
 
540
 
-
 
541
 
-
 
542
/** Print system uptime information.
-
 
543
 *
-
 
544
 * @param argv Argument vector.
-
 
545
 *
-
 
546
 * @return 0 on failure, 1 on success.
-
 
547
 */
-
 
548
int cmd_uptime(cmd_arg_t *argv)
-
 
549
{
-
 
550
    ASSERT(uptime);
-
 
551
   
-
 
552
    /* This doesn't have to be very accurate */
-
 
553
    unative_t sec = uptime->seconds1;
-
 
554
   
-
 
555
    printf("Up %u days, %u hours, %u minutes, %u seconds\n",
-
 
556
        sec / 86400, (sec % 86400) / 3600, (sec % 3600) / 60, sec % 60);
-
 
557
   
-
 
558
    return 1;
-
 
559
}
-
 
560
 
532
/** Describe specified command.
561
/** Describe specified command.
533
 *
562
 *
534
 * @param argv Argument vector.
563
 * @param argv Argument vector.
535
 *
564
 *
536
 * @return 0 on failure, 1 on success.
565
 * @return 0 on failure, 1 on success.