Changeset 4c7257b in mainline


Ignore:
Timestamp:
2009-02-28T18:55:38Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
bc18d63
Parents:
c43b1db2
Message:

Do not set sysinfo for uspace drivers directly in the kernel drivers.

Location:
kernel
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/amd64/src/amd64.c

    rc43b1db2 r4c7257b  
    6464#include <ddi/irq.h>
    6565#include <ddi/device.h>
     66#include <sysinfo/sysinfo.h>
    6667
    6768
     
    174175void arch_post_smp_init(void)
    175176{
     177        devno_t devno = device_assign_devno();
    176178        /* keyboard controller */
    177         (void) i8042_init((i8042_t *) I8042_BASE, device_assign_devno(),
    178             IRQ_KBD);
     179        (void) i8042_init((i8042_t *) I8042_BASE, devno, IRQ_KBD);
     180
     181        /*
     182         * This is the necessary evil until the userspace driver is entirely
     183         * self-sufficient.
     184         */
     185        sysinfo_set_item_val("kbd", NULL, true);
     186        sysinfo_set_item_val("kbd.devno", NULL, devno);
     187        sysinfo_set_item_val("kbd.inr", NULL, IRQ_KBD);
    179188}
    180189
  • kernel/arch/ia32/src/ia32.c

    rc43b1db2 r4c7257b  
    6363#include <console/console.h>
    6464#include <ddi/device.h>
     65#include <sysinfo/sysinfo.h>
    6566
    6667#ifdef CONFIG_SMP
     
    125126void arch_post_smp_init(void)
    126127{
    127         devno_t kbd = device_assign_devno();
     128        devno_t devno = device_assign_devno();
    128129        /* keyboard controller */
    129         (void) i8042_init((i8042_t *) I8042_BASE, kbd, IRQ_KBD);
     130        (void) i8042_init((i8042_t *) I8042_BASE, devno, IRQ_KBD);
     131
     132        /*
     133         * This is the necessary evil until the userspace driver is entirely
     134         * self-sufficient.
     135         */
     136        sysinfo_set_item_val("kbd", NULL, true);
     137        sysinfo_set_item_val("kbd.devno", NULL, devno);
     138        sysinfo_set_item_val("kbd.inr", NULL, IRQ_KBD);
    130139}
    131140
  • kernel/arch/ia64/src/ia64.c

    rc43b1db2 r4c7257b  
    161161
    162162#ifdef I460GX
    163         devno_t kbd = device_assign_devno();
     163        devno_t devno = device_assign_devno();
     164        inr_t inr;
    164165
    165166#ifdef CONFIG_NS16550
    166         (void) ns16550_init((ns16550_t *)NS16550_BASE, kbd, NS16550_IRQ, NULL,
    167              NULL);
     167        inr = NS16550_IRQ;
     168        (void) ns16550_init((ns16550_t *)NS16550_BASE, devno, inr, NULL, NULL);
     169        sysinfo_set_item_val("kbd.type", NULL, KBD_NS16550);
     170        sysinfo_set_item_val("kbd.port", NULL, (uintptr_t)NS16550_BASE);
    168171#else
    169         (void) i8042_init((i8042_t *)I8042_BASE, kbd, IRQ_KBD);
    170 #endif
     172        inr = IRQ_KBD;
     173        (void) i8042_init((i8042_t *)I8042_BASE, devno, inr);
     174        sysinfo_set_item_val("kbd.type", NULL, KBD_LEGACY);
     175#endif
     176        sysinfo_set_item_val("kbd", NULL, true);
     177        sysinfo_set_item_val("kbd.devno", NULL, devno);
     178        sysinfo_set_item_val("kbd.inr", NULL, inr);
    171179#endif
    172180
  • kernel/arch/sparc64/src/drivers/kbd.c

    rc43b1db2 r4c7257b  
    6767        cir_t cir;
    6868        void *cir_arg;
     69
     70#ifdef CONFIG_NS16550
     71        ns16550_t *ns16550;
     72#endif
     73#ifdef CONFIG_Z8530
     74        z8530_t *z8530;
     75#endif
    6976       
    7077        name = ofw_tree_node_name(node);
     
    101108        uintptr_t pa;
    102109        size_t size;
     110        devno_t devno;
    103111        inr_t inr;
    104112       
     
    149157#ifdef CONFIG_Z8530
    150158        case KBD_Z8530:
    151                 (void) z8530_init((z8530_t *) hw_map(aligned_addr,
    152                     offset + size) + offset, device_assign_devno(), inr, cir,
    153                     cir_arg);
     159                devno = device_assign_devno();
     160                z8530 = (z8530_t *) hw_map(aligned_addr, offset + size) +
     161                    offset;
     162                (void) z8530_init(z8530, devno, inr, cir, cir_arg);
     163               
     164                /*
     165                 * This is the necessary evil until the userspace drivers are
     166                 * entirely self-sufficient.
     167                 */
     168                sysinfo_set_item_val("kbd", NULL, true);
     169                sysinfo_set_item_val("kbd.type", NULL, KBD_Z8530);
     170                sysinfo_set_item_val("kbd.devno", NULL, devno);
     171                sysinfo_set_item_val("kbd.inr", NULL, inr);
     172                sysinfo_set_item_val("kbd.address.virtual", NULL,
     173                    (uintptr_t) z8530);
     174                sysinfo_set_item_val("kbd.address.physical", NULL, pa);
    154175                break;
    155176#endif
    156177#ifdef CONFIG_NS16550
    157178        case KBD_NS16550:
    158                 (void) ns16550_init((ns16550_t *) (hw_map(aligned_addr,
    159                     offset + size) + offset), device_assign_devno(), inr, cir,
    160                     cir_arg);
     179                devno = device_assign_devno();
     180                ns16550 = (ns16550_t *) hw_map(aligned_addr, offset + size) +
     181                    offset;
     182                (void) ns16550_init(ns16550, devno, inr, cir, cir_arg);
     183               
     184                /*
     185                 * This is the necessary evil until the userspace driver is
     186                 * entirely self-sufficient.
     187                 */
     188                sysinfo_set_item_val("kbd", NULL, true);
     189                sysinfo_set_item_val("kbd.type", NULL, KBD_NS16550);
     190                sysinfo_set_item_val("kbd.devno", NULL, devno);
     191                sysinfo_set_item_val("kbd.inr", NULL, inr);
     192                sysinfo_set_item_val("kbd.address.virtual", NULL,
     193                    (uintptr_t) ns16550);
     194                sysinfo_set_item_val("kbd.address.physical", NULL, pa);
    161195                break;
    162196#endif
  • kernel/genarch/src/kbd/i8042.c

    rc43b1db2 r4c7257b  
    11/*
    2  * Copyright (c) 2001-2004 Jakub Jermar
     2 * Copyright (c) 2009 Jakub Jermar
    33 * All rights reserved.
    44 *
     
    4949#include <console/console.h>
    5050#include <interrupt.h>
    51 #include <sysinfo/sysinfo.h>
    5251
    5352/* Keyboard commands. */
     
    149148                (void) pio_read_8(&dev->data);
    150149       
    151         /*
    152          * This is the necessary evil until the userspace driver is entirely
    153          * self-sufficient.
    154          */
    155         sysinfo_set_item_val("kbd", NULL, true);
    156         sysinfo_set_item_val("kbd.devno", NULL, devno);
    157         sysinfo_set_item_val("kbd.inr", NULL, inr);
    158 #ifdef KBD_LEGACY
    159         sysinfo_set_item_val("kbd.type", NULL, KBD_LEGACY);
    160 #endif
    161 
    162150        return true;
    163151}
  • kernel/genarch/src/kbd/ns16550.c

    rc43b1db2 r4c7257b  
    11/*
    2  * Copyright (c) 2001-2006 Jakub Jermar
     2 * Copyright (c) 2009 Jakub Jermar
    33 * All rights reserved.
    44 *
     
    4848#include <interrupt.h>
    4949#include <arch/interrupt.h>
    50 #include <sysinfo/sysinfo.h>
    5150#include <synch/spinlock.h>
    5251#include <mm/slab.h>
     
    105104                (void) pio_read_8(&dev->rbr);
    106105       
    107         /*
    108          * This is the necessary evil until the userspace driver is entirely
    109          * self-sufficient.
    110          */
    111         sysinfo_set_item_val("kbd", NULL, true);
    112         sysinfo_set_item_val("kbd.type", NULL, KBD_NS16550);
    113         sysinfo_set_item_val("kbd.devno", NULL, devno);
    114         sysinfo_set_item_val("kbd.inr", NULL, inr);
    115         sysinfo_set_item_val("kbd.address.virtual", NULL, (uintptr_t) dev);
    116         sysinfo_set_item_val("kbd.port", NULL, (uintptr_t) dev);
    117        
    118106        /* Enable interrupts */
    119107        pio_write_8(&dev->ier, IER_ERBFI);
  • kernel/genarch/src/kbd/z8530.c

    rc43b1db2 r4c7257b  
    11/*
    2  * Copyright (c) 2001-2004 Jakub Jermar
     2 * Copyright (c) 2009 Jakub Jermar
    33 * All rights reserved.
    44 *
     
    4242#include <console/console.h>
    4343#include <console/chardev.h>
    44 #include <sysinfo/sysinfo.h>
    4544#include <ddi/irq.h>
    4645#include <arch/asm.h>
     
    123122        z8530_write(&dev->ctl_a, WR9, WR9_MIE);
    124123
    125         /*
    126          * This is the necessary evil until the userspace drivers are entirely
    127          * self-sufficient.
    128          */
    129         sysinfo_set_item_val("kbd", NULL, true);
    130         sysinfo_set_item_val("kbd.type", NULL, KBD_Z8530);
    131         sysinfo_set_item_val("kbd.devno", NULL, devno);
    132         sysinfo_set_item_val("kbd.inr", NULL, inr);
    133         sysinfo_set_item_val("kbd.address.virtual", NULL, (uintptr_t) dev);
    134 
    135124        return true;
    136125}
Note: See TracChangeset for help on using the changeset viewer.