Ignore:
Timestamp:
2009-11-15T19:12:47Z (14 years ago)
Author:
Pavel Rimsky <pavel@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5f678b1c
Parents:
69b68d1f
Message:

Kernel MM implemented.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc64/src/drivers/niagara.c

    r69b68d1f r70a1c59  
    6666static niagara_instance_t *instance = NULL;
    6767
    68 /* functions referenced from definitions of I/O operations structures */
    6968static void niagara_putchar(outdev_t *, const wchar_t, bool);
    70 //static void niagara_noop(chardev_t *);
    71 //static char niagara_read(chardev_t *);
    7269
    7370/** character device operations */
     
    104101chardev_t niagara_io;
    105102
    106 /**
    107  * Niagara IRQ structure. So far used only for notifying the userspace of the
    108  * key being pressed, not for kernel being informed about keyboard interrupts.
    109  */
    110 static irq_t niagara_irq;
    111 
    112103/** defined in drivers/kbd.c */
    113104extern kbd_type_t kbd_type;
     
    119110static char read_char;
    120111
    121 /**
    122  * The driver works in polled mode, so no interrupt should be handled by it.
    123  */
    124 static irq_ownership_t niagara_claim(void)
    125 {
    126         return IRQ_DECLINE;
    127 }
    128 
    129 /**
    130  * The driver works in polled mode, so no interrupt should be handled by it.
    131  */
    132 static void niagara_irq_handler(irq_t *irq, void *arg, ...)
    133 {
    134         panic("Not yet implemented, SGCN works in polled mode.\n");
    135 }
    136112
    137113#endif
     
    146122/** Writes a single character to the standard output. */
    147123static void niagara_putchar(outdev_t *dev, const wchar_t ch, bool silent)
    148 //static void niagara_putchar(struct chardev * cd, const char c)
    149124{
    150125        do_putchar(ch);
     
    230205        if (__hypercall_fast_ret1(0, 0, 0, 0, 0, CONS_GETCHAR, &c) == EOK) {
    231206                indev_push_character(instance->srlnin, c);
    232                 #if 0
    233                 ipl_t ipl = interrupts_disable();
    234                 spinlock_lock(&niagara_irq.lock);
    235 
    236                 if (niagara_irq.notif_cfg.notify &&
    237                                 niagara_irq.notif_cfg.answerbox) {
    238                         /*
    239                          * remember the character, uspace will pick it
    240                          * up using pseudocode
    241                          */
    242                         read_char = (char) c;
    243                         ipc_irq_send_notif(&niagara_irq);
    244                         spinlock_unlock(&niagara_irq.lock);
    245                         interrupts_restore(ipl);
    246                         return;
    247                 } else {
    248                         spinlock_unlock(&niagara_irq.lock);
    249                         interrupts_restore(ipl);       
    250 
    251                         chardev_push_character(&niagara_io, c);
    252                         if (c == '\r')
    253                                 chardev_push_character(&niagara_io, '\n');
    254                 }
    255                 #endif
    256207        }
    257208
     
    334285        ddi_parea_register(&outbuf_parea);
    335286
    336         chardev_initialize("niagara_io", &niagara_io, &niagara_ops);
    337         stdin = &niagara_io;
    338         stdout = &niagara_io;
    339287        #endif
    340288
     
    351299        niagara_init();
    352300
    353         // TODO - move to console init
    354301        if (instance) {
    355302                srln_instance_t *srln_instance = srln_init();
Note: See TracChangeset for help on using the changeset viewer.