import cbaos v0.1
[cbaos.git] / drivers / serial / unix_serial.c
blob41273ceeb66764611759fa9ae9dbf6089e73db39
1 /* Author: Domen Puncer <domen@cba.si>. License: WTFPL, see file LICENSE */
2 #include <unistd.h>
3 #include <driver.h>
5 static int uart_probe(struct device *dev, int data)
7 return 0;
9 static int uart_open(struct device *dev, int flags)
11 // implement O_NONBLOCK
12 return 0;
14 static void uart_close(struct device *dev)
17 static int uart_read(struct device *dev, void *buf, size_t count)
19 return read(0, buf, count);
21 static int uart_write(struct device *dev, const void *buf, size_t count)
23 return write(1, buf, count);
26 struct driver uart_driver = {
27 .probe = uart_probe,
28 .open = uart_open,
29 .close = uart_close,
30 .read = uart_read,
31 .write = uart_write,