Changeset 84afc7b in mainline


Ignore:
Timestamp:
2009-03-18T10:53:12Z (16 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e749794
Parents:
8015eeec
Message:

as kernel little brother drivers are not needed anymore, the device numbers do not have to be correlated between kernel and uspace in any way
introduce new syscall sys_device_assign_devno() for generating system-wide unique device numbers for uspace

Files:
34 edited

Legend:

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

    r8015eeec r84afc7b  
    6666#include <console/console.h>
    6767#include <ddi/irq.h>
    68 #include <ddi/device.h>
    6968#include <sysinfo/sysinfo.h>
    7069
     
    195194{
    196195#ifdef CONFIG_PC_KBD
    197         devno_t devno = device_assign_devno();
    198        
    199196        /*
    200197         * Initialize the i8042 controller. Then initialize the keyboard
    201198         * module and connect it to i8042. Enable keyboard interrupts.
    202199         */
    203         indev_t *kbrdin = i8042_init((i8042_t *) I8042_BASE, devno, IRQ_KBD);
     200        indev_t *kbrdin = i8042_init((i8042_t *) I8042_BASE, IRQ_KBD);
    204201        if (kbrdin) {
    205202                kbrd_init(kbrdin);
     
    212209         */
    213210        sysinfo_set_item_val("kbd", NULL, true);
    214         sysinfo_set_item_val("kbd.devno", NULL, devno);
    215211        sysinfo_set_item_val("kbd.inr", NULL, IRQ_KBD);
    216212        sysinfo_set_item_val("kbd.address.physical", NULL,
  • kernel/arch/arm32/src/arm32.c

    r8015eeec r84afc7b  
    3737#include <config.h>
    3838#include <arch/console.h>
    39 #include <ddi/device.h>
    4039#include <genarch/fb/fb.h>
    4140#include <genarch/fb/visuals.h>
     
    129128{
    130129#ifdef CONFIG_ARM_KBD
    131         devno_t devno = device_assign_devno();
    132        
    133130        /*
    134131         * Initialize the msim/GXemul keyboard port. Then initialize the serial line
    135132         * module and connect it to the msim/GXemul keyboard. Enable keyboard interrupts.
    136133         */
    137         indev_t *kbrdin = dsrlnin_init((dsrlnin_t *) gxemul_kbd, devno, GXEMUL_KBD_IRQ);
     134        indev_t *kbrdin = dsrlnin_init((dsrlnin_t *) gxemul_kbd, GXEMUL_KBD_IRQ);
    138135        if (kbrdin)
    139136                srln_init(kbrdin);
     
    144141         */
    145142        sysinfo_set_item_val("kbd", NULL, true);
    146         sysinfo_set_item_val("kbd.devno", NULL, devno);
    147143        sysinfo_set_item_val("kbd.inr", NULL, GXEMUL_KBD_IRQ);
    148144        sysinfo_set_item_val("kbd.address.virtual", NULL, (unative_t) gxemul_kbd);
  • kernel/arch/ia32/src/drivers/i8254.c

    r8015eeec r84afc7b  
    2727 */
    2828
    29 /** @addtogroup ia32   
     29/** @addtogroup ia32
    3030 * @{
    3131 */
    3232/**
    3333 * @file
    34  * @brief       i8254 chip driver.
     34 * @brief i8254 chip driver.
    3535 *
    3636 * Low level time functions.
  • kernel/arch/ia32/src/ia32.c

    r8015eeec r84afc7b  
    6666#include <syscall/syscall.h>
    6767#include <console/console.h>
    68 #include <ddi/device.h>
    6968#include <sysinfo/sysinfo.h>
    7069#include <arch/boot/boot.h>
     
    153152{
    154153#ifdef CONFIG_PC_KBD
    155         devno_t devno = device_assign_devno();
    156        
    157154        /*
    158155         * Initialize the i8042 controller. Then initialize the keyboard
    159156         * module and connect it to i8042. Enable keyboard interrupts.
    160157         */
    161         indev_t *kbrdin = i8042_init((i8042_t *) I8042_BASE, devno, IRQ_KBD);
     158        indev_t *kbrdin = i8042_init((i8042_t *) I8042_BASE, IRQ_KBD);
    162159        if (kbrdin) {
    163160                kbrd_init(kbrdin);
     
    170167         */
    171168        sysinfo_set_item_val("kbd", NULL, true);
    172         sysinfo_set_item_val("kbd.devno", NULL, devno);
    173169        sysinfo_set_item_val("kbd.inr", NULL, IRQ_KBD);
    174170        sysinfo_set_item_val("kbd.address.physical", NULL,
  • kernel/arch/ia32/src/smp/apic.c

    r8015eeec r84afc7b  
    2727 */
    2828
    29 /** @addtogroup ia32   
     29/** @addtogroup ia32
    3030 * @{
    3131 */
  • kernel/arch/ia64/src/drivers/it.c

    r8015eeec r84afc7b  
    2727 */
    2828
    29 /** @addtogroup ia64   
     29/** @addtogroup ia64
    3030 * @{
    3131 */
  • kernel/arch/ia64/src/ia64.c

    r8015eeec r84afc7b  
    5151#include <syscall/syscall.h>
    5252#include <ddi/irq.h>
    53 #include <ddi/device.h>
    5453#include <arch/bootinfo.h>
    5554#include <genarch/drivers/legacy/ia32/io.h>
     
    163162       
    164163#ifdef CONFIG_NS16550
    165         devno_t devno_ns16550 = device_assign_devno();
    166164        indev_t *kbrdin_ns16550
    167             = ns16550_init((ns16550_t *) NS16550_BASE, devno_ns16550, NS16550_IRQ, NULL, NULL);
     165            = ns16550_init((ns16550_t *) NS16550_BASE, NS16550_IRQ, NULL, NULL);
    168166        if (kbrdin_ns16550)
    169167                srln_init(kbrdin_ns16550);
    170168       
    171169        sysinfo_set_item_val("kbd", NULL, true);
    172         sysinfo_set_item_val("kbd.devno", NULL, devno_ns16550);
    173170        sysinfo_set_item_val("kbd.inr", NULL, NS16550_IRQ);
    174171        sysinfo_set_item_val("kbd.type", NULL, KBD_NS16550);
     
    180177       
    181178#ifdef CONFIG_I8042
    182         devno_t devno_i8042 = device_assign_devno();
    183         indev_t *kbrdin_i8042 = i8042_init((i8042_t *) I8042_BASE, devno_i8042, IRQ_KBD);
     179        indev_t *kbrdin_i8042 = i8042_init((i8042_t *) I8042_BASE, IRQ_KBD);
    184180        if (kbrdin_i8042)
    185181                kbrd_init(kbrdin_i8042);
    186182       
    187183        sysinfo_set_item_val("kbd", NULL, true);
    188         sysinfo_set_item_val("kbd.devno", NULL, devno_i8042);
    189184        sysinfo_set_item_val("kbd.inr", NULL, IRQ_KBD);
    190185        sysinfo_set_item_val("kbd.type", NULL, KBD_LEGACY);
  • kernel/arch/mips32/src/mips32.c

    r8015eeec r84afc7b  
    5757#include <genarch/srln/srln.h>
    5858#include <macros.h>
    59 #include <ddi/device.h>
    6059#include <config.h>
    6160#include <string.h>
     
    167166{
    168167#ifdef CONFIG_MIPS_KBD
    169         devno_t devno = device_assign_devno();
    170        
    171168        /*
    172169         * Initialize the msim/GXemul keyboard port. Then initialize the serial line
    173170         * module and connect it to the msim/GXemul keyboard. Enable keyboard interrupts.
    174171         */
    175         indev_t *kbrdin = dsrlnin_init((dsrlnin_t *) MSIM_KBD_ADDRESS, devno, MSIM_KBD_IRQ);
     172        indev_t *kbrdin = dsrlnin_init((dsrlnin_t *) MSIM_KBD_ADDRESS, MSIM_KBD_IRQ);
    176173        if (kbrdin) {
    177174                srln_init(kbrdin);
     
    184181         */
    185182        sysinfo_set_item_val("kbd", NULL, true);
    186         sysinfo_set_item_val("kbd.devno", NULL, devno);
    187183        sysinfo_set_item_val("kbd.inr", NULL, MSIM_KBD_IRQ);
    188184        sysinfo_set_item_val("kbd.address.virtual", NULL, MSIM_KBD_ADDRESS);
  • kernel/arch/ppc32/include/drivers/cuda.h

    r8015eeec r84afc7b  
    3939#include <typedefs.h>
    4040
    41 extern void cuda_init(devno_t devno, uintptr_t base, size_t size);
     41extern void cuda_init(uintptr_t base, size_t size);
    4242extern int cuda_get_scancode(void);
    4343
  • kernel/arch/ppc32/src/drivers/cuda.c

    r8015eeec r84afc7b  
    4141#include <interrupt.h>
    4242#include <stdarg.h>
     43#include <ddi/device.h>
    4344
    4445#define CUDA_IRQ 10
     
    242243}
    243244
    244 void cuda_init(devno_t devno, uintptr_t base, size_t size)
     245void cuda_init(uintptr_t base, size_t size)
    245246{
    246247        cuda = (uint8_t *) hw_map(base, size);
     
    250251       
    251252        irq_initialize(&cuda_irq);
    252         cuda_irq.devno = devno;
     253        cuda_irq.devno = device_assign_devno();
    253254        cuda_irq.inr = CUDA_IRQ;
    254255        cuda_irq.claim = cuda_claim;
     
    259260       
    260261        sysinfo_set_item_val("kbd", NULL, true);
    261         sysinfo_set_item_val("kbd.devno", NULL, devno);
    262262        sysinfo_set_item_val("kbd.inr", NULL, CUDA_IRQ);
    263263        sysinfo_set_item_val("kbd.address.virtual", NULL, base);
  • kernel/arch/ppc32/src/ppc32.c

    r8015eeec r84afc7b  
    4343#include <proc/uarg.h>
    4444#include <console/console.h>
    45 #include <ddi/device.h>
    4645#include <ddi/irq.h>
    4746#include <arch/drivers/pic.h>
     
    122121                       
    123122                        /* Initialize I/O controller */
    124                         cuda_init(device_assign_devno(),
    125                             bootinfo.macio.addr + 0x16000, 2 * PAGE_SIZE);
     123                        cuda_init(bootinfo.macio.addr + 0x16000, 2 * PAGE_SIZE);
    126124                }
    127125               
  • kernel/arch/sparc64/src/drivers/kbd.c

    r8015eeec r84afc7b  
    4747
    4848#include <console/console.h>
    49 #include <ddi/device.h>
    5049#include <ddi/irq.h>
    5150#include <arch/mm/page.h>
     
    7574        cir_t cir;
    7675        void *cir_arg;
    77 
     76       
    7877#ifdef CONFIG_NS16550
    7978        ns16550_t *ns16550;
     
    116115        uintptr_t pa;
    117116        size_t size;
    118         devno_t devno;
    119117        inr_t inr;
    120118       
     
    165163#ifdef CONFIG_Z8530
    166164        case KBD_Z8530:
    167                 devno = device_assign_devno();
    168165                z8530 = (z8530_t *) hw_map(aligned_addr, offset + size) +
    169166                    offset;
    170167               
    171                 indev_t *kbrdin_z8530 = z8530_init(z8530, devno, inr, cir, cir_arg);
     168                indev_t *kbrdin_z8530 = z8530_init(z8530, inr, cir, cir_arg);
    172169                if (kbrdin_z8530)
    173170                        kbrd_init(kbrdin_z8530);
     
    179176                sysinfo_set_item_val("kbd", NULL, true);
    180177                sysinfo_set_item_val("kbd.type", NULL, KBD_Z8530);
    181                 sysinfo_set_item_val("kbd.devno", NULL, devno);
    182178                sysinfo_set_item_val("kbd.inr", NULL, inr);
    183179                sysinfo_set_item_val("kbd.address.kernel", NULL,
     
    188184#ifdef CONFIG_NS16550
    189185        case KBD_NS16550:
    190                 devno = device_assign_devno();
    191186                ns16550 = (ns16550_t *) hw_map(aligned_addr, offset + size) +
    192187                    offset;
    193188               
    194                 indev_t *kbrdin_ns16550 = ns16550_init(ns16550, devno, inr, cir, cir_arg);
     189                indev_t *kbrdin_ns16550 = ns16550_init(ns16550, inr, cir, cir_arg);
    195190                if (kbrdin_ns16550)
    196191                        kbrd_init(kbrdin_ns16550);
     
    202197                sysinfo_set_item_val("kbd", NULL, true);
    203198                sysinfo_set_item_val("kbd.type", NULL, KBD_NS16550);
    204                 sysinfo_set_item_val("kbd.devno", NULL, devno);
    205199                sysinfo_set_item_val("kbd.inr", NULL, inr);
    206200                sysinfo_set_item_val("kbd.address.kernel", NULL,
  • kernel/genarch/include/drivers/dsrln/dsrlnin.h

    r8015eeec r84afc7b  
    4848
    4949typedef struct {
    50         devno_t devno;
    5150        irq_t irq;
    5251        dsrlnin_t *dsrlnin;
     
    5453} dsrlnin_instance_t;
    5554
    56 extern indev_t *dsrlnin_init(dsrlnin_t *, devno_t, inr_t);
     55extern indev_t *dsrlnin_init(dsrlnin_t *, inr_t);
    5756
    5857#endif
  • kernel/genarch/include/drivers/i8042/i8042.h

    r8015eeec r84afc7b  
    4848
    4949typedef struct {
    50         devno_t devno;
    5150        irq_t irq;
    5251        i8042_t *i8042;
     
    5453} i8042_instance_t;
    5554
    56 extern indev_t *i8042_init(i8042_t *, devno_t, inr_t);
     55extern indev_t *i8042_init(i8042_t *, inr_t);
    5756
    5857#endif
  • kernel/genarch/include/drivers/ns16550/ns16550.h

    r8015eeec r84afc7b  
    6363/** Structure representing the ns16550 device. */
    6464typedef struct {
    65         devno_t devno;
    6665        ns16550_t *ns16550;
    6766        irq_t irq;
     
    6968} ns16550_instance_t;
    7069
    71 extern indev_t *ns16550_init(ns16550_t *, devno_t, inr_t, cir_t, void *);
     70extern indev_t *ns16550_init(ns16550_t *, inr_t, cir_t, void *);
    7271
    7372#endif
  • kernel/genarch/include/drivers/z8530/z8530.h

    r8015eeec r84afc7b  
    115115/** Structure representing the z8530 device. */
    116116typedef struct {
    117         devno_t devno;
    118117        irq_t irq;
    119118        z8530_t *z8530;
     
    121120} z8530_instance_t;
    122121
    123 extern indev_t *z8530_init(z8530_t *, devno_t, inr_t, cir_t, void *);
     122extern indev_t *z8530_init(z8530_t *, inr_t, cir_t, void *);
    124123
    125124#endif
  • kernel/genarch/src/drivers/dsrln/dsrlnin.c

    r8015eeec r84afc7b  
    3939#include <mm/slab.h>
    4040#include <arch/asm.h>
     41#include <ddi/device.h>
    4142
    4243static indev_operations_t kbrdin_ops = {
     
    5758}
    5859
    59 indev_t *dsrlnin_init(dsrlnin_t *dev, devno_t devno, inr_t inr)
     60indev_t *dsrlnin_init(dsrlnin_t *dev, inr_t inr)
    6061{
    6162        dsrlnin_instance_t *instance
     
    6667        indev_initialize("dsrlnin", &instance->kbrdin, &kbrdin_ops);
    6768       
    68         instance->devno = devno;
    6969        instance->dsrlnin = dev;
    7070       
    7171        irq_initialize(&instance->irq);
    72         instance->irq.devno = devno;
     72        instance->irq.devno = device_assign_devno();
    7373        instance->irq.inr = inr;
    7474        instance->irq.claim = dsrlnin_claim;
  • kernel/genarch/src/drivers/i8042/i8042.c

    r8015eeec r84afc7b  
    4242#include <console/chardev.h>
    4343#include <mm/slab.h>
     44#include <ddi/device.h>
    4445
    4546static indev_operations_t kbrdin_ops = {
     
    7778
    7879/** Initialize i8042. */
    79 indev_t *i8042_init(i8042_t *dev, devno_t devno, inr_t inr)
     80indev_t *i8042_init(i8042_t *dev, inr_t inr)
    8081{
    8182        i8042_instance_t *instance
     
    8687        indev_initialize("i8042", &instance->kbrdin, &kbrdin_ops);
    8788       
    88         instance->devno = devno;
    8989        instance->i8042 = dev;
    9090       
    9191        irq_initialize(&instance->irq);
    92         instance->irq.devno = devno;
     92        instance->irq.devno = device_assign_devno();
    9393        instance->irq.inr = inr;
    9494        instance->irq.claim = i8042_claim;
  • kernel/genarch/src/drivers/ns16550/ns16550.c

    r8015eeec r84afc7b  
    4040#include <console/chardev.h>
    4141#include <mm/slab.h>
     42#include <ddi/device.h>
    4243
    4344#define LSR_DATA_READY  0x01
     
    8081 *
    8182 */
    82 indev_t *ns16550_init(ns16550_t *dev, devno_t devno, inr_t inr, cir_t cir, void *cir_arg)
     83indev_t *ns16550_init(ns16550_t *dev, inr_t inr, cir_t cir, void *cir_arg)
    8384{
    8485        ns16550_instance_t *instance
     
    8990        indev_initialize("ns16550", &instance->kbrdin, &kbrdin_ops);
    9091       
    91         instance->devno = devno;
    9292        instance->ns16550 = dev;
    9393       
    9494        irq_initialize(&instance->irq);
    95         instance->irq.devno = devno;
     95        instance->irq.devno = device_assign_devno();
    9696        instance->irq.inr = inr;
    9797        instance->irq.claim = ns16550_claim;
  • kernel/genarch/src/drivers/z8530/z8530.c

    r8015eeec r84afc7b  
    4040#include <arch/asm.h>
    4141#include <mm/slab.h>
     42#include <ddi/device.h>
    4243
    4344static indev_operations_t kbrdin_ops = {
     
    8889
    8990/** Initialize z8530. */
    90 indev_t *z8530_init(z8530_t *dev, devno_t devno, inr_t inr, cir_t cir, void *cir_arg)
     91indev_t *z8530_init(z8530_t *dev, inr_t inr, cir_t cir, void *cir_arg)
    9192{
    9293        z8530_instance_t *instance
     
    9798        indev_initialize("z8530", &instance->kbrdin, &kbrdin_ops);
    9899       
    99         instance->devno = devno;
    100100        instance->z8530 = dev;
    101101       
    102102        irq_initialize(&instance->irq);
    103         instance->irq.devno = devno;
     103        instance->irq.devno = device_assign_devno();
    104104        instance->irq.inr = inr;
    105105        instance->irq.claim = z8530_claim;
  • kernel/generic/include/ddi/device.h

    r8015eeec r84afc7b  
    4040
    4141extern devno_t device_assign_devno(void);
     42extern unative_t sys_device_assign_devno(void);
    4243
    4344#endif
  • kernel/generic/include/syscall/syscall.h

    r8015eeec r84afc7b  
    7373        SYS_CAP_REVOKE,
    7474       
     75        SYS_DEVICE_ASSIGN_DEVNO,
    7576        SYS_PHYSMEM_MAP,
    7677        SYS_IOSPACE_ENABLE,
  • kernel/generic/src/console/kconsole.c

    r8015eeec r84afc7b  
    135135void kconsole_notify_init(void)
    136136{
    137         devno_t devno = device_assign_devno();
    138        
    139137        sysinfo_set_item_val("kconsole.present", NULL, true);
    140         sysinfo_set_item_val("kconsole.devno", NULL, devno);
    141138        sysinfo_set_item_val("kconsole.inr", NULL, KCONSOLE_VIRT_INR);
    142139       
    143140        irq_initialize(&kconsole_irq);
    144         kconsole_irq.devno = devno;
     141        kconsole_irq.devno = device_assign_devno();
    145142        kconsole_irq.inr = KCONSOLE_VIRT_INR;
    146143        kconsole_irq.claim = kconsole_claim;
  • kernel/generic/src/ddi/device.c

    r8015eeec r84afc7b  
    3232/**
    3333 * @file
    34  * @brief       Device numbers.
     34 * @brief Device numbers.
    3535 */
    3636
     
    4848devno_t device_assign_devno(void)
    4949{
    50         devno_t devno; 
     50        devno_t devno = (devno_t) atomic_postinc(&last);
     51        ASSERT(devno >= 0);
     52       
     53        return devno;
     54}
    5155
    52         devno = (devno_t) atomic_postinc(&last);
    53         ASSERT(devno >= 0);
    54 
    55         return devno;
     56unative_t sys_device_assign_devno(void)
     57{
     58        return (unative_t) device_assign_devno();
    5659}
    5760
  • kernel/generic/src/syscall/syscall.c

    r8015eeec r84afc7b  
    3333/**
    3434 * @file
    35  * @brief       Syscall table and syscall wrappers.
     35 * @brief Syscall table and syscall wrappers.
    3636 */
    37  
     37
    3838#include <syscall/syscall.h>
    3939#include <proc/thread.h>
     
    4343#include <print.h>
    4444#include <putchar.h>
    45 #include <errno.h>
    4645#include <arch.h>
    4746#include <debug.h>
     47#include <ddi/device.h>
    4848#include <ipc/sysipc.h>
    4949#include <synch/futex.h>
     
    5151#include <ddi/ddi.h>
    5252#include <security/cap.h>
    53 #include <syscall/copy.h>
    5453#include <sysinfo/sysinfo.h>
    5554#include <console/console.h>
    5655#include <udebug/udebug.h>
    57 
    58 /** Print using kernel facility
    59  *
    60  * Print to kernel log.
    61  *
    62  */
    63 static unative_t sys_klog(int fd, const void * buf, size_t count)
    64 {
    65         char *data;
    66         int rc;
    67 
    68         if (count > PAGE_SIZE)
    69                 return ELIMIT;
    70        
    71         if (count > 0) {
    72                 data = (char *) malloc(count + 1, 0);
    73                 if (!data)
    74                         return ENOMEM;
    75                
    76                 rc = copy_from_uspace(data, buf, count);
    77                 if (rc) {
    78                         free(data);
    79                         return rc;
    80                 }
    81                 data[count] = 0;
    82                
    83                 printf("%s", data);
    84                 free(data);
    85         } else
    86                 klog_update();
    87        
    88         return count;
    89 }
    90 
    91 /** Tell kernel to get keyboard/console access again */
    92 static unative_t sys_debug_enable_console(void)
    93 {
    94 #ifdef CONFIG_KCONSOLE
    95         grab_console();
    96         return true;
    97 #else
    98         return false;
    99 #endif
    100 }
    101 
    102 /** Tell kernel to relinquish keyboard/console access */
    103 static unative_t sys_debug_disable_console(void)
    104 {
    105         release_console();
    106         return true;
    107 }
    10856
    10957/** Dispatch system call */
     
    11260{
    11361        unative_t rc;
    114 
     62       
    11563#ifdef CONFIG_UDEBUG
    11664        udebug_syscall_event(a1, a2, a3, a4, a5, a6, id, 0, false);
    11765#endif
    118         if (id < SYSCALL_END) {
     66       
     67        if (id < SYSCALL_END) {
    11968                rc = syscall_table[id](a1, a2, a3, a4, a5, a6);
    12069        } else {
     
    12372                thread_exit();
    12473        }
    125                
     74       
    12675        if (THREAD->interrupted)
    12776                thread_exit();
    128 
     77       
    12978#ifdef CONFIG_UDEBUG
    13079        udebug_syscall_event(a1, a2, a3, a4, a5, a6, id, rc, true);
    131 
     80       
    13281        /*
    13382         * Stopping point needed for tasks that only invoke non-blocking
     
    13685        udebug_stoppable_begin();
    13786        udebug_stoppable_end();
    138 #endif 
     87#endif
     88       
    13989        return rc;
    14090}
     
    183133       
    184134        /* DDI related syscalls. */
     135        (syshandler_t) sys_device_assign_devno,
    185136        (syshandler_t) sys_physmem_map,
    186137        (syshandler_t) sys_iospace_enable,
  • uspace/app/klog/klog.c

    r8015eeec r84afc7b  
    8282        }
    8383       
    84         int devno = sysinfo_value("klog.devno");
    85         int inr = sysinfo_value("klog.inr");
    86         if (ipc_register_irq(inr, devno, 0, NULL) != EOK) {
    87                 printf(NAME ": Error registering klog notifications\n");
    88                 return -1;
    89         }
     84//      int inr = sysinfo_value("klog.inr");
     85//      if (ipc_register_irq(inr, devno, 0, NULL) != EOK) {
     86//              printf(NAME ": Error registering klog notifications\n");
     87//              return -1;
     88//      }
    9089       
    9190        async_set_interrupt_received(interrupt_received);
  • uspace/lib/libc/generic/ddi.c

    r8015eeec r84afc7b  
    4141#include <libarch/config.h>
    4242#include <kernel/ddi/ddi_arg.h>
     43
     44/** Return unique device number.
     45 *
     46 * @return New unique device number.
     47 *
     48 */
     49int device_assign_devno(void)
     50{
     51        return __SYSCALL0(SYS_DEVICE_ASSIGN_DEVNO);
     52}
    4353
    4454/** Map piece of physical memory to task.
  • uspace/lib/libc/include/ddi.h

    r8015eeec r84afc7b  
    3838#include <task.h>
    3939
     40extern int device_assign_devno(void);
    4041extern int physmem_map(void *, void *, unsigned long, int);
    4142extern int iospace_enable(task_id_t, void *, unsigned long);
  • uspace/srv/console/console.c

    r8015eeec r84afc7b  
    587587       
    588588        /* Receive kernel notifications */
    589         if (sysinfo_value("kconsole.present")) {
    590                 int devno = sysinfo_value("kconsole.devno");
    591                 int inr = sysinfo_value("kconsole.inr");
    592                 if (ipc_register_irq(inr, devno, 0, NULL) != EOK)
    593                         printf(NAME ": Error registering kconsole notifications\n");
    594                
    595                 async_set_interrupt_received(interrupt_received);
    596         }
     589//      if (sysinfo_value("kconsole.present")) {
     590//              int inr = sysinfo_value("kconsole.inr");
     591//              if (ipc_register_irq(inr, device_assign_devno(), 0, NULL) != EOK)
     592//                      printf(NAME ": Error registering kconsole notifications\n");
     593//             
     594//              async_set_interrupt_received(interrupt_received);
     595//      }
    597596       
    598597        // FIXME: avoid connectiong to itself, keep using klog
  • uspace/srv/kbd/port/gxemul.c

    r8015eeec r84afc7b  
    4040#include <kbd_port.h>
    4141#include <kbd.h>
     42#include <ddi.h>
    4243
    4344static irq_cmd_t gxemul_cmds[] = {
     
    6465        async_set_interrupt_received(gxemul_irq_handler);
    6566        gxemul_cmds[0].addr = (void *) sysinfo_value("kbd.address.virtual");
    66         ipc_register_irq(sysinfo_value("kbd.inr"), sysinfo_value("kbd.devno"),
     67        ipc_register_irq(sysinfo_value("kbd.inr"), device_assign_devno(),
    6768            0, &gxemul_kbd);
    6869        return 0;
  • uspace/srv/kbd/port/i8042.c

    r8015eeec r84afc7b  
    4444#include <kbd_port.h>
    4545#include <kbd.h>
     46#include <ddi.h>
    4647#include "i8042.h"
    4748
     
    137138        i8042_kbd.cmds[0].addr = &((i8042_t *) i8042_kernel)->status;
    138139        i8042_kbd.cmds[3].addr = &((i8042_t *) i8042_kernel)->data;
    139         ipc_register_irq(sysinfo_value("kbd.inr"), sysinfo_value("kbd.devno"), 0, &i8042_kbd);
     140        ipc_register_irq(sysinfo_value("kbd.inr"), device_assign_devno(), 0, &i8042_kbd);
    140141
    141142        int newcontrol = i8042_KBD_IE | i8042_KBD_TRANSLATE;
  • uspace/srv/kbd/port/msim.c

    r8015eeec r84afc7b  
    4040#include <kbd_port.h>
    4141#include <kbd.h>
     42#include <ddi.h>
    4243
    4344irq_cmd_t msim_cmds[] = {
     
    6465        async_set_interrupt_received(msim_irq_handler);
    6566        msim_cmds[0].addr = sysinfo_value("kbd.address.virtual");
    66         ipc_register_irq(sysinfo_value("kbd.inr"), sysinfo_value("kbd.devno"),
     67        ipc_register_irq(sysinfo_value("kbd.inr"), device_assign_devno(),
    6768            0, &msim_kbd);
    6869        return 0;
  • uspace/srv/kbd/port/ns16550.c

    r8015eeec r84afc7b  
    100100        ns16550_kbd.cmds[0].addr = (void *) (ns16550_kernel + LSR_REG);
    101101        ns16550_kbd.cmds[3].addr = (void *) (ns16550_kernel + RBR_REG);
    102         ipc_register_irq(sysinfo_value("kbd.inr"), sysinfo_value("kbd.devno"),
     102        ipc_register_irq(sysinfo_value("kbd.inr"), device_assign_devno(),
    103103            0, &ns16550_kbd);
    104104        return pio_enable((void *) ns16550_physical, 8, &vaddr);
  • uspace/srv/kbd/port/z8530.c

    r8015eeec r84afc7b  
    9090        z8530_cmds[3].addr = (void *) sysinfo_value("kbd.address.kernel") +
    9191            CHAN_A_DATA;
    92         ipc_register_irq(sysinfo_value("kbd.inr"), sysinfo_value("kbd.devno"),
     92        ipc_register_irq(sysinfo_value("kbd.inr"), device_assign_devno(),
    9393            sysinfo_value("kbd.inr"), &z8530_kbd);
    9494        return 0;
Note: See TracChangeset for help on using the changeset viewer.