Rev 534 | Rev 548 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 534 | Rev 544 | ||
---|---|---|---|
Line 83... | Line 83... | ||
83 | .type = ARG_TYPE_STRING, |
83 | .type = ARG_TYPE_STRING, |
84 | .buffer = desc_buf, |
84 | .buffer = desc_buf, |
85 | .len = sizeof(desc_buf) |
85 | .len = sizeof(desc_buf) |
86 | }; |
86 | }; |
87 | 87 | ||
- | 88 | /** Data and methods for 'halt' command. */ |
|
- | 89 | static int cmd_halt(cmd_arg_t *argv); |
|
- | 90 | static cmd_info_t halt_info; |
|
- | 91 | ||
88 | /** Initialize kconsole data structures. */ |
92 | /** Initialize kconsole data structures. */ |
89 | void kconsole_init(void) |
93 | void kconsole_init(void) |
90 | { |
94 | { |
91 | spinlock_initialize(&cmd_lock); |
95 | spinlock_initialize(&cmd_lock); |
92 | list_initialize(&cmd_head); |
96 | list_initialize(&cmd_head); |
Line 115... | Line 119... | ||
115 | spinlock_initialize(&desc_info.lock); |
119 | spinlock_initialize(&desc_info.lock); |
116 | link_initialize(&desc_info.link); |
120 | link_initialize(&desc_info.link); |
117 | 121 | ||
118 | if (!cmd_register(&desc_info)) |
122 | if (!cmd_register(&desc_info)) |
119 | panic("could not register command %s\n", desc_info.name); |
123 | panic("could not register command %s\n", desc_info.name); |
- | 124 | ||
- | 125 | ||
- | 126 | halt_info.name = "halt"; |
|
- | 127 | halt_info.description = "Halt the kernel."; |
|
- | 128 | halt_info.func = cmd_halt; |
|
- | 129 | halt_info.help = NULL; |
|
- | 130 | halt_info.argc = 0; |
|
- | 131 | halt_info.argv = NULL; |
|
- | 132 | ||
- | 133 | spinlock_initialize(&halt_info.lock); |
|
- | 134 | link_initialize(&halt_info.link); |
|
- | 135 | ||
- | 136 | if (!cmd_register(&halt_info)) |
|
- | 137 | panic("could not register command %s\n", halt_info.name); |
|
120 | } |
138 | } |
121 | 139 | ||
122 | 140 | ||
123 | /** Register kconsole command. |
141 | /** Register kconsole command. |
124 | * |
142 | * |
Line 405... | Line 423... | ||
405 | interrupts_restore(ipl); |
423 | interrupts_restore(ipl); |
406 | 424 | ||
407 | return 1; |
425 | return 1; |
408 | } |
426 | } |
409 | 427 | ||
- | 428 | /** Halt the kernel. |
|
- | 429 | * |
|
- | 430 | * @param argv Argument vector. |
|
- | 431 | * |
|
- | 432 | * @return 0 on failure, 1 on success. |
|
- | 433 | */ |
|
- | 434 | int cmd_halt(cmd_arg_t *argv) |
|
- | 435 | { |
|
- | 436 | halt(); |
|
- | 437 | return 1; |
|
- | 438 | } |
|
- | 439 | ||
410 | /** Print detailed description of 'describe' command. */ |
440 | /** Print detailed description of 'describe' command. */ |
411 | void desc_help(void) |
441 | void desc_help(void) |
412 | { |
442 | { |
413 | printf("Syntax: describe command_name\n"); |
443 | printf("Syntax: describe command_name\n"); |
414 | } |
444 | } |