rewrite the device subsystem interfaces (#48)
[lunaix-os.git] / lunaix-os / hal / char / uart / 16x50_isa.c
index d8d2e1b7d971e06c0d8140f1a4ad9ee966afb6b5..39582236364660f4a1e21144eadf27a69ffd45ff 100644 (file)
@@ -1,8 +1,8 @@
 #include <lunaix/device.h>
-#include <lunaix/generic/isrm.h>
 #include <lunaix/syslog.h>
 
-#include <sys/port_io.h>
+#include <asm/x86_pmio.h>
+#include <asm/x86_isrm.h>
 
 #include "16x50.h"
 
@@ -17,8 +17,8 @@ com_irq_handler(const struct hart_state* hstate)
     uart_handle_irq_overlap(vector, &com_ports);
 }
 
-static int
-upiom_init(struct device_def* def)
+int
+isa16x50_create_once(struct device_def* def)
 {
     int irq3 = 3, irq4 = 4;
     u16_t ioports[] = { 0x3F8, 0x2F8, 0x3E8, 0x2E8 };
@@ -54,11 +54,4 @@ upiom_init(struct device_def* def)
     }
 
     return 0;
-}
-
-static struct device_def uart_pmio_def = {
-    .class = DEVCLASS(DEVIF_SOC, DEVFN_CHAR, DEV_UART16550),
-    .name = "16550 UART (PIO)",
-    .init = upiom_init
-};
-EXPORT_DEVICE(uart16550_pmio, &uart_pmio_def, load_onboot);
\ No newline at end of file
+}
\ No newline at end of file