Changes in / [04c35fca:103db908] in mainline


Ignore:
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia64/src/drivers/ski.c

    r04c35fca r103db908  
    3737#include <console/console.h>
    3838#include <console/chardev.h>
    39 #include <ddi/ddi.h>
    4039#include <sysinfo/sysinfo.h>
    4140#include <stdint.h>
     
    7069
    7170static ski_instance_t *instance = NULL;
    72 static parea_t ski_parea;
    7371
    7472/** Ask debug console if a key was pressed.
     
    107105        int count = POLL_LIMIT;
    108106
    109         if (ski_parea.mapped)
    110                 return;
    111 
    112107        while (count > 0) {
    113108                wchar_t ch = ski_getchar();
     
    127122
    128123        while (true) {
    129                 poll_keyboard(instance);
     124                // TODO FIXME:
     125                // This currently breaks the kernel console
     126                // before we get the override from uspace.
     127                if (console_override)
     128                        poll_keyboard(instance);
     129
    130130                thread_usleep(POLL_INTERVAL);
    131131        }
     
    140140static void ski_init(void)
    141141{
    142         uintptr_t faddr;
    143 
    144142        if (instance)
    145143                return;
     
    152150            : "r15", "r8"
    153151        );
    154 
    155         faddr = frame_alloc(1, FRAME_LOWMEM | FRAME_ATOMIC, 0);
    156         if (faddr == 0)
    157                 panic("Cannot allocate page for ski console.");
    158 
    159         ddi_parea_init(&ski_parea);
    160         ski_parea.pbase = faddr;
    161         ski_parea.frames = 1;
    162         ski_parea.unpriv = false;
    163         ski_parea.mapped = false;
    164         ddi_parea_register(&ski_parea);
    165 
    166         sysinfo_set_item_val("ski.paddr", NULL, (sysarg_t) faddr);
    167152
    168153        instance = malloc(sizeof(ski_instance_t));
     
    205190static void ski_putwchar(outdev_t *dev, wchar_t ch)
    206191{
    207         if (ski_parea.mapped)
    208                 return;
    209 
    210         if (ascii_check(ch)) {
    211                 if (ch == '\n')
    212                         ski_do_putchar('\r');
    213 
    214                 ski_do_putchar(ch);
    215         } else {
    216                 ski_do_putchar('?');
     192        // TODO FIXME:
     193        // This currently breaks the kernel console
     194        // before we get the override from uspace.
     195        if (console_override) {
     196                if (ascii_check(ch)) {
     197                        if (ch == '\n')
     198                                ski_do_putchar('\r');
     199
     200                        ski_do_putchar(ch);
     201                } else {
     202                        ski_do_putchar('?');
     203                }
    217204        }
    218205}
  • kernel/generic/include/mm/as.h

    r04c35fca r103db908  
    268268
    269269extern as_t *as_create(unsigned int);
     270extern void as_destroy(as_t *);
    270271extern void as_hold(as_t *);
    271272extern void as_release(as_t *);
  • kernel/generic/src/console/console.c

    r04c35fca r103db908  
    209209void grab_console(void)
    210210{
    211         sysinfo_set_item_val("kconsole", NULL, true);
    212211        event_notify_1(EVENT_KCONSOLE, false, true);
    213212        bool prev = console_override;
     
    227226void release_console(void)
    228227{
    229         sysinfo_set_item_val("kconsole", NULL, false);
    230228        console_override = false;
    231229        event_notify_1(EVENT_KCONSOLE, false, false);
  • kernel/generic/src/mm/as.c

    r04c35fca r103db908  
    187187 *
    188188 */
    189 static void as_destroy(as_t *as)
     189void as_destroy(as_t *as)
    190190{
    191191        DEADLOCK_PROBE_INIT(p_asidlock);
  • kernel/generic/src/proc/program.c

    r04c35fca r103db908  
    150150        prg->loader_status = elf_load((elf_header_t *) image_addr, as);
    151151        if (prg->loader_status != EE_OK) {
    152                 as_release(as);
     152                as_destroy(as);
    153153                prg->task = NULL;
    154154                prg->main_thread = NULL;
     
    176176        void *loader = program_loader;
    177177        if (!loader) {
    178                 as_release(as);
     178                as_destroy(as);
    179179                log(LF_OTHER, LVL_ERROR,
    180180                    "Cannot spawn loader as none was registered");
     
    184184        prg->loader_status = elf_load((elf_header_t *) program_loader, as);
    185185        if (prg->loader_status != EE_OK) {
    186                 as_release(as);
     186                as_destroy(as);
    187187                log(LF_OTHER, LVL_ERROR, "Cannot spawn loader (%s)",
    188188                    elf_error(prg->loader_status));
  • uspace/drv/char/ski-con/ski-con.c

    r04c35fca r103db908  
    11/*
    22 * Copyright (c) 2005 Jakub Jermar
    3  * Copyright (c) 2018 Jiri Svoboda
     3 * Copyright (c) 2017 Jiri Svoboda
    44 * All rights reserved.
    55 *
     
    3131 */
    3232
    33 #include <as.h>
    3433#include <async.h>
    3534#include <ddf/driver.h>
    3635#include <ddf/log.h>
    37 #include <ddi.h>
    3836#include <errno.h>
    3937#include <fibril.h>
     
    4240#include <stdlib.h>
    4341#include <stdbool.h>
    44 #include <sysinfo.h>
    4542
    4643#include "ski-con.h"
     
    7168        ddf_fun_t *fun = NULL;
    7269        bool bound = false;
    73         uintptr_t faddr;
    74         void *addr = AS_AREA_ANY;
    7570        errno_t rc;
    7671
     
    9287        con->cds.sarg = con;
    9388
    94         rc = sysinfo_get_value("ski.paddr", &faddr);
    95         if (rc != EOK)
    96                 faddr = 0; /* No kernel driver to arbitrate with */
    97 
    98         if (faddr != 0) {
    99                 addr = AS_AREA_ANY;
    100                 rc = physmem_map(faddr, 1, AS_AREA_READ | AS_AREA_CACHEABLE,
    101                     &addr);
    102                 if (rc != EOK) {
    103                         ddf_msg(LVL_ERROR, "Cannot map kernel driver arbitration area.");
    104                         goto error;
    105                 }
    106         }
    107 
    10889        rc = ddf_fun_bind(fun);
    10990        if (rc != EOK) {
     
    126107        return EOK;
    127108error:
    128         if (addr != AS_AREA_ANY)
    129                 as_area_destroy(addr);
    130109        if (bound)
    131110                ddf_fun_unbind(fun);
     
    148127}
    149128
    150 /** Detect if SKI console is in use by the kernel.
    151  *
    152  * This is needed since the kernel has no way of fencing off the user-space
    153  * driver.
    154  *
    155  * @return @c true if in use by the kernel.
    156  */
    157 static bool ski_con_disabled(void)
    158 {
    159         sysarg_t kconsole;
    160 
    161         /*
    162          * XXX Ideally we should get information from our kernel counterpart
    163          * driver. But there needs to be a mechanism for the kernel console
    164          * to inform the kernel driver.
    165          */
    166         if (sysinfo_get_value("kconsole", &kconsole) != EOK)
    167                 return false;
    168 
    169         return kconsole != false;
    170 }
    171 
    172129/** Poll Ski for keypresses. */
    173130static errno_t ski_con_fibril(void *arg)
     
    178135
    179136        while (true) {
    180                 while (!ski_con_disabled()) {
     137                while (true) {
    181138                        c = ski_con_getchar();
    182139                        if (c == 0)
     
    289246        uint8_t *dp = (uint8_t *) data;
    290247
    291         if (!ski_con_disabled()) {
    292                 for (i = 0; i < size; i++) {
    293                         ski_con_putchar(con, dp[i]);
    294                 }
    295         }
     248        for (i = 0; i < size; i++)
     249                ski_con_putchar(con, dp[i]);
    296250
    297251        *nwr = size;
  • uspace/drv/char/ski-con/ski-con.h

    r04c35fca r103db908  
    5656        fibril_mutex_t buf_lock;
    5757        fibril_condvar_t buf_cv;
    58         /** Memory area mapped to arbitrate with the kernel driver */
    59         void *mem_area;
    6058} ski_con_t;
    6159
  • uspace/lib/c/generic/loader.c

    r04c35fca r103db908  
    200200        }
    201201
    202         rc = loader_set_program(ldr, abspath, fd);
     202        rc = loader_set_program(ldr, path, fd);
    203203        vfs_put(fd);
    204204        return rc;
Note: See TracChangeset for help on using the changeset viewer.