Changeset 7688b5d in mainline for kernel/arch/mips32/src/drivers/serial.c
- Timestamp:
- 2006-10-18T09:54:13Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6fb30a1
- Parents:
- 19de05f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/mips32/src/drivers/serial.c
r19de05f r7688b5d 38 38 #include <console/chardev.h> 39 39 #include <console/console.h> 40 #include <ddi/irq.h> 40 41 42 #define SERIAL_IRQ 2 43 44 static irq_t serial_irq; 41 45 static chardev_t console; 42 46 static serial_t sconf[SERIAL_MAX]; … … 92 96 } 93 97 94 95 /** Process keyboard interrupt. Does not work in simics? */ 96 static void serial_interrupt(int n, void *stack) 98 static void serial_handler(void) 97 99 { 98 serial_t *sd = (serial_t *) console.data;100 serial_t *sd = (serial_t *) console.data; 99 101 char ch; 100 102 … … 108 110 } 109 111 112 /** Process keyboard interrupt. Does not work in simics? */ 113 static void serial_irq_handler(irq_t *irq, void *arg, ...) 114 { 115 if ((irq->notif_cfg.notify) && (irq->notif_cfg.answerbox)) 116 ipc_irq_send_notif(irq); 117 else 118 serial_handler(); 119 } 110 120 121 static irq_ownership_t serial_claim(void) 122 { 123 return IRQ_ACCEPT; 124 } 111 125 112 126 static chardev_operations_t serial_ops = { … … 117 131 }; 118 132 119 iroutine old_timer; 120 /** Do polling on timer interrupt */ 121 static void timer_replace(int n, istate_t *istate) 122 { 123 old_timer(n, istate); 124 serial_interrupt(n, istate); 125 } 126 127 void serial_console(void) 133 void serial_console(devno_t devno) 128 134 { 129 135 serial_t *sd = &sconf[0]; … … 133 139 console.data = sd; 134 140 kb_enabled = true; 141 142 irq_initialize(&serial_irq); 143 serial_irq.devno = devno; 144 serial_irq.inr = SERIAL_IRQ; 145 serial_irq.claim = serial_claim; 146 serial_irq.handler = serial_irq_handler; 147 irq_register(&serial_irq); 135 148 136 // int_register(2, "serial_drvr", serial_interrupt);137 149 /* I don't know why, but the serial interrupts simply 138 150 * don't work on simics 139 151 */ 140 old_timer = int_register(TIMER_IRQ, "serial_drvr_poll", timer_replace);152 timer_fnc = &serial_handler; 141 153 142 154 stdin = &console;
Note:
See TracChangeset
for help on using the changeset viewer.