Changeset 3e828ea in mainline for kernel/arch/mips32/src/mach/malta/malta.c
- Timestamp:
- 2019-09-23T12:49:29Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9be2358
- Parents:
- 9259d20 (diff), 1a4ec93f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - git-author:
- Jiri Svoboda <jiri@…> (2019-09-22 12:49:07)
- git-committer:
- Jiri Svoboda <jiri@…> (2019-09-23 12:49:29)
- File:
-
- 1 edited
-
kernel/arch/mips32/src/mach/malta/malta.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/mips32/src/mach/malta/malta.c
r9259d20 r3e828ea 42 42 #include <genarch/srln/srln.h> 43 43 #include <arch/interrupt.h> 44 #include <stdbool.h> 45 #include <byteorder.h> 46 #include <sysinfo/sysinfo.h> 47 #include <log.h> 44 48 45 49 static void malta_init(void); … … 68 72 #endif 69 73 70 #ifdef CONFIG_NS16550 71 static void tty_clear_interrupt(void *arg, inr_t inr) 74 static void malta_isa_irq_handler(unsigned int i) 72 75 { 73 (void) pio_read_8((ioport8_t *) GT64120_PCI0_INTACK); 74 pic_eoi(); 76 uint8_t isa_irq = host2uint32_t_le(pio_read_32(GT64120_PCI0_INTACK)); 77 if (i8259_is_spurious(isa_irq)) { 78 i8259_handle_spurious(isa_irq); 79 #ifdef CONFIG_DEBUG 80 log(LF_ARCH, LVL_DEBUG, "cpu%u: PIC spurious interrupt %u", 81 CPU->id, isa_irq); 82 return; 83 #endif 84 } 85 irq_t *irq = irq_dispatch_and_lock(isa_irq); 86 if (irq) { 87 irq->handler(irq); 88 irq_spinlock_unlock(&irq->lock, false); 89 } else { 90 #ifdef CONFIG_DEBUG 91 log(LF_ARCH, LVL_DEBUG, "cpu%u: unhandled IRQ (irq=%u)", 92 CPU->id, isa_irq); 93 #endif 94 } 95 i8259_eoi(isa_irq); 75 96 } 76 #endif77 97 78 98 void malta_init(void) 79 99 { 80 i8259_init((i8259_t *) PIC0_BASE, (i8259_t *) PIC1_BASE, 2, 0, 8); 100 irq_init(ISA_IRQ_COUNT, ISA_IRQ_COUNT); 101 102 i8259_init((i8259_t *) PIC0_BASE, (i8259_t *) PIC1_BASE, 0); 103 sysinfo_set_item_val("i8259", NULL, true); 104 105 int_handler[INT_HW0] = malta_isa_irq_handler; 106 cp0_unmask_int(INT_HW0); 81 107 82 108 #if (defined(CONFIG_NS16550) || defined(CONFIG_NS16550_OUT)) … … 86 112 outdev_t **tty_out_ptr = NULL; 87 113 #endif 88 tty_instance = ns16550_init((ioport8_t *) TTY_BASE, 0, TTY_ CPU_INT,89 tty_clear_interrupt, NULL, tty_out_ptr);114 tty_instance = ns16550_init((ioport8_t *) TTY_BASE, 0, TTY_ISA_IRQ, 115 NULL, NULL, tty_out_ptr); 90 116 #endif 91 117 } … … 120 146 indev_t *srln = srln_wire(srln_instance, sink); 121 147 ns16550_wire(tty_instance, srln); 122 pic_enable_irqs(1 << TTY_ISA_IRQ); 123 cp0_unmask_int(TTY_CPU_INT); 148 i8259_enable_irqs(1 << TTY_ISA_IRQ); 124 149 } 125 150 }
Note:
See TracChangeset
for help on using the changeset viewer.
