Changes in kernel/generic/src/console/kconsole.c [4ce914d4:563d6077] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/console/kconsole.c
r4ce914d4 r563d6077 45 45 #include <print.h> 46 46 #include <panic.h> 47 #include < typedefs.h>47 #include <arch/types.h> 48 48 #include <adt/list.h> 49 49 #include <arch.h> … … 51 51 #include <debug.h> 52 52 #include <func.h> 53 #include <str .h>53 #include <string.h> 54 54 #include <macros.h> 55 55 #include <sysinfo/sysinfo.h> … … 58 58 #include <errno.h> 59 59 #include <putchar.h> 60 #include <str .h>60 #include <string.h> 61 61 62 62 /** Simple kernel console. … … 224 224 printf("\n"); 225 225 pos = NULL; 226 while ( cmdtab_search_one(name, &pos)) {226 while ((hint = cmdtab_search_one(name, &pos))) { 227 227 cmd_info_t *hlp = list_get_instance(pos, cmd_info_t, link); 228 228 printf("%s (%s)\n", hlp->name, hlp->description); … … 455 455 printf("No symbol information available.\n"); 456 456 return false; 457 case EOK: 458 if (isaddr) 459 *result = (unative_t) symaddr; 460 else if (isptr) 461 *result = **((unative_t **) symaddr); 462 else 463 *result = *((unative_t *) symaddr); 464 break; 465 default: 466 printf("Unknown error.\n"); 467 return false; 468 } 457 } 458 459 if (isaddr) 460 *result = (unative_t) symaddr; 461 else if (isptr) 462 *result = **((unative_t **) symaddr); 463 else 464 *result = *((unative_t *) symaddr); 469 465 } else { 470 466 /* It's a number - convert it */ 471 uint64_t value; 472 int rc = str_uint64(text, NULL, 0, true, &value); 473 switch (rc) { 474 case EINVAL: 475 printf("Invalid number.\n"); 476 return false; 477 case EOVERFLOW: 478 printf("Integer overflow.\n"); 479 return false; 480 case EOK: 481 *result = (unative_t) value; 482 if (isptr) 483 *result = *((unative_t *) *result); 484 break; 485 default: 486 printf("Unknown error.\n"); 487 return false; 488 } 467 *result = atoi(text); 468 if (isptr) 469 *result = *((unative_t *) *result); 489 470 } 490 471 … … 662 643 * 663 644 */ 664 void kconsole(c onst char *prompt, constchar *msg, bool kcon)645 void kconsole(char *prompt, char *msg, bool kcon) 665 646 { 666 647 if (!stdin) {
Note:
See TracChangeset
for help on using the changeset viewer.