Ignore:
Timestamp:
2010-05-21T07:50:04Z (16 years ago)
Author:
Lenka Trochtova <trochtova.lenka@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d51ee2b
Parents:
cf8cc36 (diff), 15b592b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merge mainline changes (rev. 451)

File:
1 edited

Legend:

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

    rcf8cc36 rc47e1a8  
    4545#include <print.h>
    4646#include <panic.h>
    47 #include <arch/types.h>
     47#include <typedefs.h>
    4848#include <adt/list.h>
    4949#include <arch.h>
     
    5151#include <debug.h>
    5252#include <func.h>
    53 #include <string.h>
     53#include <str.h>
    5454#include <macros.h>
    5555#include <sysinfo/sysinfo.h>
     
    5858#include <errno.h>
    5959#include <putchar.h>
    60 #include <string.h>
     60#include <str.h>
    6161
    6262/** Simple kernel console.
     
    224224                printf("\n");
    225225                pos = NULL;
    226                 while ((hint = cmdtab_search_one(name, &pos))) {
     226                while (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                 }
    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);
     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                }
    465469        } else {
    466470                /* It's a number - convert it */
    467                 *result = atoi(text);
    468                 if (isptr)
    469                         *result = *((unative_t *) *result);
     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                }
    470489        }
    471490       
     
    643662 *
    644663 */
    645 void kconsole(char *prompt, char *msg, bool kcon)
     664void kconsole(const char *prompt, const char *msg, bool kcon)
    646665{
    647666        if (!stdin) {
Note: See TracChangeset for help on using the changeset viewer.