Changeset 76fca31 in mainline for kernel/generic/src/console/kconsole.c
- Timestamp:
- 2008-12-16T19:02:07Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5ae4443
- Parents:
- 8fe5980
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/console/kconsole.c
r8fe5980 r76fca31 402 402 } 403 403 404 /** Kernel console managing thread.404 /** Kernel console prompt. 405 405 * 406 406 * @param prompt Kernel console prompt (e.g kconsole/panic). 407 */ 408 void kconsole(void *prompt) 407 * @param msg Message to display in the beginning. 408 * @param kcon Wait for keypress to show the prompt 409 * and never exit. 410 * 411 */ 412 void kconsole(char *prompt, char *msg, bool kcon) 409 413 { 410 414 cmd_info_t *cmd_info; … … 413 417 414 418 if (!stdin) { 415 printf("%s: no stdin\n", __func__);419 LOG("No stdin for kernel console"); 416 420 return; 417 421 } 422 423 if (msg) 424 printf("%s", msg); 425 426 if (kcon) 427 _getc(stdin); 418 428 419 429 while (true) { … … 422 432 if (!len) 423 433 continue; 434 424 435 cmd_info = parse_cmdline(cmdline, len); 425 436 if (!cmd_info) 426 437 continue; 427 if (strncmp(cmd_info->name, "exit", 428 min(strlen(cmd_info->name), 5)) == 0) 438 439 if ((!kcon) 440 && (strncmp(cmd_info->name, "exit", min(strlen(cmd_info->name), 5)) == 0)) 429 441 break; 442 430 443 (void) cmd_info->func(cmd_info->argv); 431 444 } 445 } 446 447 /** Kernel console managing thread. 448 * 449 */ 450 void kconsole_thread(void *data) 451 { 452 kconsole("kconsole", "Kernel console ready (press any key to activate)\n", true); 432 453 } 433 454
Note:
See TracChangeset
for help on using the changeset viewer.