git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Unifying External Interrupt System (#51)
[lunaix-os.git]
/
lunaix-os
/
hal
/
char
/
uart
/
16x50_isa.c
diff --git
a/lunaix-os/hal/char/uart/16x50_isa.c
b/lunaix-os/hal/char/uart/16x50_isa.c
index 39582236364660f4a1e21144eadf27a69ffd45ff..152317a5cdeb71dc97eace2d0c49287263b612cb 100644
(file)
--- a/
lunaix-os/hal/char/uart/16x50_isa.c
+++ b/
lunaix-os/hal/char/uart/16x50_isa.c
@@
-2,7
+2,6
@@
#include <lunaix/syslog.h>
#include <asm/x86_pmio.h>
#include <lunaix/syslog.h>
#include <asm/x86_pmio.h>
-#include <asm/x86_isrm.h>
#include "16x50.h"
#include "16x50.h"
@@
-11,10
+10,9
@@
LOG_MODULE("16x50-isa");
static DEFINE_LLIST(com_ports);
static void
static DEFINE_LLIST(com_ports);
static void
-com_irq_handler(const struct hart_state* hstate)
+com_irq_handler(
irq_t irq,
const struct hart_state* hstate)
{
{
- int vector = hart_vector_stamp(hstate);
- uart_handle_irq_overlap(vector, &com_ports);
+ uart_handle_irq_overlap(irq, &com_ports);
}
int
}
int
@@
-25,6
+23,7
@@
isa16x50_create_once(struct device_def* def)
int* irqs[] = { &irq4, &irq3, &irq4, &irq3 };
struct uart16550* uart = NULL;
int* irqs[] = { &irq4, &irq3, &irq4, &irq3 };
struct uart16550* uart = NULL;
+ struct serial_dev* sdev;
ptr_t base;
// COM 1...4
ptr_t base;
// COM 1...4
@@
-37,20
+36,20
@@
isa16x50_create_once(struct device_def* def)
continue;
}
continue;
}
+ sdev = uart_create_serial(uart, &def->class, &com_ports, "S");
+
int irq = *irqs[i];
if (irq) {
/*
* Since these irqs are overlapped, this particular setup is needed
* to avoid double-bind
*/
int irq = *irqs[i];
if (irq) {
/*
* Since these irqs are overlapped, this particular setup is needed
* to avoid double-bind
*/
- uart->iv = isrm_bindirq(irq, com_irq_handler);
+ uart->irq = irq_declare_line(com_irq_handler, irq);
+ irq_assign(irq_owning_domain(sdev->dev), uart->irq, NULL);
*((volatile int*)irqs[i]) = 0;
}
*((volatile int*)irqs[i]) = 0;
}
-
- INFO("base: 0x%x, irq=%d",
- base, irq, uart->iv);
-
- uart_create_serial(uart, &def->class, &com_ports, "S");
+
+ INFO("base: 0x%x, irq=%d", base, irq);
}
return 0;
}
return 0;