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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.