Ignore:
File:
1 edited

Legend:

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

    rd7533c7 ra71c158  
    3939#include <synch/waitq.h>
    4040#include <synch/spinlock.h>
    41 #include <typedefs.h>
     41#include <arch/types.h>
    4242#include <ddi/irq.h>
    4343#include <ddi/ddi.h>
     
    4545#include <ipc/irq.h>
    4646#include <arch.h>
    47 #include <panic.h>
    4847#include <print.h>
    4948#include <putchar.h>
     
    5150#include <syscall/copy.h>
    5251#include <errno.h>
    53 #include <str.h>
     52#include <string.h>
    5453
    5554#define KLOG_PAGES    4
     
    6261/** Kernel log initialized */
    6362static bool klog_inited = false;
    64 
    6563/** First kernel log characters */
    6664static size_t klog_start = 0;
    67 
    6865/** Number of valid kernel log characters */
    6966static size_t klog_len = 0;
    70 
    7167/** Number of stored (not printed) kernel log characters */
    7268static size_t klog_stored = 0;
    73 
    7469/** Number of stored kernel log characters for uspace */
    7570static size_t klog_uspace = 0;
     
    8883};
    8984
    90 static void stdout_write(outdev_t *, wchar_t, bool);
    91 static void stdout_redraw(outdev_t *);
     85static void stdout_write(outdev_t *dev, wchar_t ch, bool silent);
     86static void stdout_redraw(outdev_t *dev);
    9287
    9388static outdev_operations_t stdout_ops = {
     
    160155        klog_parea.pbase = (uintptr_t) faddr;
    161156        klog_parea.frames = SIZE2FRAMES(sizeof(klog));
    162         klog_parea.unpriv = false;
    163157        ddi_parea_register(&klog_parea);
    164158       
    165         sysinfo_set_item_val("klog.faddr", NULL, (sysarg_t) faddr);
     159        sysinfo_set_item_val("klog.faddr", NULL, (unative_t) faddr);
    166160        sysinfo_set_item_val("klog.pages", NULL, KLOG_PAGES);
    167161       
     
    179173                stdout->op->redraw(stdout);
    180174       
    181         if ((stdin) && (prev)) {
    182                 /*
    183                  * Force the console to print the prompt.
    184                  */
     175        /* Force the console to print the prompt */
     176        if ((stdin) && (prev))
    185177                indev_push_character(stdin, '\n');
    186         }
    187178}
    188179
     
    194185
    195186/** Tell kernel to get keyboard/console access again */
    196 sysarg_t sys_debug_enable_console(void)
     187unative_t sys_debug_enable_console(void)
    197188{
    198189#ifdef CONFIG_KCONSOLE
     
    205196
    206197/** Tell kernel to relinquish keyboard/console access */
    207 sysarg_t sys_debug_disable_console(void)
     198unative_t sys_debug_disable_console(void)
    208199{
    209200        release_console();
     
    295286                stdout->op->write(stdout, ch, silent);
    296287        else {
    297                 /*
    298                  * No standard output routine defined yet.
    299                  * The character is still stored in the kernel log
    300                  * for possible future output.
    301                  *
    302                  * The early_putchar() function is used to output
    303                  * the character for low-level debugging purposes.
    304                  * Note that the early_putc() function might be
    305                  * a no-op on certain hardware configurations.
    306                  *
    307                  */
    308                 early_putchar(ch);
    309                
     288                /* The character is just in the kernel log */
    310289                if (klog_stored < klog_len)
    311290                        klog_stored++;
     
    334313 *
    335314 */
    336 sysarg_t sys_klog(int fd, const void *buf, size_t size)
     315unative_t sys_klog(int fd, const void *buf, size_t size)
    337316{
    338317        char *data;
     
    340319       
    341320        if (size > PAGE_SIZE)
    342                 return (sysarg_t) ELIMIT;
     321                return ELIMIT;
    343322       
    344323        if (size > 0) {
    345324                data = (char *) malloc(size + 1, 0);
    346325                if (!data)
    347                         return (sysarg_t) ENOMEM;
     326                        return ENOMEM;
    348327               
    349328                rc = copy_from_uspace(data, buf, size);
    350329                if (rc) {
    351330                        free(data);
    352                         return (sysarg_t) rc;
     331                        return rc;
    353332                }
    354333                data[size] = 0;
Note: See TracChangeset for help on using the changeset viewer.