Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/console/kconsole.c

    r4ce914d4 r563d6077  
    4545#include <print.h>
    4646#include <panic.h>
    47 #include <typedefs.h>
     47#include <arch/types.h>
    4848#include <adt/list.h>
    4949#include <arch.h>
     
    5151#include <debug.h>
    5252#include <func.h>
    53 #include <str.h>
     53#include <string.h>
    5454#include <macros.h>
    5555#include <sysinfo/sysinfo.h>
     
    5858#include <errno.h>
    5959#include <putchar.h>
    60 #include <str.h>
     60#include <string.h>
    6161
    6262/** Simple kernel console.
     
    224224                printf("\n");
    225225                pos = NULL;
    226                 while (cmdtab_search_one(name, &pos)) {
     226                while ((hint = cmdtab_search_one(name, &pos))) {
    227227                        cmd_info_t *hlp = list_get_instance(pos, cmd_info_t, link);
    228228                        printf("%s (%s)\n", hlp->name, hlp->description);
     
    455455                        printf("No symbol information available.\n");
    456456                        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);
    469465        } else {
    470466                /* 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);
    489470        }
    490471       
     
    662643 *
    663644 */
    664 void kconsole(const char *prompt, const char *msg, bool kcon)
     645void kconsole(char *prompt, char *msg, bool kcon)
    665646{
    666647        if (!stdin) {
Note: See TracChangeset for help on using the changeset viewer.