Changeset 0d107f31 in mainline
- Timestamp:
- 2006-10-13T20:42:54Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7dcf22a
- Parents:
- 8ce8499
- Location:
- kernel
- Files:
-
- 2 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/Makefile
r8ce8499 r0d107f31 149 149 generic/src/ddi/ddi.c \ 150 150 generic/src/interrupt/interrupt.c \ 151 generic/src/interrupt/irq.c \ 151 152 generic/src/main/main.c \ 152 153 generic/src/main/kinit.c \ -
kernel/arch/sparc64/src/drivers/kbd.c
r8ce8499 r0d107f31 41 41 #include <genarch/kbd/ns16550.h> 42 42 #endif 43 43 #include <irq.h> 44 44 #include <arch/mm/page.h> 45 45 #include <arch/types.h> … … 52 52 53 53 kbd_type_t kbd_type = KBD_UNKNOWN; 54 55 static irq_t kbd_irq; 54 56 55 57 /** Initialize keyboard. … … 102 104 int inr; 103 105 106 irq_initialize(&kbd_irq); 107 104 108 switch (kbd_type) { 105 109 case KBD_Z8530: … … 112 116 printf("Failed to determine keyboard interrupt.\n"); 113 117 return; 118 } else { 119 kbd_irq.inr = inr; 120 kbd_irq.devno = 0; /* FIXME: assign unique devno */ 121 kbd_irq.trigger = IRQ_TRIGGER_LEVEL; 122 kbd_irq.claim = z8530_claim; 123 kbd_irq.handler = z8530_irq_handler; 124 irq_register(&kbd_irq); 114 125 } 115 126 break; 127 116 128 case KBD_NS16550: 117 129 size = ((ofw_ebus_reg_t *) prop->value)->size; … … 123 135 printf("Failed to determine keyboard interrupt.\n"); 124 136 return; 137 } else { 138 kbd_irq.inr = inr; 139 kbd_irq.devno = 0; /* FIXME: assign unique devno */ 140 kbd_irq.trigger = IRQ_TRIGGER_LEVEL; 141 kbd_irq.claim = ns16550_claim; 142 kbd_irq.handler = ns16550_irq_handler; 143 irq_register(&kbd_irq); 125 144 } 126 145 break; 146 127 147 default: 128 148 panic("Unexpected type.\n"); -
kernel/arch/sparc64/src/sparc64.c
r8ce8499 r0d107f31 47 47 #include <genarch/ofw/ofw_tree.h> 48 48 #include <userspace.h> 49 #include <irq.h> 49 50 50 51 bootinfo_t bootinfo; … … 77 78 void arch_post_mm_init(void) 78 79 { 79 if (config.cpu_active == 1) 80 if (config.cpu_active == 1) { 81 irq_init(1<<11, 128); 80 82 standalone_sparc64_console_init(); 83 } 81 84 } 82 85 -
kernel/arch/sparc64/src/trap/interrupt.c
r8ce8499 r0d107f31 36 36 #include <arch/trap/interrupt.h> 37 37 #include <interrupt.h> 38 #include <arch/drivers/fhc.h> 39 #include <arch/drivers/kbd.h> 38 #include <irq.h> 40 39 #include <typedefs.h> 41 40 #include <arch/types.h> … … 45 44 #include <arch/barrier.h> 46 45 #include <print.h> 47 #include <genarch/kbd/z8530.h>48 46 #include <arch.h> 49 47 #include <mm/tlb.h> 50 48 #include <config.h> 49 50 /* 51 * To be removed once we get rid of the dependency in ipc_irq_bind_arch(). 52 */ 53 #include <arch/drivers/kbd.h> 54 #include <genarch/kbd/z8530.h> 51 55 52 56 /** Register Interrupt Level Handler. … … 72 76 } 73 77 78 /** Process hardware interrupt. 79 * 80 * @param n Ignored. 81 * @param istate Ignored. 82 */ 74 83 void interrupt(int n, istate_t *istate) 75 84 { … … 80 89 data0 = asi_u64_read(ASI_UDB_INTR_R, ASI_UDB_INTR_R_DATA_0); 81 90 82 switch (data0) { 83 #ifdef CONFIG_Z8530 84 case Z8530_INTRCV_DATA0: 85 if (kbd_type != KBD_Z8530) 86 break; 91 irq_t *irq = irq_dispatch(data0); 92 if (irq) { 87 93 /* 88 * So far, we know we got this interrupt through the FHC. 89 * Since we don't have enough information about the FHC and 90 * because the interrupt looks like level sensitive, 91 * we cannot handle it by scheduling one of the level 92 * interrupt traps. Call the interrupt handler directly. 94 * The IRQ handler was found. 93 95 */ 94 95 if (z8530_belongs_to_kernel) 96 z8530_interrupt(); 97 else 98 ipc_irq_send_notif(0); 99 fhc_clear_interrupt(central_fhc, data0); 100 break; 101 96 irq->handler(irq, irq->arg); 97 } else if (data0 > config.base) { 98 /* 99 * This is a cross-call. 100 * data0 contains address of kernel function. 101 * We call the function only after we verify 102 * it is on of the supported ones. 103 */ 104 #ifdef CONFIG_SMP 105 if (data0 == (uintptr_t) tlb_shootdown_ipi_recv) { 106 tlb_shootdown_ipi_recv(); 107 } 102 108 #endif 103 default: 104 if (data0 > config.base) { 105 /* 106 * This is a cross-call. 107 * data0 contains address of kernel function. 108 * We call the function only after we verify 109 * it is on of the supported ones. 110 */ 111 #ifdef CONFIG_SMP 112 if (data0 == (uintptr_t) tlb_shootdown_ipi_recv) { 113 tlb_shootdown_ipi_recv(); 114 break; 115 } 109 } else { 110 /* 111 * Spurious interrupt. 112 */ 113 #ifdef CONFIG_DEBUG 114 printf("cpu%d: spurious interrupt (intrcv=%#llx, data0=%#llx)\n", CPU->id, intrcv, data0); 116 115 #endif 117 }118 119 printf("cpu%d: spurious interrupt (intrcv=%#llx, data0=%#llx)\n", CPU->id, intrcv, data0);120 break;121 116 } 122 117 -
kernel/genarch/include/kbd/ns16550.h
r8ce8499 r0d107f31 39 39 40 40 #include <typedefs.h> 41 #include <irq.h> 41 42 42 43 extern void ns16550_init(void); … … 45 46 extern void ns16550_release(void); 46 47 extern char ns16550_key_read(chardev_t *d); 48 extern irq_ownership_t ns16550_claim(void); 49 extern void ns16550_irq_handler(irq_t *irq, void *arg, ...); 47 50 48 51 #endif -
kernel/genarch/include/kbd/z8530.h
r8ce8499 r0d107f31 38 38 #define KERN_Z8530_H_ 39 39 40 #include <irq.h> 40 41 #include <typedefs.h> 41 42 #define Z8530_INTRCV_DATA0 0x39 /* hardcoded for use in Simics */43 42 44 43 extern bool z8530_belongs_to_kernel; … … 50 49 extern void z8530_interrupt(void); 51 50 extern char z8530_key_read(chardev_t *d); 51 extern irq_ownership_t z8530_claim(void); 52 extern void z8530_irq_handler(irq_t *irq, void *arg, ...); 52 53 53 54 #endif -
kernel/genarch/src/kbd/ns16550.c
r8ce8499 r0d107f31 40 40 #include <genarch/kbd/scanc_sun.h> 41 41 #include <arch/drivers/ns16550.h> 42 #include <irq.h> 42 43 #include <arch/interrupt.h> 43 44 #include <cpu.h> … … 161 162 } 162 163 164 irq_ownership_t ns16550_claim(void) 165 { 166 /* TODO */ 167 return IRQ_ACCEPT; 168 } 169 170 void ns16550_irq_handler(irq_t *irq, void *arg, ...) 171 { 172 panic("Not yet implemented.\n"); 173 } 174 163 175 /** @} 164 176 */ -
kernel/genarch/src/kbd/z8530.c
r8ce8499 r0d107f31 40 40 #include <genarch/kbd/scanc_sun.h> 41 41 #include <arch/drivers/z8530.h> 42 #include <irq.h> 42 43 #include <arch/interrupt.h> 43 44 #include <arch/drivers/kbd.h> 45 #include <arch/drivers/fhc.h> 44 46 #include <cpu.h> 45 47 #include <arch/asm.h> … … 170 172 } 171 173 174 irq_ownership_t z8530_claim(void) 175 { 176 return (z8530_read_a(RR0) & RR0_RCA); 177 } 178 179 void z8530_irq_handler(irq_t *irq, void *arg, ...) 180 { 181 /* 182 * So far, we know we got this interrupt through the FHC. 183 * Since we don't have enough information about the FHC and 184 * because the interrupt looks like level sensitive, 185 * we cannot handle it by scheduling one of the level 186 * interrupt traps. Process the interrupt directly. 187 */ 188 if (z8530_belongs_to_kernel) 189 z8530_interrupt(); 190 else 191 ipc_irq_send_notif(0); 192 fhc_clear_interrupt(central_fhc, irq->inr); 193 } 194 172 195 /** @} 173 196 */ -
kernel/generic/include/ipc/irq.h
r8ce8499 r0d107f31 33 33 */ 34 34 35 #ifndef KERN_I RQ_H_36 #define KERN_I RQ_H_35 #ifndef KERN_IPC_IRQ_H_ 36 #define KERN_IPC_IRQ_H_ 37 37 38 38 /** Maximum length of IPC IRQ program */
Note:
See TracChangeset
for help on using the changeset viewer.